I am using the user-written esttab command from SSC to generate table output. I am trying to plot a regression coefficient and standard error, and the mean of the dependent variable in the column beside it. Unfortunately, none of the solutions I could come up with produce the output I am looking for.
In principle, this produces the desired output. But it also plots a standard error and significant stars for the dependent variable mean, which I want to omit.
This plots the dependent variable mean in another row, and renaming it produces an error:
This solution would work as well but the cell command does not recognize the r(mean) from using estadd ysumm:
Any help would be much appreciated.
In principle, this produces the desired output. But it also plots a standard error and significant stars for the dependent variable mean, which I want to omit.
Code:
sysuse auto, clear eststo: reg price mpg eststo: mean price if e(sample) esttab, keep(mpg) ren(price mpg)
Code:
sysuse auto, clear eststo: reg price mpg sum price if e(sample), meanonly estadd mat ymean=r(mean) esttab, cell("b ymean" "se") esttab, cell("b ymean" "se") ren(c1 mpg) keep(mpg)
Code:
sysuse auto, clear eststo: reg price mpg estadd ysumm esttab, cell("b ymean" "se") keep(mpg)
Comment