I am replicating an older paper which uses oprobit followed by mfx to calculate and report marginal effects of sex (0-male 1-female) on level of education (1-5)
I am able to replicate the marginal effects in the paper by using the following code
However, I have 2 issues.
1. I want to avoid using mfx and instead use margins
2. I want Stata to automatically store my marginal effects in a word/csv file.
For that I am using the following command
However, in this case my marginal effects are coming out slightly different that when i used the mfx command. Where am I going wrong?
And the CSV file reports the oprobit results but doesn't store the 5 marginal effects I am hoping to use. How do I fix that? I read on another forum that using 'post' at the end of the margin command should fix it. But that doesn't seem to be working for me.
I appreciate the help!
I am able to replicate the marginal effects in the paper by using the following code
Code:
levelsof year, local(year) foreach r of local year{ eststo: oprobit edu_level sex if year==`r' [pw=wt], vce(robust) mfx, predict(pr outcome(1)) mfx, predict(pr outcome(2)) mfx, predict(pr outcome(3)) mfx, predict(pr outcome(4)) mfx, predict(pr outcome(5)) }
1. I want to avoid using mfx and instead use margins
2. I want Stata to automatically store my marginal effects in a word/csv file.
For that I am using the following command
Code:
levelsof year, local(year) foreach r of local year{ eststo: oprobit edu_level sex if year==`r' [pw=wt], vce(robust) margins, dydx (*) predict(pr outcome(1)) post margins, dydx (*) predict(pr outcome(2)) post margins, dydx (*) predict(pr outcome(3)) post margins, dydx (*) predict(pr outcome(4)) post margins, dydx (*) predict(pr outcome(5)) post esttab using eduprobit.csv, se r2 b(4) se(4) star(* 0.10 ** 0.05 *** 0.01) }
And the CSV file reports the oprobit results but doesn't store the 5 marginal effects I am hoping to use. How do I fix that? I read on another forum that using 'post' at the end of the margin command should fix it. But that doesn't seem to be working for me.
I appreciate the help!
Comment