I just noticed something weird and wanted your opinion, I'm probably misunderstanding how margins works so any help would be appreciated.
I get different values when I check predictions using margins versus when I check them using predict.
Here's what I'm doing
Code:
use http://www.stata-press.com/data/r13/sysdsn1 , clear . mprobit insure age i.male nonwhite i.site Iteration 0: log likelihood = -535.89424 Iteration 1: log likelihood = -534.56173 Iteration 2: log likelihood = -534.52835 Iteration 3: log likelihood = -534.52833 Multinomial probit regression Number of obs = 615 Wald chi2(10) = 40.18 Log likelihood = -534.52833 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ insure | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Indemnity | (base outcome) -------------+---------------------------------------------------------------- Prepaid | age | -.0098536 .0052688 -1.87 0.061 -.0201802 .000473 1.male | .4774678 .1718316 2.78 0.005 .1406841 .8142515 nonwhite | .8245003 .1977582 4.17 0.000 .4369013 1.212099 | site | 2 | .0973956 .1794546 0.54 0.587 -.2543289 .4491201 3 | -.495892 .1904984 -2.60 0.009 -.869262 -.1225221 | _cons | .22315 .2792424 0.80 0.424 -.324155 .7704549 -------------+---------------------------------------------------------------- Uninsure | age | -.0050814 .0075327 -0.67 0.500 -.0198452 .0096823 1.male | .3332637 .2432986 1.37 0.171 -.1435929 .8101203 nonwhite | .2485859 .2767734 0.90 0.369 -.29388 .7910518 | site | 2 | -.6899485 .2804497 -2.46 0.014 -1.23962 -.1402771 3 | -.1788447 .2479898 -0.72 0.471 -.6648957 .3072063 | _cons | -.9855917 .3891873 -2.53 0.011 -1.748385 -.2227986 ------------------------------------------------------------------------------
Code:
predict p1-p3 if e(sample), pr table male, content(mean p1 mean p2 mean p3) ---------------------------------------------- NEMC | PATIENT | MALE | mean(p1) mean(p2) mean(p3) ----------+----------------------------------- 0 | .5053142 .4249825 .0697033 1 | .3904685 .5264811 .0830504
Code:
. margins i.male Predictive margins Number of obs = 615 Model VCE : OIM 1._predict : Pr(insure==Indemnity), predict(pr outcome(1)) 2._predict : Pr(insure==Prepaid), predict(pr outcome(2)) 3._predict : Pr(insure==Uninsure), predict(pr outcome(3)) ------------------------------------------------------------------------------- | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] --------------+---------------------------------------------------------------- _predict#male | 1 0 | .5089435 .0229832 22.14 0.000 .4638972 .5539897 1 1 | .3804479 .0386202 9.85 0.000 .3047536 .4561422 2 0 | .4207201 .0225325 18.67 0.000 .3765572 .464883 2 1 | .5390436 .0395344 13.63 0.000 .4615576 .6165296 3 0 | .0703364 .0119072 5.91 0.000 .0469988 .0936741 3 1 | .0805084 .0217201 3.71 0.000 .0379378 .1230791 -------------------------------------------------------------------------------
The differences are kind of minor, but I still don't get it. For the first outcome, men's values are 0.38 using margins and 0.39 using predict.
Why do these differ?
0 Response to Difference between margins and predict
Post a Comment