2

I'm trying to output the average partial effects estimated after a regression but am having some difficulty. I realize using the margeff command works around this, but I have some interaction terms in my model and I can't get margeff to work with these. I know margins works, but when I run the code below, the .tex file reports the results of the glm.

eststo clear
eststo: glm y x1 x2 x3 c.x1#c.x2 c.x3#c.x3, link(logit) robust
esttab using 1.tex, label
eststo clear
glm y x1 x2 x3 c.x1#c.x2 c.x3#c.x3, link(logit) robust
margins, dydx(*)
estimates store margins
esttab using 2.tex, label
eststo clear
sam
  • 41

1 Answers1

5

Just use:

glm .....
margins, dydx(_all) post
esttab using x.tex, label

The key point here is the post option in margins, that tells margins to leave the results behind as if it were an estimation command. This helps because esttab looks for stuff left behind by estimation commands.

Maarten Buis
  • 21,005
Andrea
  • 59