s-news
[Top] [All Lists]

[S] Statistics question

To: Mailing List S+ <s-news@wubios.wustl.edu>
Subject: [S] Statistics question
From: "Martin H. H. Stevens" <hstevens@rci.rutgers.edu>
Date: Fri, 26 May 2000 11:57:49 -0400
Sender: owner-s-news@wubios.wustl.edu
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?

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
Postdoctoral Associate
Department of Ecology, Evolution, & Natural Resources
14 College Farm Road
Cook College, Rutgers University
New Brunswick, NJ 08901-8551

email: hstevens@rci.rutgers.edu
phone: 732-932-9631
fax: 732-932-8746


-----------------------------------------------------------------------
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

<Prev in Thread] Current Thread [Next in Thread>