stack coefficients from different models in screenreg()/texreg()

31 views Asked by At

Irrespective of whether these example models make sense, I would like to stack some coefficients from different models and side-by-side from using different data frames. Say I have the following simple lm() outputs:

x1 <- rnorm(50,0,1)
x2 <- rnorm(50,0,1)

y1 <- 1.0*x1 + 0.50*x2 + rnorm(50,0,.1)
y2 <- 0.5*x1 + 0.25*x2 + rnorm(50,0,.1)

df1 <- data.frame(y1,x1,x2)
df2 <- data.frame(y2,x1,x2)

summary(m11 <- lm(y1 ~ x1, df1))
summary(m12 <- lm(y1 ~ x2, df1))

summary(m21 <- lm(y2 ~ x1, df2))
summary(m22 <- lm(y2 ~ x2, df2))

I would like to use use screenreg() or texreg() from library(texreg) to produce something like this (note that coefficients are fictitious)

===============================================
            data: df1             data: df2
-----------------------------------------------
x1           0.97 ***               0.49 ***          
            (0.06)                 (0.03)             
x2           0.45 **                0.24 ***          
            (0.16)                 (0.08)                            
===============================================
  *** p < 0.001, ** p < 0.01, * p < 0.05

Any thoughts?
Thank you

0

There are 0 answers