[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Bootstrap marginal effects for two-step IV

From   "Michael Furukawa" <>
To   <>
Subject   RE: st: Bootstrap marginal effects for two-step IV
Date   Thu, 26 Jul 2007 11:37:26 -0700

Thanks for the helpful suggestions.

I have tried your program exactly (on my own data) but get the following
error message:
'r(mfx)' evaluated to missing in full sample

Any thoughts on how to fix this?

-----Original Message-----
From: Austin Nichols [] 
Sent: Wednesday, July 25, 2007 9:12 PM
Subject: Re: st: Bootstrap marginal effects for two-step IV

Michael Furukawa <>:
The -bootstrap- help file is a good starting point--but you might also
want to read
"Instrumental variables, bootstrapping, and generalized linear models"
by James Hardin, Henrik Schmiediche, and Raymond Carroll (see

Here's a fake example to get you started:
use, clear
g id=_n
g frac=hours/52/100
cap prog drop myest
prog myest, rclass
 reg educ age kidslt6 kidsge6 city moth fath
 cap drop r
 predict r, resid
 glm frac educ age kidslt6 kidsge6 city r, link(logit) fam(bin)
 mfx, var(educ)
 mat b=e(Xmfx_dydx)
 return scalar mfx=b[1,1]
bootstrap r(mfx), reps(20) cluster(id): myest

On 7/25/07, Michael Furukawa <> wrote:
> Dear Statalisters:
> I am estimating a fractional logit with a continuous endogenous
> by two-step IV estimation, following Wooldridge (2005)
> regress endog $rhs $iv, robust cluster(id)
> predict r, resid
> glm y $rhs endog r, link(logit) fam(bin) robust cluster(id)
> mfx, var(endog)
> I am interested in bootstrapping the standard errors for the marginal
> effects, can anyone share code that might do this?

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index