[R] Multiple lm outputs consolidated

Iuri Gavronski iuri at ufrgs.br
Thu Jan 3 17:09:41 CET 2008


I would like to know if there is any function that reformats multiple  
lm objects into one only table. Say:

model1=lm(Fertility ~ Education,data=swiss)
model2=lm(Fertility ~ Education + Examination,data=swiss)
modeln=lm(Fertility ~ Education + Examination + (many other  

consolidate.output(model1, model2, ..., modeln)  <- this is the  
function I want

Variables   model1    model2  ... modeln
Intcp       79.61***  85.25***    xxx.xx***
Education   -0.86***  -0.54**     xxx.xx***
Examination           -0.56*      xxx.xx***
(other variables)

R^2          0.44     0.51        x.xx
F     (1,45)35.45*** (2,44) 22.49***  (x,xx) xx.xx***

I could write it myself, by I don't know how to pass a "list of lists"  
or a "list of models" as a parameter to a function...

Any help is appreciated.



More information about the R-help mailing list