[R] anova(lme object)

Spencer Graves
Thu, 21 Aug 2003 17:25:53 -0000

The different answers reflect a lack of symmetry in the data set.
The standard "A+B" anova evaluates the effect of A by itself and B
given
A.  The other evalutes the effect of B by itself plus A given B.  They
answer different questions.  If you want the same answer from "A+B" as
from "B+A", you have to be clearer about what you want.  For more
discussion of that, see any good book on analysis of variance, including
discussions of Types II and III sums of squares, e.g., from
"www.r-project.org" -> search -> R site search.

	  Judging from what they did, it seems apparent that the R developers
and the S and S-Plus developers before them felt that it was best to
report results in this way.

hope this helps.  spencer graves

Mahbub Latif wrote:
> Hi,
>
> I use lme to fit models like
>
> R> res1 <- lme(y~A+B, data=mydata, random=~1|subject)
> R> res2 <- lme(y~B+A, data=mydata, random=~1|subject)
>
> (only difference between these two models are the
> sequence in which the indep variables are written in
> formula)
>
> where y is continuous and A, B, and subject are
> factors. To get ANOVA table I used
>
> R> anova(res1)
> R> anova(res2)
>
> and found ANOVA tables corresponding to these two
> models are different. Is there any way I can get
> similar ANOVA tables from lme objects of this type?
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help