I want to export results from multiple regressions into an excel file in a very specific format
MWS
data("mtcars")
str(mtcars)
m1<-lm(hp ~ disp, data = mtcars)
m2<-lm(hp ~ disp + wt, data = mtcars)
I find this format the most suitable:
library(texreg)
screenreg(list(m1, m2))
===================================
Model 1 Model 2
-----------------------------------
(Intercept) 45.73 ** 68.84 *
(16.13) (31.80)
disp 0.44 *** 0.54 ***
(0.06) (0.14)
wt -14.45
(17.10)
-----------------------------------
R^2 0.63 0.63
Adj. R^2 0.61 0.61
Num. obs. 32 32
RMSE 42.65 42.85
===================================
*** p < 0.001, ** p < 0.01, * p < 0.05
I want to convert the above into a dataframe or anything similar in order to export it to excel, preserving its format.
Other ideas that could generate a similar table and export it to excel are welcome.
The most import thing for me is to export the coefficients having the * on top of each, so I can understand which one is significant in every new regression.
Can you please help me with that ?