Sunday, January 26, 2020

combomarginsplot with mimrgns

Hi everyone,

Does anyone know how to use combomarginsplot with margins derived from the mimrgns command? For reference, I'm looking at the interaction between time and race in students' self-evaluations of their future grades. I'd like to combine plots that show what the addition of new controls does to the estimate of interest. I get as far as the "saving" option before Stata tells me my code is wrong. Any insight?

Code:
global controls age i.sex i.educ
mi estimate, or: svy: logistic pass i.race##i.year $controls
mimrgns i.race#i.year, predict(pr) cmdmargins post saving (f1, replace)
marginsplot, by(race) 

mi estimate, or: svy: logistic pass i.race##i.year $controls parent_educ
mimrgns i.race#i.year, predict(pr) cmdmargins post saving (f2, replace)
marginsplot, by(race) 

mi estimate, or: svy: logistic pass i.race##i.year $controls parent_educ zipcode
mimrgns i.race#i.year, predict(pr) cmdmargins post saving (f3, replace)
marginsplot, by(race)

combomarginsplot file1 file2 file3
Thanks for considering.

No comments:

Post a Comment