Statalist


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

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


From   "Schaffer, Mark E" <[email protected]>
To   <[email protected]>
Subject   st: RE: xtivreg2, xtreg , panels are not nested within clusters
Date   Mon, 1 Dec 2008 23:21:29 -0000

Haizhen,

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Haizhen Lin
> Sent: 01 December 2008 19:50
> To: [email protected]
> 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/



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