Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Random effects and two-way clustered standard errors in the same model?

    Hi all,

    I would greatly appreciate some help on how to run a regression including both random effects and two-way clustered standard errors. So far, I have not found a stata command that allows me to do this (I’m using stata 14).

    Some context:

    I am estimating the effects of x1 and x2 on y. The data include three different “id variables” that characterize each observation: ID_1, ID_2, and ID_3 (ID_1 is nested within ID_2). I would like to include random effects at the level of ID_1 and fixed effects at the levels of ID_2 and ID_3. I would also like to cluster the standard errors on both ID_2 and ID_3.

    If I only cluster on one level (ID_3), I can estimate this model in the following way:

    Code:
    xtset ID_1
     
    xtreg y x1 x2 i.ID_2 i.ID_3, re vce(cluster ID_3) nonest
    Is there any way of estimating the exact same model but clustering on bo​th ID_2 and ID_3?

    I very much appreciate any help I can get!

    Thanks in advance,

    Anna
Working...
X