Skip to content
Prev 243718 / 398503 Next

How to call R-squared values from lm's?

On 12/02/2010 03:15 PM, Wegan, Michael (DNRE) wrote:
I hope this does the trick:

set.seed(1234)
x <- 1:10
y <- (4 + 3*x)+rnorm(10)

my.lm <- lm(y~x)
summary(my.lm)$r.squared
summary(my.lm)$adj.r.squared

Enjoy,
Roland