Skip to content
Prev 56918 / 398498 Next

odd behavior of summary()$r.squared

J.R. Lockwood wrote:

            
I think what you're trying to do is better accomplished by looking at 
the anova table of the two results

a1 <- anova(m1)
a2 <- anova(m2)
r2.1 <- a1[1, 2]/sum(a1[, 2])
r2.2 <- a2[1, 2]/sum(a2[, 2])

summary(m1)$r.squared - r2.1
summary(m2)$r.squared - r2.2

The result you used above using "cor" still adjusts your data for the 
grand mean, which m2 doesn't fit.

HTH,

--sundar