bootstrap marginal effect in two-stage logit model

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

bootstrap marginal effect in two-stage logit model

This post has NOT been accepted by the mailing list yet.
Dear all,

I want to estimate a logit model with one continuous endogenous explanatory variable, I have two instruments in hand to address the endogeneity, so I would like to use two-stage IV logit estimation. I want to use bootstrap to return the estimates of marginal effects and their bootstrap standard errors. Can anyone share your codes?

I also check previous answers to the similar question, and find the following link:, however this program seems to return only one marginal effect for education, and I need to return the marginal effects for the whole set of control variables, and I don't understand why the author only bootstrap "r(mfx)".

The following are my codes, but the returned results seem to be the point estimates rather than the marginal effects of the logit model:

use, clear
capture program drop marg
prog marg, rclass
 regress educ age kidslt6 kidsge6 city moth fath
 capture drop peduc
 predict peduc,xb
 logit inlf peduc age kidslt6 kidsge6 city
 matrix b=e(Xmfx_dydx)
 return scalar mfeduc=b[1,1]
 return scalar mfage=b[1,2]
 return scalar mfkidslt6=b[1,3]
 return scalar mfkidsge6=b[1,4]
 return scalar mfcity=b[1,5]
bootstrap, reps(20): marg

Any method to fix this?