[R] type III Sum Sq in ANOVA table - Howto?

Thomas Lumley tlumley at u.washington.edu
Fri Mar 7 02:33:03 CET 2003

On Fri, 7 Mar 2003, Josef Frank wrote:

> Hello,
> as far as I see, R reports type I sums of squares. I'd like to get R to
> print out type III sums of squares.
> e.g. I have the following model:
> vardep~factor1*factor2
> to get the type III sum of squares for factor1 I've tried
> anova(lm(vardep~factor2+factor1:factor2),lm(vardep~factor1*factor2))
> but that didn't yield the desired result.
> Could anyone give me a hint how to proceed?

Unfortunately the arguments about whether Type III sums of squares are
part of the axis of evil have drowned out a real issue.

I would have expected the command to work, and in fact wrote a FAQ answer
saying this was the way to do it.  However, if factor1 is indeed a factor
its main effect is helpfully stuck back in the model by terms.formula.

I think this is a bug, since it doesn't happen if factor1 isn't a factor,
and leaving aside any question about Type III SS it seems to make it
impossible to fit the model
While this model isn't terribly often useful, it is sometimes.


More information about the R-help mailing list