Announcement

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

  • Interactive Year Fixed Effects

    Hello,

    I have a regression of the form: xtreg yvariable c.xvariable#i.year c.xvariable i.year `control', fe

    where years are 1999, 2002, 2006, 2010 and 2014. When I run the regression, the coefficients in the interaction term "c.xvariable#i.year" for years 2002, 2006 and 2014 are omitted because of collinearity. However, those years do show coefficients in the "i.year" fixed effects part. Is there something I am doing wrong? Should I not include the variable "year" both in "c.xvariable#i.year" and by itself in "i.year"?

    My goal is to understand the impact that xvariable has on yvariable broken down by year, the calculation for 2014 for example should be=c.xvariable+2014.year#c.xvariable" right? Or do I have to add the coefficients of "2014.year" too?

    Thank you very much,

    Joan
    Last edited by Joan Marti; 10 Aug 2020, 06:07.

  • #2
    While what you have written is correct, it would be simpler and more convenient to use the double number sign (#) to indicate the interaction:

    Code:
    c.xvariable##i.year
    The above tells Stata to include the interaction and each component.

    I suspect your interaction and some other variables, quite possibly year, are collinear. If you specify all terms, Stata will omit the collinear ones so I wouldn't worry about it, unless you suspect there is a problem with your data or coding. Without more information about the data, I cannot help you any further. My suggestion is for you to include all relevant terms as above and estimate the effect by year using the margins command. You can do something like follows:

    Code:
    margins, dydx(xvariable) at(year_dummy = (1(1)N)) 
    marginsplot
    where N = the number of year dummies you have in your data.

    Comment


    • #3
      Dear Chris,

      Thank you very much for your advice. The issue is that I don't understand how to interpret the coefficients at this point.

      If the impact of xvariable on yvariable for the years 2002, 2006 and 2014 is calculated as "c.xvariable+2002.year#c.xvariable" but the second part of the equation is collinear, does this mean that for the years 2002, 2006 and 2014 the impact is just "c.xvariable + 0", and thus have the same exact impact? Or should I then also add in the calculation the coefficient of the year fixed effects ("c.xvariable+2002.year#c.xvariable+2002.year") ?

      Thank you very much,

      Joan

      Comment


      • #4
        I strongly suggest you adopt the marginal effects approach I mentioned in post #2. Not only will it make the interpretation better, but marginsplot will graphically depict it, which should also be helpful.

        Comment


        • #5
          Thank you Chris, the margins approach works perfectly and the graphical depiction is very useful. However, while years 2010 and 2014 are properly calculated, it says that years 2002 and 2006 are "(not estimable)". Is there a way to fix this?

          This is the code I used:

          xtreg yvariable c.xvariable##i.year, fe
          margins, dydx(xvariable) at(year = (2002 2006 2010 2014))
          marginsplot

          Thank you very much,

          David

          Comment

          Working...
          X