Announcement

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

  • Not nested Panel data

    I am using an unbalanced firm-level panel data. I am regressing the market share of the firms on a set of independent variables that account for the firm characteristics.
    I am running a fixed-effect model. My panel variable is the firm id.
    I would like to cluster my error by sector to get rid of any serial correlation between firms in the same sector.

    I am using this command
    xtreg lshare ltariff ltfp lwages lage trade, fe vce (cluster sector)

    However, I got this error "panels are not nested within clusters".

    What should I do to correct for this?

    Thanks in advance.

  • #2
    Aya:
    how did you -xtset- your data?
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      I have done the following:

      xtset firm year



      Thanks,
      Aya

      Comment


      • #4
        Aya:
        you should cluster on -panel.id- (which is not -sector-, but -firm- in your case).
        There's no fix about that, but plugging -i.sector- among the set of your predictors:
        Code:
        xtreg lshare ltariff ltfp lwages lage trade i.sector, fe
        As an aside (that reminds me of many years ago, when I was student in business administration, in a pre-laptop era!), -sector- should probably be -industry-.
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment


        • #5
          Thank you a lot for you reply.

          But I was having in mind to cluster by sector (industry in your words) as firms in the same industry have common characteristics that could be a source of correlation in the error term.

          Using -mixed- in that case wouldn't be useful.

          Thanks again!

          Comment


          • #6
            Aya:
            the following Stata thread can be useful: https://www.statalist.org/forums/for...try-year-level
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment

            Working...
            X