Re: [R] set type of SS in anova()

From: Prof Brian Ripley <>
Date: Sat, 05 Jul 2008 08:04:00 +0100 (BST)

drop1() in R meets both your objection and that to 'Type III'.

If you really want the so-called Type III, look at function Anova() in package car. But also consider

library(fortunes); fortune(54); fortune((55); fortune(56)

On Fri, 4 Jul 2008, jeroenooms wrote:

> When you use the 'general linear model' analysis in SPSS, the first result is
> a table with all terms with F-tests and significance values for all IV's. It
> uses SS Type III , which has
> the advantage that the order in which the variables are added to the model
> does not matter, and therefore it is relatively objective.

No, as the terms may well have a natural hierachy in which case the order does matter.

> I would like to reproduce this output in R. However, when using
> anova(glm.object, test="F"), the F test shows "Terms added sequentially
> (first to last)". Because of this, the F values and p values of the terms
> depend on the sequence in which they were added. Eg: an anova() of
> glm(a~b+c) will give other results than glm(a~c+b).

Hmm: glm() is used for generalized linear models, and there sums of squares are only appropriate for those models where lm() is more appropriate.

> How can I specify the SS type of an anova in R, so that i can reproduce the
> exact results as that i got in SPSS?

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sat 05 Jul 2008 - 07:08:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 05 Jul 2008 - 08:31:05 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive