Announcement

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

  • Collinearity issue in difference in difference model

    Hello.

    I have a panel dataset from the year 2012 to 2017. and I'm assessing a treatment imposed in the year 2015. I want to define 2014 (the year before treatment) as my base year but in the year-by-year result, 2017 is shown as omitted due to collinearity. when I exclude 2017, then 2016 would be omitted.

    this is my code:

    gen JCPOA = (Year >= 2015)

    gen treated = Code == 2910 | Code == 2920 | Code == 2930 | Code == 3011 | Code == 3012 | Code == 1910 | Code == 1920

    xtset Code Year
    xtreg adjPrimaryRawMaterialTotal i.treated##i.JCPOA i.Year, fe vce(cluster Code)

  • #2
    Code:
    g treated = inlist(Code, 2910, 2920, 2930, 3011, 3012, 1910, 1920)  // a little cleaner
    ssc install reghdfe 
    reghdfe adjPrimaryRawMaterialTotal c.treated#c.JCPOA , absorb(Code year) cluster(Code)
    * DID Coef = c.treated#c.JCPOA
    with xtreg, so specify a base year with i.year, you set b3.year (where 3 is 2014, I think).

    The ## is unecessary since you have Code and year fixed effects.

    Comment

    Working...
    X