Hi everyone,
I want to estimate marginal effects after a censored ordinal probit. Following some links (http://www.stata.com/statalist/archi.../msg00090.html and http://www.stata.com/statalist/archi.../msg00917.html), I have written a maximum likelihood procedure to get the censored ordinal probit and it works fine. However, I am still unable to get the code for the marginal effects. I would appreciate your advise on how to proceed. Here what I have so far:
I get :
Then, I use margins to get, for instance, marginal effects on the first outcome (out of three) :
I get the same coefficients than the ordered probit:
I want to estimate marginal effects after a censored ordinal probit. Following some links (http://www.stata.com/statalist/archi.../msg00090.html and http://www.stata.com/statalist/archi.../msg00917.html), I have written a maximum likelihood procedure to get the censored ordinal probit and it works fine. However, I am still unable to get the code for the marginal effects. I would appreciate your advise on how to proceed. Here what I have so far:
Code:
gen educ21= educ2==1 gen educ22= educ2==2 gen educ23= educ2==3 //define uncensored observation: children not attending school stud==0 gen unc=stud==0 cap program drop lfoprobit5 program define lfoprobit5 args lnf1 theta1 cut1 cut2 qui replace `lnf1' = unc*(ln(($ML_y1*normprob(`cut1'-`theta1'))+ ($ML_y2*(normprob(`cut2'-`theta1')-normprob(`cut1'-`theta1')))+ ($ML_y3*(1-normprob(`cut2' -`theta1')))))+ /// stud*(ln(($ML_y1)+ ($ML_y2*(1-normprob(`cut1'-`theta1')))+ ($ML_y3*(1-normprob(`cut2'-`theta1'))))) ereturn local predict ‘"‘lfoprobit5_p’"’ end cap program drop lfoprobit5_p program define lfoprobit5_p syntax newvarlist [if] [in], [x] tempvar touse xb marksample touse // mark `touse' qui _predict double `xb' gen double `varlist'=norm([_cut1]_b[_cons]-`xb') if `touse' end ml model lf lfoprobit5 (educ21 educ22 educ23 = status sex edad, nocons) /cut1 /cut2, svy subpop(if edad>=25) ml search, repeat(100) ml maximize, difficult
Code:
Linearized Coef. Std. Err. t P>t [95% Conf. Interval] eq1 status -.0615345 .0421942 -1.46 0.145 -.1442564 .0211875 sex -.1580939 .0288409 -5.48 0.000 -.2146367 -.1015512 edad -.0156747 .001728 -9.07 0.000 -.0190624 -.012287 cut1 _cons -1.687997 .0658898 -25.62 0.000 -1.817174 -1.558819 cut2 _cons -.7937602 .0643738 -12.33 0.000 -.9199653 -.6675551
Code:
margins, dydx(*) predict(outcome(#1))
Code:
Average marginal effects Number of obs = 46705 Model VCE : Linearized Expression : Linear prediction, predict(outcome(#1)) dy/dx w.r.t. : status sex edad Delta-method dy/dx Std. Err. z P>z [95% Conf. Interval] status -.0615345 .0421942 -1.46 0.145 -.1442336 .0211646 sex -.1580939 .0288409 -5.48 0.000 -.2146211 -.1015668 edad -.0156747 .001728 -9.07 0.000 -.0190615 -.0122879
Comment