Announcement

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

  • DID + falsification test

    Dear All, Suppose that I have the following data for DID (difference-in-differences) analysis.
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(id year d)
    1 2010 0
    1 2011 0
    1 2012 1
    1 2013 1
    1 2014 1
    2 2010 0
    2 2011 0
    2 2012 0
    2 2013 0
    2 2014 0
    3 2010 0
    3 2011 1
    3 2012 1
    3 2013 1
    3 2014 1
    4 2010 0
    4 2011 0
    4 2012 0
    4 2013 0
    4 2014 1
    end
    In this case, the times of treatment are different. For instance, for id=1, it is year=2012, and for id=3, it is year=2011, and so on. For falsification test (although, somehow, I have doubt), the common procedure is to redefine `d' with 1 one year before its original starting year of receiving treatment. For instance, now, for id=1, d=1 in year=2011 (and after).
    • My question is that is there a general approach to redefine `d' to this end? Thanks.
    Ho-Chuan (River) Huang
    Stata 17.0, MP(4)

  • #2
    Code:
    xtset id year
    bys id (year): replace d=F.d if F.d==1

    Comment


    • #3
      Dear Andrew, Many thanks for this helpful suggestion.
      Ho-Chuan (River) Huang
      Stata 17.0, MP(4)

      Comment

      Working...
      X