Announcement

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

  • panel regression with year fixed effect,firm fixed effects and industry fixed effects

    Hi everybody,

    For my research I have to do multiple regressions with panel data.
    1. including year fixed effects
    2. including year and firm fixed effects
    3. including firm fixed effects and industry-times-year fixed effects

    For the first one I did:
    xtreg y var1 var2 var3 i.year, fe

    But for both the second and the third one, I got a bit stuck, because you cannot simply add i.firm to the regression right?
    Someone an idea how to fix this?

    Thanks!

  • #2
    Um, how is your data -xtset-? It must be -xtset- in some way or -xtreg- would not have run at all. Whatever is listed as the panel identifier in -xtset- is automatically included as a fixed effect in -xtreg-, so your solution for #1 is incorrect. What you have done already incorporates something besides i.year as a fixed effect.

    It sounds like the structure of your data is year nested in firm nested in industry. Is that right?

    If so, to get year fixed effects only, you could just do -reg y var1 var2 var3, i.year-

    Then to get year and firm fixed effects you could -xtset firm- and do -xtreg y var1 var2 var3 i.year, fe-

    And for firm fixed effects and industry times year fixed effects:

    Code:
    egen industryXyear = group(industry, year), label
    xtset firm
    xtreg y var1 var2 var3 i.industryXyear
    Another way to incorporate both multiple fixed effects, especially if you don't want to actually see estimates of the industryXyear effects or if they are very numerous is with Sergio Correia's -reghdfe- command which you can install from SSC.

    Comment


    • #3
      Thanks again Clyde,

      very helpful. It is indeed year nested in firm in industry. For the last regression I used reghdfe, very nice command!

      I had a small question, when I use esttab, and drop (*.year), the coefficients change a little bit. Is that normal? I thought that only all the time dummies were removed from the table, but the content of the other variables would still be the same.

      Kind regards,
      Véronique

      Comment


      • #4
        I can't really advise you about -esttab-. I don't use it myself and don't know much about it. Hopefully, somebody else will respond.

        Comment


        • #5
          Instead of the industryxyear fixed effects (which adds a pile of parameters), you might consider including the average for the industry in each year (omitting the focal firm) as a control variable.

          Comment

          Working...
          X