I was wondering if someone came with a solution to show up the reference categories of categorical variables using stargazer
?
library(stargazer)
Let us imagine that gear
and carb
are categorical variables
mtcars$gear = factor(mtcars$gear)
mtcars$carb = factor(mtcars$carb)
I run an ols
with
lm1 = lm(disp ~ gear + carb, mtcars)
and stargaze
the results.
stargazer(lm1, single.row = TRUE, omit.table.layout = "sn")
I get
However, I find myself always going back to the tex
file to custom the reference categories to get
Basically, what I do is to add to the latex
in between variables :
gear (ref = 3) & \\
\-\hspace{0.3cm} gear4 & $-$202.921$^{***}$ (22.477) \\
and so on.
Anyone had any idea if I can add these kind of lines
in the stargazer
function ?