Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: bootstrap marginal effect in two-stage logit model
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: bootstrap marginal effect in two-stage logit model
Date
Tue, 10 May 2011 19:04:06 +0200
-bootstrap- needs to know which parameters to bootstrap, and you did
not tell it. So it takes the default, which is whatever is in e(b), in
this case the logit-coefficients not the results from -mfx-. So either
make -marg- eclass and return your marginal effects in e(b) or tell
-bootstrap- the coefficients which you want to bootstrap.
Notice that -mfx- is no longer the preferred command to compute
marginal effects, use -margins- instead.
Hope this helps,
Maarten
On Tue, May 10, 2011 at 6:35 PM, xueliansharon <[email protected]> wrote:
> 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:
> http://www.stata.com/statalist/archive/2007-07/msg00779.html, 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 http://fmwww.bc.edu/ec-p/data/wooldridge/mroz.dta, 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
> mfx
> 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]
> end
> bootstrap, reps(20): marg
>
> Any method to fix this?
>
> Thanks,
> Sharon
>
> --
> View this message in context: http://statalist.1588530.n2.nabble.com/bootstrap-marginal-effect-in-two-stage-logit-model-tp6348583p6348583.html
> Sent from the Statalist mailing list archive at Nabble.com.
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
--
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/