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

Re: st: instrumental variables with stage 2 NBM and panel data

From   "Austin Nichols" <>
Subject   Re: st: instrumental variables with stage 2 NBM and panel data
Date   Mon, 15 Sep 2008 13:52:11 -0400

Charlie Trevor <>:
If you want a consistent IV estimator for count data,
 ssc install ivpois, replace
and read the help file:
 help ivpois
For fixed effects, you could include 29 dummy variables, and
clustering (resampling panels rather than obs) can be done via
bootstrap options as mentioned in that help file.  For -nbreg- you
will have to write your own estimator, or you can try sticking in the
residuals from your 3 first-stage regressions in addition to the 3
endogenous vars (with no guarantee of consistency, but clearly better
than sticking in the predicted values; see Wooldridge 2002:, and bootstrapping the whole

On Mon, Sep 15, 2008 at 1:03 PM, Charlie Trevor <> wrote:
> Hello.  I am trying to figure out how to conduct an instrumental variables analysis in Stata under the following conditions:
> 1.  I have panel data – roughly 6 years with 30 observations per year.
> 2.  stage 1 is a fixed effects model.  I have instruments and will be creating three instrumented variables to be stage 2 predictors (x1hat, x2hat, x3hat ), all of which are continuous.
> 3.  stage 2 is a cross-sectional time-series negative binomial model, as my DV is count data and overdispersed.  I would like to do both fixed and random effects approaches.
> I have an alternative stage 2 DV that is continuous, so am able to use xtivreg, fe and xtivreg, re for those analyses.  As far as I have been able to discern, however, there is no instrumental variables command that is parallel to that and would allow me to conduct a fixed or random effects negative binomial model in stage 2.  Certainly, I could create the stage 1 predicted values and then manually insert them into the stage 2 xtnbreg, fe and xtnbreg, re.  This, however, will not give me appropriate standard errors, and my severe lack of programming acumen prevents me from writing the code to provide correct standard errors.
> So, I would greatly appreciate it if someone could tell me if I am missing something here.  If I am not, would someone be able to provide some Stata code that will allow me to get at the standard errors.  Would bootstrapping be a reasonable approach to getting my standard errors here?  Guan's article (2003 Stata Journal; 3[1], 71-80) suggests bootstrapping with a manual approach in an example where the 2nd stage is a Tobit model. Might adapting that program be a reasonably straightforward fix, or is there a simpler/better way (also a little unsure how to ensure that I sample cross-sections rather than random observations, which I have read is preferable if bootstrapping with panel data).

*   For searches and help try:

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