Dear Statalist,
I compute the marginal effect of a recursive trivariate probit. To evaluate the program, i first estimate a recursive Bivariate probit using both command biprobit and mvprobit using Stata 14.1.
I would like to compute the marginal effect of P(Y1=1,Y2=1) or P(Y1=0,Y2=1)
After reading the Stata Journal article written by Cappellari/Jenkins 2003 and 2006 where they develop the mvprobit, I compute the marginal effect as follow :
1) I do not know if this method considers the endogeneity of the Y2.
2) I compute the margin my self using this program :
I compute first for dummy variable, by compute the "predict" with X3=0 then "predict" with X3=1. I see the difference.
Then I compute for Continuous variable by adding the (standard deviation)/1000 which is the method used by Cameron, A. Colin, and Pravin K. Trivedi (2010), Microeconometrics Using Stata, Revised Edition, Stata Press, College Station, TX USA (http://www.stata-press.com/books/mic...metrics-stata/)
The coefficient of the margins written with my program are very different compared to the one estimated by default with the Stata margins command.
My last question, i would like also to compute the marginal effects after having estimate a recursive trivariate probit using the command mvprobit, i don't see why it will be an issue.
Thank you very much for your advice
Grazia
I compute the marginal effect of a recursive trivariate probit. To evaluate the program, i first estimate a recursive Bivariate probit using both command biprobit and mvprobit using Stata 14.1.
I would like to compute the marginal effect of P(Y1=1,Y2=1) or P(Y1=0,Y2=1)
After reading the Stata Journal article written by Cappellari/Jenkins 2003 and 2006 where they develop the mvprobit, I compute the marginal effect as follow :
Code:
biprobit (Y1= Y2 X1 X2 i.X3 i.X4) (Y2 = X1 X2 i.X3 i.X4)
Code:
margins, dydx(*) predict(p11) force
2) I compute the margin my self using this program :
Code:
mvprobit (Y1= Y2 X1 X2 X3 X4) (Y2 = X1 X2 X3 X4)
Code:
scalar d22=sqrt(1 -(e(rho21))^2) // Cholesky matrix mat D=(1, 0 \e(rho21),d22)
Code:
local Dummy "Y2 X3 X4 "
Code:
foreach X of local Dummy { quietly{ preserve gen double k1=1 gen double k2=1 replace `X'=0 mvppred xb_ref, xb mdraws, dr(700) neq(2) prefix(z) random seed(123456789) antithetics replace egen mv_ref= mvnp(xb_ref1 xb_ref2) , chol(D) draws(700) prefix(z) signs(k1 k2) adoonly replace `X'= 1 mvppred xb_`X', xb egen mv_`X'= mvnp(xb_`X'1 xb_`X'2) , chol(D) draws(700) prefix(z) signs(k1 k2) adoonly generate ME_`X'=mv_`X'-mv_ref } sum ME_`X' restore }
Code:
local Continuous "X1 X2"
Code:
mvppred xb_refc, xb gen double k1=1 gen double k2=1 mdraws, dr(700) neq(2) prefix(z) random seed(123456789) antithetics replace egen mv_ref= mvnp(xb_refc1 xb_refc2) , chol(D) draws(700) prefix(z) signs(k1 k2) adoonly foreach X of local Continuous { quietly{ preserve sum `X' gen delta_`X'=r(sd)/1000 replace `X'=`X' + delta_`X' mvppred xb_`X', xb egen mv_`X'= mvnp(xb_`X'1 xb_`X'2) , chol(D) draws(700) prefix(z) signs(k1 k2) adoonly gen ME_`X'=(mv_`X'- mv_ref)/delta_`X' } sum ME_`X' restore } drop xb_refc1 xb_refc2 mv_ref k1 k2 drop z1_1-z1_1400 z2_1-z2_1400
My last question, i would like also to compute the marginal effects after having estimate a recursive trivariate probit using the command mvprobit, i don't see why it will be an issue.
Code:
mvprobit (Y1= Y3 X1 X2 X3 X4) (Y2 = Y3 X1 X2 X3 X4) (Y3 = X1 X2 X3 X4)
Thank you very much for your advice
Grazia
Comment