Announcement

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

  • panels are not nested within clusters

    Dear all,
    Hi, I want to run a fixed effects regression over (unbalanced) panel data, where
    1) fixed effects for every individual i;
    2) standard errors clustered by industry and month.
    I tried running,

    egen group = group(industry month)
    xtreg y x1 x2 x3, fe id(id) vce(cluster group)

    OR

    xtreg y x1 x2 x3, fe id(id) vce(cluster industry month)

    I keep getting "panels are not nested within clusters" I'd desperately appreciate your help in overcoming this difficulty. Thank you very much in advance!

    Best,
    John

  • #2
    This happens because some individuals change industries across months. You may need to use two way clustering. I recommend that you read section 5 of:

    Cameron, A. Colin, and Douglas L. Miller. "A practitioner’s guide to cluster-robust inference."
    Journal of Human Resources 50.2 (2015): 317-372.


    Jorge Eduardo Pérez Pérez
    www.jorgeperezperez.com

    Comment


    • #3
      John - do you want to cluster by unique industry-month combinations, or do you want to cluster in two different dimensions, industry and month, as Jorge suggests?

      There's a big difference. In the former, you allow for arbitrary within-industry-month combination. So if you have textiles as an industry and March 2010 as a month, you allow for arbitrary correlation between observations on textiles in March 2010. But you are still assuming that there is no correlation between textiles in March 2010 and textiles in April 2010 (or any other month), for example. This could be an unrealistic assumption.

      In the latter, you allow for arbitrary within-industry correlation, and also arbitrary within-month correlation. This is more robust because there can be a correlation between observations on textiles in two different months and you are still OK. But the data demands are greater, because IIRC the asymptotics for 2-way cluster-robust covariance estimator require the number of time periods to go off to infinity (which in your case may not be too bad) and the number of industries to go off to infinity (which is probably a tougher requirement).

      Comment


      • #4
        You can find an (almost final) version of the paper to which Jorge is referring here:
        http://cameron.econ.ucdavis.edu/rese...ober152013.pdf

        Comment

        Working...
        X