Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: two stage least squares for panel data


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: two stage least squares for panel data
Date   Wed, 22 Aug 2012 11:50:45 -0400

Parfait Gasana <parfait.gasana@gmail.com>:
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
<parfait.gasana@gmail.com> 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:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index