[R] different results depending of variable position.

Ronaldo Reis Jr. chrysopa at insecta.ufv.br
Tue Oct 14 11:14:34 CEST 2003


Hi,

I make an analysis and depending of the order of the variables, the 
significance change, look.

m1 <- glm((infec/ntot)~idade+sexo+peso,family=binomial,weights=ntot)
> anova(m1,test="F")
Analysis of Deviance Table

Model: binomial, link: logit

Response: (infec/ntot)

Terms added sequentially (first to last)


      Df Deviance Resid. Df Resid. Dev       F    Pr(>F)    
NULL                     80     83.234                      
idade  1    1.302        79     81.932  1.3020 0.2538510    
sexo   1    9.137        78     72.796  9.1366 0.0025055 ** 
peso   1   12.937        77     59.859 12.9373 0.0003221 ***
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 
> m1 <- glm((infec/ntot)~sexo+peso+idade,family=binomial,weights=ntot)
> anova(m1,test="F")
Analysis of Deviance Table

Model: binomial, link: logit

Response: (infec/ntot)

Terms added sequentially (first to last)


      Df Deviance Resid. Df Resid. Dev       F    Pr(>F)    
NULL                     80     83.234                      
sexo   1    8.278        79     74.956  8.2780 0.0040128 ** 
peso   1   11.171        78     63.785 11.1711 0.0008308 ***
idade  1    3.927        77     59.859  3.9268 0.0475237 *  
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 
> m1 <- glm((infec/ntot)~peso+idade+sexo,family=binomial,weights=ntot)
> anova(m1,test="F")
Analysis of Deviance Table

Model: binomial, link: logit

Response: (infec/ntot)

Terms added sequentially (first to last)


      Df Deviance Resid. Df Resid. Dev       F    Pr(>F)    
NULL                     80     83.234                      
peso   1   15.162        79     68.072 15.1623 9.865e-05 ***
idade  1    2.773        78     65.299  2.7731   0.09586 .  
sexo   1    5.440        77     59.859  5.4405   0.01968 *  
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 
> m1 <- glm((infec/ntot)~idade+peso+sexo,family=binomial,weights=ntot)
> anova(m1,test="F")
Analysis of Deviance Table

Model: binomial, link: logit

Response: (infec/ntot)

Terms added sequentially (first to last)


      Df Deviance Resid. Df Resid. Dev       F    Pr(>F)    
NULL                     80     83.234                      
idade  1    1.302        79     81.932  1.3020   0.25385    
peso   1   16.633        78     65.299 16.6334 4.534e-05 ***
sexo   1    5.440        77     59.859  5.4405   0.01968 *  
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 
> 

Why this?

How the best method to select the model (with idade or without idade)? AIC?

Thanks
Ronaldo
-- 

Entre dois pecados, eu sempre escolho o que ainda não cometi

--Mae West
--
|>   // | \\   [***********************************]
|   ( õ   õ )  [Ronaldo Reis Júnior                ]
|>      V      [UFV/DBA-Entomologia                ]
|    /     \   [36571-000 Viçosa - MG              ]
|>  /(.''`.)\  [Fone: 31-3899-2532                 ]
|  /(: :'  :)\ [chrysopa at insecta.ufv.br            ]
|>/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ]
|    ( `-  )   [***********************************]
|>>  _/   \_Powered by GNU/Debian Woody/Sarge




More information about the R-help mailing list