s-news
[Top] [All Lists]

[S] Cp statistic for lm objects

To: "'s-news@wubios.wustl.edu'" <s-news@wubios.wustl.edu>
Subject: [S] Cp statistic for lm objects
From: "Smith, Stephen" <SmithSJ@mar.dfo-mpo.gc.ca>
Date: Mon, 31 Aug 1998 10:46:33 -0300
Sender: owner-s-news@wubios.wustl.edu
Here (to me anyway) is some puzzling behaviour.  

Take the supplied data set air and form a linear model

> ozone.lm<-lm(ozone~temperature,data=air)




> args(anova.lm)
function(object, ..., test = c("F", "none", "Chisq", "Cp"), ssType = 1)
NULL


If I choose test ="F", I get the standard anova table:

> anova.lm(ozone.lm,test="F")
Analysis of Variance Table

Response: ozone

Terms added sequentially (first to last)
             Df Sum of Sq  Mean Sq  F Value Pr(F) 
temperature   1  49.46178 49.46178 142.8282     0
  Residuals 109  37.74698  0.34630               

However, when I choose the Cp statistic I get the following error
message:

> anova.lm(ozone.lm,test="Cp")
Error in stat.anova(aod, test, last[2]/last[1], last[1], n): The anova
object needs a "Resid. Dev", "RSS"or "Su
m of Sq" and a "Resid. Df" column for the Cp statistic
Dumped
> 

If I assign the anova object (for test="F") I find that there is a DF
column but no Resid.Df column.  Is this a known bug?

> names(a)
[1] "Df"        "Sum of Sq" "Mean Sq"   "F Value"   "Pr(F)"    
> dim(a)
[1] 2 5
> dimnames(a)
[[1]]:
[1] "temperature" "  Residuals"

[[2]]:
[1] "Df"        "Sum of Sq" "Mean Sq"   "F Value"   "Pr(F)"    

> 



Note that I am using SPLUS Pro 4.5 (Release 2) Win95.


Stephen Smith

-----------------------------------------------------------------------
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>
  • [S] Cp statistic for lm objects, Smith, Stephen <=