I'm using the excellent user-written -coefplot- by Ben Jann to graph some average marginal effects after margins. I've used it for this purpose before with the -post- option, but now I'm trying to plot the average marginal effects of two different variables by a categorical variable and I'm having some trouble.
The code is something like this:
For some reason, this only gives me the average marginal effects for percent_white, leaving out the average marginal effects for percent_service_work. When I do:
Or if I use:
I get the "no coefficients found, all dropped, or none kept" message. So something is going on where coefplot is only reading the percent_white AME by education level, and then plotting it.
For what it's worth, I get the same thing if I use eststo instead of estimates store. It's also a problem if I don't use the over option and instead do it this way:
I'm sure the solution to this is super simple, but for some reason I can't seem to figure out how to do it. Thank you for your time in advance.
Best,
Jonathan
The code is something like this:
Code:
regress wages i.education##c.percent_white i.education##c.percent_service_work controlvar_ab margins, dydx (percent_white percent_service_work) over(education) vce(unconditional) post estimates store lag2 regress wages i.education##c.percent_white i.education##c.percent_service_work controlvar_yz margins, dydx (percent_white percent_service_work) over(education) vce(unconditional) post estimates store lag5 coefplot lag2 lag5
Code:
coefplot lag2 lag5, keep(percent_service_work)
Code:
coefplot lag2 lag5, keep(percent_white)
For what it's worth, I get the same thing if I use eststo instead of estimates store. It's also a problem if I don't use the over option and instead do it this way:
Code:
margins education, dydx (percent_white percent_service_work) vce(unconditional) post
Best,
Jonathan
Comment