I am encountering the following issue. I want to compute a mean after a regression with the mean function ("sum" does not work with svy), and then retrieve & store the mean value to export it as tex table.
In fact, I would like to add the values to the "stats" in the lower part of the table. My code/my first tries look like this:
Code:
svy: reg y1 x1 x2 x3 estimates store t1 svy: mean y1 if e(sample)==1 estadd matrix m = e(b) estadd scalar m1 = e(b)[1,1] estadd local cFE \ding{51} estadd local sFE \ding{51} estadd local csFE \ding{51} svy: reg y1 x1 x2 x4 estimates store t2 svy: mean y1 if e(sample)==1 estadd matrix m = e(b) estadd scalar m1 = e(b)[1,1] estadd local cFE \ding{51} estadd local sFE \ding{51} estadd local csFE \ding{51} svy: reg y1 x1 x2 x5 estimates store t3 svy: mean y1 if e(sample)==1 estadd matrix m = e(b) estadd scalar m1 = e(b)[1,1] estadd local cFE \ding{51} estadd local sFE \ding{51} estadd local csFE \ding{51} esttab t1 t2 t3 using "test.tex", booktabs fragment replace /// se(%3.2f) b(2) label alignment(S S S S) /// star(* 0.10 ** 0.05 *** 0.01) nonotes nomtitles /// stats(m1 cFE sFE csFE N, fmt(%3.2f 0 0 0 0)
But this code does not work, I do not manage to display the stored numerical value of the mean of each regression in the stats of the table. Might anyone have an idea by what it is caused?
Many thanks in advance!
0 Response to Esttab: Store value of matrix and display in tex-table
Post a Comment