[R] type III sum of squares

Christophe Pallier pallier at lscp.ehess.fr
Wed Aug 11 13:42:07 CEST 2004

>What are the strengths and weakness of 'aov' in 'car' package?
>My model looks something like this :
> library(car)
> aov(lm(fish.length~zone*area,data=my.data))

'aov' is in the package 'stats', not in 'car'. (see ?aov)

One of the interests of 'aov' (compared to 'lm') is that using the 'Error' term in the formula allows to analyse designs  where sampling occurs at several levels (as in some though this term is not really correct)..

You may be thinking of the *Anova* function in the car package (?)
'Anova(model)' allows to compute so-called 'type II' and 'type III' sums of squares 
sparing you the need to play with the order of terms if you used 'anova' (notice the lowercase).

Type III sums of square are useful in factorial designs with unequal number of observations. 
When the factors are coded with the contrasts contr.sum or contr.helmert, the test for the main effect of a factor weights equally all subgroups 
(see John Fox's book : "An R and S-plus Companion to Applied Regression", p.140). 

I discussed this topic in a recent thread on this list ([R] Re: Enduring LME confusion.... or Psychologists and Mixed-Effects)

The archive of R-help contains several post about this topic.
I hope this helps.

Christophe Pallier

More information about the R-help mailing list