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: c.landry at umontreal.ca
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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
tlumley at u.washington.edu University of Washington, Seattle