Code:
sysuse auto, clear local vars "turn mpg weight" gen price_d = (price>5000) est clear eststo ttest_1: estpost ttest `vars' if price_d==1, by(foreign) eststo ttest_2: estpost ttest `vars' if price_d==0, by(foreign) esttab ttest_1 ttest_2 using "auto.tex", replace booktabs label alignment(S S) /// cells("mu_1(fmt(3)) mu_2(fmt(3)star)") collabels("Expensive" "Cheap") /// mgroups("Domestic" "Foreign", pattern(1 1) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) /// star(* 0.10 ** 0.05 *** 0.01) /// noobs nomtitles nonum prehead({\begin{tabular}{l*{2}{cc}}\toprule)
0 Response to Number of observations for each subgroup at bottom of table and then export to LaTeX
Post a Comment