Hi,
I am running the following simulation of a probit estimation:
For margins, Stata gives me the following output:
Could someone please explain to me why it makes sense (from an econometric perspective) that "option continuous implied because a factor with only one level was specified in option dydx()"?
I can imagine calculating discrete marginal effects as:
For this the output is: .34095.
Thank you!
I am running the following simulation of a probit estimation:
Code:
clear all set obs 1000000 set seed 134 * categorical variable with 3 levels gen cat=mod(_n, 3)+1 * generating latent LHS variable, with only cat==3 having a significant effect gen y_l=rnormal(0,.1) replace y_l=y_l+1 if cat==3 * generating LHS variable gen y=rbinomial(1, normal(y_l)) * estimation probit y 3bn.cat margins, dydx(*)
Code:
. margins, dydx(*) note: option continuous implied because a factor with only one level was specified in option dydx(). Conditional marginal effects Number of obs = 1,000,000 Model VCE: OIM Expression: Pr(y), predict() dy/dx wrt: 3.cat ------------------------------------------------------------------------------ | Delta-method | dy/dx std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- 3.cat | .3461805 .000876 395.17 0.000 .3444635 .3478975 ------------------------------------------------------------------------------
I can imagine calculating discrete marginal effects as:
Code:
probit y 3bn.cat local bcat=_b[3bn.cat] local bcons=_b[_cons] * evaluating CDF at cat == 3 vs at cat == some base value quietly forval i=2/3{ preserve replace cat=`i' * evaluated normal pdf() for each observation in the training sample gen cdf_eval=normal(`bcat'*3bn.cat+`bcons') * the marginal effect of the given variable for each observation su cdf_eval if `i'==2 { local at_0=r(mean) } if `i'==3 { local at_1=r(mean) } restore } * taking the difference of these local discrete_marginal_effect=`at_1'-`at_0' di "`discrete_marginal_effect'"
Thank you!
Comment