Announcement

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

  • Xtreg fixed effects

    Dear statalists

    I'm currently working with a panel data and perform my analysis at the municipal level

    I set the panel data at:
    Code:
    xtset MunicipalityID Year, yearly
    I believe so that when I add the fe option in the xtreg regression the system already adds i.MunicipalityID and i.Year dummies or doesn't it?

    Moreover, is it necessary to further add an interaction between i.RegionID#i.Year to get rid of that omitted variance?
    I'm asking because as soon as I try my coefficients turn from negative to positive

    As always thanks everyone in advance

    Loris

  • #2
    I believe so that when I add the fe option in the xtreg regression the system already adds i.MunicipalityID and i.Year dummies or doesn't it?
    No. It "adds" i.MunicipalityID variables, but not i.Year indicators. If you want i.Year indicators in your model, you have to include them in your -xtreg- command.

    I put "adds" in quotes because adding indicators for those variables is not the way it is actually done in Stata's -xtreg- command. In particular, if you are looking to see coefficient estimates for each municipality, they won't be there. Stata calculates -xtreg, fe- by de-meaning the data and regressing the deviations from the means. For linear models like -xtreg-, this produces results that are equivalent to running -regress- with i.MunicipalityID variables included. But no such variables are actually created or used. And it is important to also understand that you cannot emulate -xtlogit-, -xtpoisson-, and -xtnbreg- with -fe-,by running the non-xt version of the command and throwing in panel variable indicators. That trick only works for -xtreg-.

    To adjust for omitted variable bias that is attributable to time-invariant effects at the regional level, you would add just i.RegionID to your model. If you add i.RegionID#i.year to your model, then you are adding a new effect for each region-year combination. Whether it is necessary depends on whether there is reason to believe that there are meaningfully different disturbances in your outcome for each year in each region. That's a substantive question that has no purely statistical answer. You would have to consult someone who knows the subject matter of your study to answer that.

    Comment


    • #3
      Aways amazed at how easy you make such difficult concepts sound.

      As always thank you.

      Comment

      Working...
      X