I would just add that you might wish to install the car
package and use Anova()
that this package provides instead of anova()
because for aov()
and lm()
objects, the vanilla anova()
uses a sequential sum of squares, which gives the wrong result for unequal sample sizes while for lme()
it uses either the type-I or the type-III sum of squares depending on the type
argument, but the type-III sum of squares violates marginality-- i.e. it treats interactions no differently than main effects.
The R-help list has nothing good to say about type-I and type-III sums of squares, and yet these are the only options! Go figure.
Edit: Actually, it looks like type-II is not valid if there is a significant interaction term, and it seems the best anybody can do is use type-III when there are interactions. I got tipped off to it by an answer to one of my own questionsanswer to one of my own questions that in turn pointed me to this postthis post.