I noticed a rather peculiar problem when trying to export output tables after using margins with the contrast option:
Here, outreg2 exports the nice sideways table displayed by margins, with the Contrast, SE, z-score, and p-value all presented next to each other in separate columns.
However, despite specifying the label option, outreg2 does not seem able to attach the labels, as the output in the first column shows raw text such as "[email protected]", "[email protected]", etc. Is there a way to preserve the labels that margins is correctly displaying?
I further tried using esttab/estout as an alternative, but I do not succeed in exporting the table fully in sideways style; instead, the significance stars are placed in separate rows underneath the other results:
Is there a known fix for that?
Code:
sysuse nlsw88, clear reg never_married i.race##i.collgrad margins r.collgrad@race, contrast(nowald pveffects) post saving(results, replace) outreg2 using "test.tex", replace label tex(fragment) sideway
However, despite specifying the label option, outreg2 does not seem able to attach the labels, as the output in the first column shows raw text such as "[email protected]", "[email protected]", etc. Is there a way to preserve the labels that margins is correctly displaying?
I further tried using esttab/estout as an alternative, but I do not succeed in exporting the table fully in sideways style; instead, the significance stars are placed in separate rows underneath the other results:
Code:
sysuse nlsw88, clear
logit never_married i.race##i.collgrad
margins r.collgrad@race, contrast(nowald pveffects) post saving(results, replace)
esttab using "test.tex", replace fragment label cells("b(star fmt(3)) se(fmt(3))")

Comment