[R] question about anova() output

Thomas Lumley tlumley at u.washington.edu
Fri Oct 26 23:49:23 CEST 2001


On Fri, 26 Oct 2001, Robert Burrows wrote:

> Hello,
>
> I am getting output from anova() and summary(aov()) that depends on the
> order of the factors in the fitted model object, and this has me baffled. I
> see this dependency with the data.frame below but not with an example (table
> 6.4) from Montgomery's DOE book. This is with R 1.3.0 on Debian GNU-Linux.
>
> Where have I gone wrong?
>

In worrying about it?

In a non-orthogonal design (ie most unbalanced designs) the sums of
squares do depend on the order. In an orthogonal design they don't. This
is because R uses sums of squares that are projections involving a nested
sequence of models.

Some packages report sums of squares that are based on comparing the full
model to the models with each factor removed one at a time.  The question
of which set of sums of squares is the Right Thing provokes low-level holy
wars on r-help from time to time.

You can compute sums of squares comparing any two models you feel like by
using
  anova(model1,model2)


This probably should be a FAQ


	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list