st: xtivreg2, xtreg , panels are not nested within clusters

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

st: xtivreg2, xtreg , panels are not nested within clusters

Haizhen Lin
Dear members,

My unit is market-year and I want to cluster at state-year level. I
tired to use xtreg, cluster at state-year level, it provides error
"panels are not nested within clusters". What does the error mean?  It
seems that I can fix it by using nonest, right?

Now for xtivreg2, again cluster at state-year level, the same problem
came out (panels are not nested within clusters) and i do not know how
to fix it. Any suggestion?

Thanks a lot,

Haizhen
*
*   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/
Reply | Threaded
Open this post in threaded view
|

st: RE: xtivreg2, xtreg , panels are not nested within clusters

Schaffer, Mark E
Haizhen,

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Haizhen Lin
> Sent: 01 December 2008 19:50
> To: [hidden email]
> Subject: st: xtivreg2, xtreg , panels are not nested within clusters
>
> Dear members,
>
> My unit is market-year and I want to cluster at state-year level. I
> tired to use xtreg, cluster at state-year level, it provides error
> "panels are not nested within clusters". What does the error mean?

I don't understand your case (market, state, year), but here are some
illustrative examples.

Say your panels were states.  You could cluster by regions (groups of
states), because all observations in one panel (a state) are also all in
the same cluster (a region).  This is what is meant by "panels are
nested within clusters".

You could cluster by state, because again all observations in one panel
(a state) are also in the same cluster (the very same state).

But you could not cluster by year, because some observations in one
panel (say State X) might be found in one cluster (say 2001) and some
others from the same panel (again State X) could be found in a different
cluster (say 2002).

Hope this helps.

Cheers,
Mark (-xtivreg2- author)

> It
> seems that I can fix it by using nonest, right?
>
> Now for xtivreg2, again cluster at state-year level, the same problem
> came out (panels are not nested within clusters) and i do not know how
> to fix it. Any suggestion?
>
> Thanks a lot,
>
> Haizhen
> *
> *   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/
>


--
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.


*
*   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/
Reply | Threaded
Open this post in threaded view
|

Re: st: RE: xtivreg2, xtreg , panels are not nested within clusters

Haizhen Lin
Thanks a lot for the reply from Mark.

Another related question, is there any command out there that could do
xtivreg and cluster (allow panels nonnested within cluster)?

Thanks,
Haizhen



On Mon, Dec 1, 2008 at 6:21 PM, Schaffer, Mark E <[hidden email]> wrote:

> Haizhen,
>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf Of Haizhen Lin
>> Sent: 01 December 2008 19:50
>> To: [hidden email]
>> Subject: st: xtivreg2, xtreg , panels are not nested within clusters
>>
>> Dear members,
>>
>> My unit is market-year and I want to cluster at state-year level. I
>> tired to use xtreg, cluster at state-year level, it provides error
>> "panels are not nested within clusters". What does the error mean?
>
> I don't understand your case (market, state, year), but here are some
> illustrative examples.
>
> Say your panels were states.  You could cluster by regions (groups of
> states), because all observations in one panel (a state) are also all in
> the same cluster (a region).  This is what is meant by "panels are
> nested within clusters".
>
> You could cluster by state, because again all observations in one panel
> (a state) are also in the same cluster (the very same state).
>
> But you could not cluster by year, because some observations in one
> panel (say State X) might be found in one cluster (say 2001) and some
> others from the same panel (again State X) could be found in a different
> cluster (say 2002).
>
> Hope this helps.
>
> Cheers,
> Mark (-xtivreg2- author)
>
>> It
>> seems that I can fix it by using nonest, right?
>>
>> Now for xtivreg2, again cluster at state-year level, the same problem
>> came out (panels are not nested within clusters) and i do not know how
>> to fix it. Any suggestion?
>>
>> Thanks a lot,
>>
>> Haizhen
>> *
>> *   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/
>>
>
>
> --
> Heriot-Watt University is a Scottish charity
> registered under charity number SC000278.
>
>
> *
> *   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/