[R] type III ANOVA for a nested linear model

Carsten Jaeger carsten_jaeger at web.de
Tue Jul 10 13:14:36 CEST 2007


Hello,

is it possible to obtain type III sums of squares for a nested model as
in the following:

lmod <- lm(resp ~ A * B + (C %in% A), mydata))

I have tried

library(car)
Anova(lmod, type="III")

but this gives me an error (and I also understand from the documentation
of Anova as well as from a previous request
(http://finzi.psych.upenn.edu/R/Rhelp02a/archive/64477.html) that it is
not possible to specify nested models with car's Anova).

anova(lmod) works, of course.

My data (given below) is balanced so I expect the results to be similar
for both type I and type III sums of squares. But are they *exactly* the
same? The editor of the journal which I'm sending my manuscript to
requests what he calls "conventional" type III tests and I'm not sure if
can convince him to accept my type I analysis.

R> mydata
      A     B     C  resp
1     1     1      1 34.12
2     1     1      2 32.45
3     1     1      3 44.55
4     1     2      1 20.88
5     1     2      2 22.32
6     1     2      3 27.71
7     2     1      6 38.20
8     2     1      7 31.62
9     2     1      8 38.71
10    2     2      6 18.93
11    2     2      7 20.57
12    2     2      8 31.55
13    3     1      9 40.81
14    3     1     10 42.23
15    3     1     11 41.26
16    3     2      9 28.41
17    3     2     10 24.07
18    3     2     11 21.16

Thanks a lot,

Carsten



More information about the R-help mailing list