[R] Regression Summary for a List

Phil Spector spector at stat.berkeley.edu
Fri Apr 29 21:18:47 CEST 2011

Ryan -
    summary expects an lm object, and fit is a list.  So
you need to use something like


to pass each list element to the summary function.

 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu

On Fri, 29 Apr 2011, Ryan J. McGuigan wrote:

> Hi,
> I am trying to run a regression on two matrices with 10 columns.  I have
> been able to run the regression with the following code:
> fit=list()
> for(i in 1:10) {
> fit[[i]]=lm(monret[,i]~janret[,i])
> }
> However, I can't get the regression to spit out more than the coefficients
> (summary(fit) does not work).  I really need the full summary for each of
> the 10 regressions, including the R-squared values.  I'm sure there's a
> simple way to do this I just can't seem to figure it out.
> Thanks.
> -Ryan
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list