On Fri, 26 May 2000, Martin H. H. Stevens wrote:
>
> I am afraid this may turn out to be an elementary statistics lesson, but
> here goes, and thanks (and/or apologies) in advance...
>
> When I use Type I sums of squares in a linear model, the sum of squares
> of each factor (from summary.aov()) plus the residual add up to the
> total sum of squares ([n-1]*s^2 of the response variable. When I use
> Type III SS, I get something less than the total sums of squares when I
> add up the partial Sums of Squares.... Why?
I think the question is why you expect it to add up?
You can do analysis of variance when terms are added sequentially, and
so each term is given the reduction in SSq *after adding all the previous
terms&. Theorem: the SSqs add up. (Note: it is theorem, but it has
conditions.)
Now the egregious so-called type III is not an analysis of variance. Here
it is equivalent to drop1: that is it computes the increase in SSq on
dropping each term independently. Since F1 was the last to be added, it
has the same value on dropping. However, your first table has the SSq for
y1 alone, and the second for y1 after adding f1.
I think ssType=3 is best left to those who have been forceably
dragged away from a 3-letter statistics package which is stuck in the days
of capital letters on punched cards. The rest of us can use drop1,
which at least does sensible things in the presence of interactions
(unless abused).
> Example below.
>
> > y2 <- y1 + 50*runif(50)
> > y1 <- 1:50
> > F1 <- as.factor(c(rep("A",25),rep("B",25)))
> > results <- lm(y2 ~ y1 + F1)
>
> > SST <- (50-1) * var(y2)
> > SST
> [1] 25351.38
>
> > summary.aov(results, ssType=1)
> Df Sum of Sq Mean Sq F Value Pr(F)
> y1 1 14705.09 14705.09 67.42195 0.0000000
> F1 1 395.35 395.35 1.81264 0.1846493
> Residuals 47 10250.95 218.11
>
> > summary.aov(results, ssType=3)
> Type III Sum of Squares
> Df Sum of Sq Mean Sq F Value Pr(F)
> y1 1 6055.76 6055.761 27.76531 0.0000034
> F1 1 395.35 395.347 1.81264 0.1846493
> Residuals 47 10250.95 218.105
> >
>
>
>
> --
> Dr. M. Henry H. Stevens
> email: hstevens@rci.rutgers.edu
--
Brian D. Ripley, ripley@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 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news
|