[R] library(car) Anova() and Error-term in aov()

Paul Lemmens P.Lemmens at nici.kun.nl
Thu Aug 26 13:30:10 CEST 2004

Dear all,

Type III SS time again. This case trying to reproduce some SPSS (type III) 
data in R for a repeated measures anova with a betwSS factor included. As I 
understand this list etc, if I want type III then I can do

Anova(lm.obj, type="III")

But for the repeated measures anova, I need to include an Error-term in the 
aov() call (Psychology-guide from Jonathan Baron) which results in multiple 
lm() calls. Anova() does not seem capable to handle this situation. Or am I 
tackling Type III calculation, in this case with Error(), the wrong way 
(besides ignoring advice concerning Type I vs III)??

For instance,

dat <- rnorm(12)
pp <- factor(c(rep(1:3,2), rep(4:6,2)))
betw <- gl(2,6)
A <- factor(rep(c(rep('a',3),rep('b',3)), 2))
taov <- aov(dat~betw*A+Error(pp/A))
Anova(taov, type="III") # Goes wrong with following error.
#Error in Anova(taov, type = "III") : no applicable method for "Anova"

Phrased differently, ?Anova says "Calculates type-II or type-III 
analysis-of-variance tables for model objects produced by 'lm' and 'glm'", 
so it's not suitable for the aovlist that aov() with Error()-term returns. 
How can I compute Type III SS for such objects?

kind regards,

Paul Lemmens
NICI, University of Nijmegen              ASCII Ribbon Campaign /"\
Montessorilaan 3 (B.01.05)                    Against HTML Mail \ /
NL-6525 HR Nijmegen                                              X
The Netherlands                                                 / \
Phonenumber    +31-24-3612648
Fax            +31-24-3616066

More information about the R-help mailing list