We are running an oprobit for a 5-category dependent variable (Y) and would like to have a marginal effect graph for a continuous variable in the form of a graph in Prof. Williams’ “Adjusted Predictions & Marginal Effects for Multiple Outcome Models” https://www3.nd.edu/~rwilliam/xsoc73994/Margins05.pdf
Text and graph reproduced here (pp.4-5):
. mgen, at(age = (20(5)75)) stub(all)
. list allpr1 allpr2 allpr3 allpr4 allpr5 allage in 1/15
. line allpr1 allpr2 allpr3 allpr4 allpr5 allage, scheme(sj) name(pooled)
Array
The continuous independent variable (X1) essentially counts the number of days of a particular event in a country and we cluster around the regions in that country. Note, X2 and X3 are interactions of X1 and a set of dummy variables. The remainder are controls.
When we run the following:
. oprobit Y X1 X2 X3 X4 X5 … , vce(cluster countycode)
. margins , at(X1=(0(7)365))
We get this:
Predictive margins Number of obs = 9,407
Model VCE : Robust
1._predict : Pr(Y==1), predict(pr outcome(1))
2._predict : Pr(Y ==2), predict(pr outcome(2))
3._predict : Pr(Y ==3), predict(pr outcome(3))
4._predict : Pr(Y ==4), predict(pr outcome(4))
5._predict : Pr(Y ==5), predict(pr outcome(5))
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_predict#_at |
1 1 | . (not estimable)
1 2 | . (not estimable)
1 3 | . (not estimable)
1 4 | . (not estimable)
So, we re-ran the model and tried the mgen approach
. mgen, at(X1=(0(7)365))
Predictions from: margins, at(X1=(0(7)365)) predict(outcome())
Variable Obs Unique Mean Min Max Label
-------------------------------------------------------------------------------
_pr1 0 0 . . . pr(y=1) from margins
_ll1 0 0 . . . 95% lower limit
_ul1 0 0 . . . 95% upper limit
_X1 53 53 182 0 364 TmaxW_30-10
_Cpr1 0 0 . . . pr(y<=1)
_pr2 0 0 . . . pr(y=2) from margins
_ll2 0 0 . . . 95% lower limit
_ul2 0 0 . . . 95% upper limit
_Cpr2 0 0 . . . pr(y<=2)
_pr3 0 0 . . . pr(y=3) from margins
_ll3 0 0 . . . 95% lower limit
_ul3 0 0 . . . 95% upper limit
_Cpr3 0 0 . . . pr(y<=3)
_pr4 0 0 . . . pr(y=4) from margins
_ll4 0 0 . . . 95% lower limit
_ul4 0 0 . . . 95% upper limit
_Cpr4 0 0 . . . pr(y<=4)
_pr5 0 0 . . . pr(y=5) from margins
_ll5 0 0 . . . 95% lower limit
_ul5 0 0 . . . 95% upper limit
_Cpr5 0 0 . . . pr(y<=5)
--------------------------------------------------------------------------------
So we tried:
. margins, at(X1=(0(7)365)) predict(outcome(1)) predict(outcome(2)) predict(outcome(3)) predict(outcome(4)) predict(outcome(5))
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_predict#_at |
1 1 | . (not estimable)
1 2 | . (not estimable)
1 3 | . (not estimable)
1 4 | . (not estimable)
1 5 | . (not estimable)
1 6 | . (not estimable)
1 7 | . (not estimable)
...
It feels like the problem is in the model, but we are not sure how to identify the issue. Otherwise, are we doing something wrong in our effort to graph the margins?
Related Posts with Oprobit and marginsplot
ImputationHey guys, I work with panel data and I have the following problem. I've dummy variables from 2 yea…
Interquartile rangeHello, Please can anyone advise how I generate the interquartile range? I have a data example for a…
Spmatrix creating empty weighting matricesHi, I'm trying to do a very standard spatial analysis. The aim is to run ML and 2SLS estimations wi…
Gologit2 autofit optionHi, I have developed a gologit2 with autofit option. My dependent variable is Prudence coded as 1 lo…
prevent pagebreak in table putdocxHi I making summary tables in putdocx looping through 100+ cities. The problem is that pagebreaks oc…
Subscribe to:
Post Comments (Atom)
0 Response to Oprobit and marginsplot
Post a Comment