Dear all,
I need help regarding margins condition command after cmp. Cmp is user written Roodman (2011) command (Roodman, D. 2011. Estimating fully observed recursive mixed-process models with cmp. Stata Journal 11(2): 159-206.).
I have panel data and I want to estimate bivariate random effects probit model (similarly as biprobit in univariate case). Dependent variables are binary, taking values 0 and 1.
In a help file there are examples how to use condition option in margin command after Heckman model, e.g. margins, dydx(*) predict(e eq(wage) condition(0 ., eq(selectvar))), where margins are computed conditional on observing wage. I am not sure how to set condition option properly. If I write condition(1 ., eq(y2)) those this means conditional that y2 is equal 1, and condition (. 0, eq(y2)) conditional that y2 is equal 0, or is it the opposite?
Please have a look at the code, and comment that I posted in a code. Thanks in advance.
Best regards,
Aleksandra
I need help regarding margins condition command after cmp. Cmp is user written Roodman (2011) command (Roodman, D. 2011. Estimating fully observed recursive mixed-process models with cmp. Stata Journal 11(2): 159-206.).
I have panel data and I want to estimate bivariate random effects probit model (similarly as biprobit in univariate case). Dependent variables are binary, taking values 0 and 1.
In a help file there are examples how to use condition option in margin command after Heckman model, e.g. margins, dydx(*) predict(e eq(wage) condition(0 ., eq(selectvar))), where margins are computed conditional on observing wage. I am not sure how to set condition option properly. If I write condition(1 ., eq(y2)) those this means conditional that y2 is equal 1, and condition (. 0, eq(y2)) conditional that y2 is equal 0, or is it the opposite?
Please have a look at the code, and comment that I posted in a code. Thanks in advance.
Best regards,
Aleksandra
Code:
cmp (y1=$xlist1 || id:) (y2=$xlist1 || id:), ind($cmp_probit $cmp_probit) estimate store cmp estimate restore cmp margins, dydx(*) predict(pr eq(y1) condition(1 ., eq(y2))) post // this line is probability that y1=1 (positive outcome) given that y2=1 (positive outcome of y2) estimate store cond_y2_1 estimate restore cmp margins, dydx(*) predict(pr eq(y1) condition(. 0, eq(y2))) post // this line is probability that y1=1 (positive outcome) given that y2=0 (negative outcome of y2) estimate store cond_y2_0
Comment