Hello. I am new to using the “margins” command in Stata and would greatly appreciate feedback on whether my code and interpretations are correct.
After estimating a svy:mlogit model with 4 outcome categories, I run the first command (margins race, at(foreign=(0) famstw1=(1)….) to obtain the adjusted probabilities for outcome 3, as an example, holding all other covariates at their mean or modal value. After that, I use marginsplot (not included below) to graph the adjusted probabilities. Although the confidence intervals give some indication as to whether probabilties differ between those of different race/ethnicities, I would like examine whether the differences are statistically significant. Therefore, my third command uses "margins race, predict(outcome(3)) mcomp(bon) pwcompare(effects)." Using race(2) race(3) as an example, I can conclude from the last set of output that probability of outcome(3) is significantly higher for Hispanic females (race 3) compared to Black females (race 2).
Thank you in advance!
Pina
margins race, at(foreign=(0) famstw1=(1) peduc=(3) religion=(8.51) ///
adrel=(0) pledge=(0) sexforce=(0) everoral=(1)) predict(outcome(3)) mcomp(bon) post
Adjusted predictions Number of obs = 7322
Model VCE : Linearized
Expression : Pr(agesex==3), predict(outcome(3))
at : foreign = 0
famstw1 = 1
peduc = 3
religion = 8.51
adrel = 0
pledge = 0
sexforce = 0
everoral = 1
---------------------------
| Number of
| Comparisons
-------------+-------------
race | 4
---------------------------
------------------------------------------------------------------------------
| Delta-method Bonferroni Bonferroni
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
race |
1 | .460348 .0275941 16.68 0.000 .391426 .5292699
2 | .3641828 .0404987 8.99 0.000 .263029 .4653366
3 | .5163204 .0502506 10.27 0.000 .3908092 .6418315
4 | .5832586 .0484929 12.03 0.000 .4621376 .7043796
------------------------------------------------------------------------------
margins race, at(foreign=(0) famstw1=(1) peduc=(3) religion=(8.51) ///
adrel=(0) pledge=(0) sexforce=(0) everoral=(1)) predict(outcome(3)) ///
mcomp(bon) pwcompare(effects)
------------------------------------------------------------------------------
| Delta-method Bonferroni Bonferroni
| Contrast Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
race |
2 vs 1 | -.0961652 .0391674 -2.46 0.084 -.199499 .0071685
3 vs 1 | .0559724 .0480845 1.16 1.000 -.070887 .1828318
4 vs 1 | .1229106 .0522625 2.35 0.112 -.0149713 .2607925
3 vs 2 | .1521376 .053199 2.86 0.025 .0117848 .2924904
4 vs 2 | .2190758 .0559227 3.92 0.001 .0715373 .3666143
4 vs 3 | .0669382 .0569085 1.18 1.000 -.083201 .2170774
------------------------------------------------------------------------------
After estimating a svy:mlogit model with 4 outcome categories, I run the first command (margins race, at(foreign=(0) famstw1=(1)….) to obtain the adjusted probabilities for outcome 3, as an example, holding all other covariates at their mean or modal value. After that, I use marginsplot (not included below) to graph the adjusted probabilities. Although the confidence intervals give some indication as to whether probabilties differ between those of different race/ethnicities, I would like examine whether the differences are statistically significant. Therefore, my third command uses "margins race, predict(outcome(3)) mcomp(bon) pwcompare(effects)." Using race(2) race(3) as an example, I can conclude from the last set of output that probability of outcome(3) is significantly higher for Hispanic females (race 3) compared to Black females (race 2).
Thank you in advance!
Pina
margins race, at(foreign=(0) famstw1=(1) peduc=(3) religion=(8.51) ///
adrel=(0) pledge=(0) sexforce=(0) everoral=(1)) predict(outcome(3)) mcomp(bon) post
Adjusted predictions Number of obs = 7322
Model VCE : Linearized
Expression : Pr(agesex==3), predict(outcome(3))
at : foreign = 0
famstw1 = 1
peduc = 3
religion = 8.51
adrel = 0
pledge = 0
sexforce = 0
everoral = 1
---------------------------
| Number of
| Comparisons
-------------+-------------
race | 4
---------------------------
------------------------------------------------------------------------------
| Delta-method Bonferroni Bonferroni
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
race |
1 | .460348 .0275941 16.68 0.000 .391426 .5292699
2 | .3641828 .0404987 8.99 0.000 .263029 .4653366
3 | .5163204 .0502506 10.27 0.000 .3908092 .6418315
4 | .5832586 .0484929 12.03 0.000 .4621376 .7043796
------------------------------------------------------------------------------
margins race, at(foreign=(0) famstw1=(1) peduc=(3) religion=(8.51) ///
adrel=(0) pledge=(0) sexforce=(0) everoral=(1)) predict(outcome(3)) ///
mcomp(bon) pwcompare(effects)
------------------------------------------------------------------------------
| Delta-method Bonferroni Bonferroni
| Contrast Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
race |
2 vs 1 | -.0961652 .0391674 -2.46 0.084 -.199499 .0071685
3 vs 1 | .0559724 .0480845 1.16 1.000 -.070887 .1828318
4 vs 1 | .1229106 .0522625 2.35 0.112 -.0149713 .2607925
3 vs 2 | .1521376 .053199 2.86 0.025 .0117848 .2924904
4 vs 2 | .2190758 .0559227 3.92 0.001 .0715373 .3666143
4 vs 3 | .0669382 .0569085 1.18 1.000 -.083201 .2170774
------------------------------------------------------------------------------