Reputation: 1792
When displaying tables of regressions (say with stargazer
or texreg::htmlreg
), is there a way where I can:
stargazer
and texreg::htmlreg
do this, often referred to as "publication ready").I've tried using:
single.row = TRUE
but that puts the standard errors into the same cell, not a new column.Reproducible example below:
library(texreg)
library(stargazer)
mtcars
m1 <- lm(mpg ~ disp, data = mtcars)
m2 <- lm(mpg ~ disp + wt, data = mtcars)
htmlreg(list(m1, m2), file = "htmlreg_table.html", single.row = 1)
stargazer(m1, m2, out = "stargazer_table.html", single.row = TRUE)
As you can see, the output looks "publication ready", but the standard errors are in the same column, rather than in a new separate column.
I'm open to using any package, not only stargazer
or texreg
, which is why this question differs from:
report regression result using stargazer to add separate column for standard error
Upvotes: 1
Views: 1763
Reputation: 60060
I think sjPlot::tab_model()
does a lot of what you want:
library(sjPlot)
tab_model(m1, m2, show.se = TRUE,
dv.labels = c("Model 1", "Model 2"))
Output:
Upvotes: 2