<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Oi, <br><br>o que fiz:<br><br><br>#Inserindo a tabela<br>binom<-read.table("oficial.txt", header=T)<br><br>#Elilimindo linhas com NAs<br>binom.na<-na.omit(binom)<br><br># Nomeei cada variável<br><br>#Padronizando variáveis contínuas<br>clouds.p<-(clouds-mean(clouds,na.rm=T))/sd(clouds,na.rm=T)<br>sst.p<-(sst-mean(sst))/sd(sst)<br>protection.p<-(protection-mean(protection))/sd(protection)<br>bayangle.p<-(bayangle-mean(bayangle))/sd(bayangle)<br>effort.p<-(effort-mean(effort,na.rm=T))/sd(effort,na.rm=T)<br>year.p<-(year-mean(year))/sd(year)<br>month.n.p<-(month.n-mean(month.n))/sd(month.n)<br>month.q<-(month.n.p)^2  #quadrático<br>visib.p<-(visib-(mean(visib,na.rm=T))/sd(visib,na.rm=T))<br>sea.p<-(sea-(mean(sea,na.rm=T))/sd(sea,na.rm=T))<br>north_south.p<-(north_south-(mean(north_south,na.rm=T))/sd(north_south,na.rm=T))<br>east_west.p<-(east_west-(mean(east_west,na.rm=T))/sd(east_west,na.rm=T))<br><br><br>#Fazendo soma de dois termos<br>y<- cow+calf<br><br>#Gerando um primeiro modelo<br>M1 <- glm(cbind(y,total-y) ~ factor(outfall) + factor(floortype) + protection.p + bayangle.p + factor(morphotype) +<br>year.p + month.q + north_south.p + east_west.p + clouds.p + visib.p + sea.p + offset(effort.p), family=binomial, data=binom.na)<br>summary(M1)<br>#AIC: 8954.3<br><br>#Tentando a seleção automática<br>step(M1)<br><br>#Retorno da tentativa:<br>Start:  AIC=8954.29<br>cbind(y, total - y) ~ factor(outfall) + factor(floortype) + protection.p + <br>    bayangle.p + factor(morphotype) + year.p + month.q + north_south.p + <br>    east_west.p + clouds.p + visib.p + sea.p + offset(effort.p)<br><br>                     Df Deviance    AIC<br>- visib.p             1   7786.0 8952.7<br><none>                    7785.6 8954.3<br>- sea.p               1   7814.9 8981.6<br>- protection.p        1   7818.5 8985.2<br>- factor(outfall)     1   7824.3 8991.0<br>- east_west.p         1   7829.6 8996.3<br>- clouds.p            1   7843.0 9009.7<br>- north_south.p       1   7890.2 9056.9<br>- year.p              1   7936.4 9103.1<br>- month.q             1   7959.1 9125.8<br>- bayangle.p          1   7969.0 9135.7<br>- factor(morphotype)  1   8033.2 9199.9<br>- factor(floortype)   3   8184.2 9346.9<br>Erro em step(M1) : <br>  Número de linhas em uso mudou: remover valores ausentes?<br><br>#Tentei também<br>step(M1, na.action="na.exclude")<br>#que resulta no mesmo problema<br><br>Tentei ainda aplicar a função para um modelo binomial negativo, e ocorreu o mesmo erro.<br><br>Segundo a indicação de um colega da lista, o erro pode estar associando à especificação  da função step(), indicada no seu help:<br><br id="FontBreak"><font style="font-size: 10pt;" face="Tahoma" size="2"><span style="font-size:10pt;background-color:white"><font color="black"><span style="font-size:;text-transform:none">"The</span></font><font color="black"><span style="font-size:;text-transform:none"> </span></font><font color="black" face="Courier New" size="-1"><span style="font-weight:normal;font-variant:normal;text-transform:none">"glm"</span></font><font color="black"><span style="font-size:;text-transform:none">method
for function</span></font><font color="black"><span style="font-size:;text-transform:none"> </span></font><a href="http://127.0.0.1:14216/library/stats/help/extractAIC" target="_blank"><font color="purple" face="Courier New" size="-1"><span style="font-weight:normal;font-variant:normal;text-transform:none">extractAIC</span></font></a><font color="black"><span style="font-size:;text-transform:none"> </span></font><font color="black"><span style="font-size:;text-transform:none">makes
the appropriate adjustment for a</span></font><font color="black"><span style="font-size:;text-transform:none"> </span></font><font color="black" face="Courier New" size="-1"><span style="font-weight:normal;font-variant:normal;text-transform:none">gaussian</span></font><font color="black"><span style="font-size:;text-transform:none"> </span></font><font color="black"><span style="font-size:;text-transform:none">family,
but may need to be amended for other cases. (The</span></font><font color="black"><span style="font-size:;text-transform:none"> </span></font><font color="black" face="Courier New" size="-1"><span style="font-weight:normal;font-variant:normal;text-transform:none">binomial</span></font><font color="black"><span style="font-size:;text-transform:none"> </span></font><font color="black"><span style="font-size:;text-transform:none">and</span></font><font color="black" face="Courier New" size="-1"><span style="font-weight:normal;font-variant:normal;text-transform:none">poisson</span></font><font color="black"><span style="font-size:;text-transform:none"> </span></font><font color="black"><span style="font-size:;text-transform:none">families
have fixed</span></font><font color="black"><span style="font-size:;text-transform:none"> </span></font><font color="black" face="Courier New" size="-1"><span style="font-weight:normal;font-variant:normal;text-transform:none">scale</span></font><font color="black"><span style="font-size:;text-transform:none"> </span></font><font color="black"><span style="font-size:;text-transform:none">by
default and do not correspond to a particular maximum-likelihood problem for variable</span></font><font color="black"><span style="font-size:;text-transform:none"> </span></font><font color="black" face="Courier New" size="-1"><span style="font-weight:normal;font-variant:normal;text-transform:none">scale</span></font><font color="black"><span style="font-size:;text-transform:none">.)</span></font></span></font>"<br><br><br>Obrigada. <br><br>Elisa.<br><br><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Tue, 19 Feb 2013 15:58:38 -0300<br>From: walmeszeviani@gmail.com<br>To: r-br@listas.c3sl.ufpr.br<br>Subject: Re: [R-br] Step GLM - remover valores ausentes?<br><br><div><font face="trebuchet ms,sans-serif">Forneça CMR. Sem saber como você especificou os argumentos nas funções e os dados envolvidos qualquer sugestão é uma tentativa de adivinhação.</font></div><font face="trebuchet ms,sans-serif"><div>
<font face="trebuchet ms,sans-serif"><br></font></div><div><font face="trebuchet ms,sans-serif">À disposição.</font></div><div><font face="trebuchet ms,sans-serif">Walmes.</font></div><br clear="all"></font><div><span style="font-family:trebuchet ms,sans-serif">==========================================================================</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">Walmes Marques Zeviani</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">Departamento de Estatística - Universidade Federal do Paraná</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">fone: (+55) 41 3361 3573</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">VoIP: (3361 3600) 1053 1173</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">e-mail: <a href="mailto:walmes@ufpr.br">walmes@ufpr.br</a><br>
skype: walmeszeviani<br style="font-family:trebuchet ms,sans-serif"></span><span style="font-family:trebuchet ms,sans-serif">twitter: @walmeszeviani</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">homepage: <a href="http://www.leg.ufpr.br/~walmes" target="_blank">http://www.leg.ufpr.br/~walmes</a></span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">linux user number: 531218</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">==========================================================================</span></div>
<br>_______________________________________________
R-br mailing list
R-br@listas.c3sl.ufpr.br
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forne�a c�digo m�nimo reproduz�vel.</div>                                      </div></body>
</html>