[R] different results depending of variable position.

Liaw, Andy andy_liaw at merck.com
Tue Oct 14 14:18:00 CEST 2003


> From: Ronaldo Reis Jr. [mailto:chrysopa at insecta.ufv.br] 
> 
> Hi,
> 
> I make an analysis and depending of the order of the variables, the 
> significance change, look.
 
[output of glm fits omitted] 

> Why this?

Because, as the output says:

> Terms added sequentially (first to last)

When the predictors are not orthogonal (i.e., correlation=0), the question
"is variable X significant" depends on the model that's being fitted.  The
significance test that anova() performs the following comparisons, assuming
X1 through X4 are the variables:

Y ~ 1   vs.  Y ~ X1
Y ~ X1  vs.  Y ~ X1 + X2
Y ~ X1 + X2  vs.  Y ~ X1 + X2 + X3
Y ~ X1 + X2 + X3  vs.  Y ~ X1 + X2 + X3 + X4

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

That also depends on what you are looking for in the model.  If you are
looking for interpretation, probably the answer is not to select models, as
that could lead to bias in the coefficients of the selected model.

HTH,
Andy

 
> 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
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list 
> https://www.stat.math.ethz.ch/mailman/listinfo> /r-help
>




More information about the R-help mailing list