[R] Type II and III sums of squares with Error in AOV

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Nov 9 12:12:05 CET 2005


A multistratum aov() fit is just a list of aov() fits, so you can apply 
functions such as Anova to the individual strata.

However, why do you want types II and III sums of squares?  It is usual 
to do this type of analysis only with balanced designs.  In the cases I 
can envisage that these make any sense, they are the same as type I
(and in cases with only one treatment effect, they always are).

On Tue, 8 Nov 2005, Jarrett Byrnes wrote:

> I've recently run into the problem of using aov with nested factors,
> and wanting to get the type II and III sums of squares.  Normally Anova
> from the car package would do fine, but it doesn't like having an Error
> included, so
>
> my.aov <-aov(Response ~ Treatment + Error(Treatment:Replicate))
> Anova(my.aov, type="II")
>
> yields
>
> Error in Anova(nested.anova) : no applicable method for "Anova"
>
> And lm does not take Error as an argument.

Nor does log()!  Is that relevant?

> Error in eval(expr, envir, enclos) : couldn't find function "Error"
>
> Is there a way to get these additional types of sums of squares when
> Error is included in an aov model?

Have you read the reference on the aov help page?  That might be a good 
step to deepening your understanding of what Error() does.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list