[R] coef(summary) and plyr

moleps moleps2 at gmail.com
Mon Aug 9 13:51:50 CEST 2010


Dear all,

I´m having trouble getting a list of regression variables back into a dataframe. 

mydf <- data.frame(x1=rnorm(100), x2=rnorm(100), x3=rnorm(100))

mydf$fac<-factor(sample((0:2),replace=T,100))

 mydf$y<- mydf$x1+0.01+mydf$x2*3-mydf$x3*19+rnorm(100)

dlply(mydf,.(fac),function(df) lm(y~x1+x2+x3,data=df))->dl

here I´d like to use 

ldply(dl,coef(summary)) or something similar but I cant figure it out...



Best,

M



More information about the R-help mailing list