I'm wrapping my head around divergences of predicted probabilities plots with estimated margins.
Consider the following code for plotting predicted probabilities
where dv = dependent variable: attending a particular conference
support = independent variable: support for a particular policy decision
result:

Then I've run (0.547 and 0.967 being the min and max value, respectively):
which outputs:
Why do the results differ? For example consider the minimum value of .547. The margin seems a little higher than what the graph indicates, and the confidence intervals are extremely off: -margins- shows .75 for the lower bound, but the plot shows about .625.
I'm probably missing something extremely obvious, but as a German saying goes "sometimes you can't see the forest because of all the trees". If there is ignorance on my side, please forgive me, I am still quite new to this stuff.
Consider the following code for plotting predicted probabilities
Code:
logit dv support, vce(cluster country) predict pred_support twoway scatter pred_support dv support, connect(l i) msymbol(i O) sort ylabel(0 1) { // with Confidence Intervals predict support_lr_index, xb predict support_se_index, stdp gen support_lb = support_lr_index - invnormal(0.975)*support_se_index gen support_ub = support_lr_index + invnormal(0.975)*support_se_index gen support_plb = exp(support_lb)/(1+exp(support_lb)) // lower bound gen support_pub = exp(support_ub)/(1+exp(support_ub)) // upper bound twoway scatter pred_support support_plb support_pub dv support, connect(l l l) msymbol(i i i) sort ylabel(0 1) ylabel(0(.125)1) }
support = independent variable: support for a particular policy decision
result:
Then I've run (0.547 and 0.967 being the min and max value, respectively):
logit dv v1 v2 v3 support, vce(cluster country)
margins, at(support=(0.547(.03)0.967))
margins, at(support=(0.547(.03)0.967))
Predictive margins Number of obs = 181
Model VCE : Robust
Expression : Pr(dv), predict()
1._at : support= .547
2._at : support= .577
3._at : support= .607
4._at : support= .637
5._at : support= .667
6._at : support= .697
7._at : support= .727
8._at : support= .757
9._at : support= .787
10._at : support= .817
11._at : support= .847
12._at : support= .877
13._at : support= .907
14._at : support= .937
15._at : support= .967
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_at |
1 | .8380664 .0467586 17.92 0.000 .7464213 .9297116
2 | .8075578 .0463947 17.41 0.000 .7166259 .8984898
3 | .7733774 .0447351 17.29 0.000 .6856981 .8610566
4 | .7357583 .0419483 17.54 0.000 .6535412 .8179754
5 | .6951272 .0385031 18.05 0.000 .6196624 .770592
6 | .6520866 .0352208 18.51 0.000 .583055 .7211182
7 | .6073739 .0331829 18.30 0.000 .5423366 .6724112
8 | .5617994 .0333001 16.87 0.000 .4965324 .6270663
9 | .5161787 .0356983 14.46 0.000 .4462112 .5861461
10 | .471269 .0396798 11.88 0.000 .393498 .54904
11 | .4277223 .044305 9.65 0.000 .340886 .5145586
12 | .3860601 .0488291 7.91 0.000 .2903569 .4817633
13 | .3466667 .0527853 6.57 0.000 .2432095 .450124
14 | .3097993 .0559261 5.54 0.000 .2001861 .4194125
15 | .275604 .0581506 4.74 0.000 .1616309 .3895772
------------------------------------------------------------------------------
Model VCE : Robust
Expression : Pr(dv), predict()
1._at : support= .547
2._at : support= .577
3._at : support= .607
4._at : support= .637
5._at : support= .667
6._at : support= .697
7._at : support= .727
8._at : support= .757
9._at : support= .787
10._at : support= .817
11._at : support= .847
12._at : support= .877
13._at : support= .907
14._at : support= .937
15._at : support= .967
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_at |
1 | .8380664 .0467586 17.92 0.000 .7464213 .9297116
2 | .8075578 .0463947 17.41 0.000 .7166259 .8984898
3 | .7733774 .0447351 17.29 0.000 .6856981 .8610566
4 | .7357583 .0419483 17.54 0.000 .6535412 .8179754
5 | .6951272 .0385031 18.05 0.000 .6196624 .770592
6 | .6520866 .0352208 18.51 0.000 .583055 .7211182
7 | .6073739 .0331829 18.30 0.000 .5423366 .6724112
8 | .5617994 .0333001 16.87 0.000 .4965324 .6270663
9 | .5161787 .0356983 14.46 0.000 .4462112 .5861461
10 | .471269 .0396798 11.88 0.000 .393498 .54904
11 | .4277223 .044305 9.65 0.000 .340886 .5145586
12 | .3860601 .0488291 7.91 0.000 .2903569 .4817633
13 | .3466667 .0527853 6.57 0.000 .2432095 .450124
14 | .3097993 .0559261 5.54 0.000 .2001861 .4194125
15 | .275604 .0581506 4.74 0.000 .1616309 .3895772
------------------------------------------------------------------------------
I'm probably missing something extremely obvious, but as a German saying goes "sometimes you can't see the forest because of all the trees". If there is ignorance on my side, please forgive me, I am still quite new to this stuff.
Comment