Skip to content
Prev 40173 / 63424 Next

anova.lm fails with test="Cp"

On May 8, 2011, at 09:25 , John Maindonald wrote:

            
Yes, the "Resid. Dev" column is only there in analysis of deviance tables. For the lm() case, it looks like you should have "RSS". 

This has probably been there "forever". Just goes to show how often people use these things...

Also, now that I'm looking at it, are we calculating it correctly in any case? We have

        cbind(table, Cp = table[, "Resid. Dev"] + 2 * scale * 
            (n - table[, "Resid. Df"]))

whereas all the references I can find have Cp=RSS/MS-N+2P, so the above would actually be scale*Cp+N.