Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: two stage least squares for panel data

From   Parfait Gasana <>
Subject   Re: st: two stage least squares for panel data
Date   Thu, 23 Aug 2012 09:14:06 -0500

Excellent! Thanks Austin, turns out I had missing observations that I
had to clean up to get an error-less xtivreg but your suggestions
below with xtivreg2 and the dummy variable route works optimally!


On Wed, Aug 22, 2012 at 10:50 AM, Austin Nichols
<> wrote:
> Parfait Gasana <>:
> Per the FAQ, you should show what you typed and what Stata responded.
> You should probably use -xtivreg2- as well, for the superior output:
> ssc inst ivreg2
> ssc inst xtivreg2
> xtset state year
> xtivreg2 y x1 (x2=z), fe cl(state)
> You can also include 51 dummies in a call to -ivreg2- or -ivregress-.
> qui ta state, gen(d_)
> ivreg2 y x1 d_* (x2=z), cl(id)
> On Wed, Aug 22, 2012 at 9:27 AM, Parfait Gasana
> <> wrote:
>> Hello all,
>> How can I estimate two-stage least squares or instrumental variable
>> regression with panel data? I tried xtivreg but receive the error: the
>> sample specifies cross-sectional data, xtivreg is not designed for
>> cross-sectional data. However, my data is in long format with repeated
>> indicators (here the. 50 U.S. states and DC)  across 5 years. Hence, a
>> sample size of 255. Also, I am sure I ran xtset, setting up the panel
>> and time variables. And all my instruments are nonmissing for every
>> observation.
>> What's more, I am able to successfully run a xtreg command. I
>> understand xtreg can use cross-sectional data. So, am I working with
>> cross-sectional data and if so, how do I get a time-dynamic dataset?
> *
> *   For searches and help try:
> *
> *
> *
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index