GLM: order of terms in model

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GLM: order of terms in model

Christian Landry
Dear R-helpers,

I have been analysing data using a GLM. My model is as follows:

mod <- glm (V ~ T + as.factor(A) + N, family="gaussian")

and using

anova(mod, test="F")

to get the analysis of deviance table and the fraction of deviance  
explained by each term.

T and A dominate with respect to their Deviance, with T having a  
larger effect than A (about twice)

However, if I reverse T and A in the model, I get that A now explains  
more deviance than T.

My questions are: 1) What is it due to?
                                2) Is there any way around this? How do I find which model is  
best and/or can I use another method that won't be sensitive to the  
order of the terms.

Thanks,

Christian

Reply to: [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: GLM: order of terms in model

Thomas Lumley

This is a FAQ

7.18 Why does the output from anova() depend on the order of factors in
the model?

  -thomas

On Fri, 9 Mar 2007, Christian Landry wrote:

> Dear R-helpers,
>
> I have been analysing data using a GLM. My model is as follows:
>
> mod <- glm (V ~ T + as.factor(A) + N, family="gaussian")
>
> and using
>
> anova(mod, test="F")
>
> to get the analysis of deviance table and the fraction of deviance
> explained by each term.
>
> T and A dominate with respect to their Deviance, with T having a
> larger effect than A (about twice)
>
> However, if I reverse T and A in the model, I get that A now explains
> more deviance than T.
>
> My questions are: 1) What is it due to?
> 2) Is there any way around this? How do I find which model is
> best and/or can I use another method that won't be sensitive to the
> order of the terms.
>
> Thanks,
>
> Christian
>
> Reply to: [hidden email]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

Thomas Lumley Assoc. Professor, Biostatistics
[hidden email] University of Washington, Seattle

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.