Christoph Meyer | 2 May 11:06
Picon
Favicon

Re: [R-sig-eco] Extracting information from lm results

Hi Steve,

you can extract this information from the summary of your linear
regressions, i.e. summary(lm1).

e.g.

sum.lm1=summary(lm1)
sum.lm1$coef[2,2]    #this gives you the SE of the slope
sum.lm1$r.squared    #this gives you the R2
and so on...
This should be clear from a look at str(sum.lm1).

Hope that helps,

Christoph

Friday, May 2, 2008, 9:55:10 AM, you wrote:

> Dear all,

> I suspect that this might be a bit basic, but here goes anyway...

> I am soon to run a large number of linear regressions and I would
> like to extract a number of details from the models, and then
> collate them in a dataframe as a summary of the overall block of
> analyses. I can successfully extract the intercept and slope by using, for example:

> lm1<-lm(ASTF~Year,na.action=na.omit,subset=yr10==T)
> a1<-lm1$coefficients[1]
(Continue reading)


Gmane