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 at the end of May, 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   Parfait Gasana <parfait.gasana@gmail.com>
To   statalist@hsphsun2.harvard.edu
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!

Parfait

On Wed, Aug 22, 2012 at 10:50 AM, Austin Nichols
<austinnichols@gmail.com> wrote:
> 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/
*
*   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