Mittwoch, 10. Oktober 2012

multiple regressions in one table

 

You often want to compare coefficients between different models. mtable from the memisc package does exactly that. As its author (Martin Elff) just pointed out to me it is possible to use mtable of the number of regression results is variable. See the following example:

library(memisc)
x=rnorm(10)
y=rnorm(10)
z=rnorm(10)
l1=lm(x~z)
l2=lm(z~y)
li=list(l1,l2)
attributes(li)=list(names=list(1,2))
do.call(mtable,li)

In a future version of mtable Martin said there will be a functionality to include lists directly

mtable(list=list("1"=l1,"2"=l2))

Thanks Maritn for the great tool!

Keine Kommentare:

Kommentar veröffentlichen