I'm trying to save regression results to latex using esttab in Stata 15.1. I have two outcome variables and I run two separate regressions with each. In the exported .tex file, I'd like to create super columns over the two specifications for each outcome. That is, I'd like one column label spanning the first two columns for the first outcome variable and another column label spanning the second two columns for the other outcome variable. Following advice from this post, I wrote the following code:
Code:
#delimit ; esttab using "results\main results\main analysis\crime_temp_baseline", stats(N) se keep(tMean) label replace nomtitles collabels(none) mgroups("Homicide" "Assault", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) booktabs star(* 0.10 ** 0.05 *** 0.01) note("Outcome is percentage change in crime at daily ORI level." "Significance levels are indicated as * 0.10 ** 0.05 *** 0.01." "Standard errors clustered at the county level.") ; #delimit cr
Code:
eststo clear foreach v of varlist scaled_homicide_log2 scaled_assault_log2 { eststo: reghdfe `v' tMean prec, absorb(ori_day ori_year) cluster(fips) keepsingletons eststo: reghdfe `v' tMean prec, absorb(ori_day ori_sample_month) cluster(fips) keepsingletons }
0 Response to Creating super columns with esttab
Post a Comment