Announcement

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

  • paneldata with two fixed effects

    Dear Statlisters

    I had a question in regards to paneldata. I have a dataset that contains information of different companies in different years. The paneldata is unbalanced. My question now is if it is possible to use the industry code and the year as fixed effects in my panel data regression. We split up the companies into different industries by using their SIC codes.Right now I used the code
    xtset fyear
    xtreg ratio_innovation_high_w openn_ceo_w,fe

    OR

    xtset industrysic
    xtreg ratio_innovation_high_w openn_ceo_w, fe

    Is there a way I can combine both of those into one analysis?
    Moreover, is it useful for me to eventually use company as fixed effects instead of industries?

    Thanks in advance!
    Sophie

  • #2
    You can add one of the variables as a dummy directly in the regression, usually the time fixed effects since its the smallest dimension.

    Code:
    xtreg ratio_innovation i.fyear, fe
    Otherwise you can use other commands that can add multiple fixed effects, this is useful if the number of groups of the other fixed effects is large

    Code:
    reghdfe ratio_innovation, absorb(fyear industrysic)
    Note that:
    1. For this last code you need to install the command from ssc using

    Code:
    ssc install reghdfe
    2. The R2 of xtset will include the fixed effects effect, whereas reghdfe (or areg) will not include it. This is by construction and doesnt affect the regression otherwise.

    Comment

    Working...
    X