[R] A quick question about lm()

Tobias Verbeke tobias.verbeke at gmail.com
Mon Jul 7 16:30:31 CEST 2008

rlearner309 wrote:

> I have a simple regression using lm().

model <- lm(dist ~ speed, data = cars)
sModel <- summary(model)

> If I just want to check the coefficient, I can use summary(lm())$coef; if I
> need the standard error, I can use summary(lm())$s, if I need the residuals,

It is recommended to extract the information using coef() or resid() as in

coef(model)  # or coefficients(model)
resid(model) # or residuals(model)

> I can use summary(lm())$res.  OK.  How can I get the R-squares and Adjusted
> R-squares using $...?
> Is there a function, like objects(), that can show all the references for
> values?




More information about the R-help mailing list