Announcement

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

  • Leads and Lags in a Staggered Difference-in-Differences Model Stata

    I'm trying to use: 1) lags to check whether the effect increases or decreases over time, and 2) leads to check for parallel trends.

    At the moment, my treatment occurs in different years across the states in my dataset, and some states are never exposed to the treatment.

    So far, I have constructed what I think might work:

    Code:
      
    tab States, gen(s)
    foreach x of varlist s1-s50{
    gen st`x'=`x'*Year }  
    
    so States Year  
    gen provision=0
    replace provision=1 if L.activetreatment==0 & activetreatment==1  
    
    forvalues kk = 0(1)13 {     gen F`kk'_pre=F`kk'.provision     replace F`kk'_pre=0 if F`kk'_pre==.    
    }  
    
    forvalues kk = 1(1)5 {     gen L`kk'_pre=L`kk'.provision     replace L`kk'_pre=0 if L`kk'_pre==.    
    }
    This has assigned each treated state/year combination into its proper time relative to treatment.

    I guess the underlying question I have is, now that I have generated dummies to differentiate states by the year relative to their treatment, if I wanted to see how treatment effects changed over time, would I use a regression model, or is there another more effective way I'm missing?

    I'm thinking that regressing each dummy (0 years after treatment, 1 year after, 2 years, etc.) against my dependent variable may work, but I am not entirely sure. Would you recommend this method, or another?

    Also, to see if there are parallel trends, would I have to construct graphs, or is there some kind of other method?
    Last edited by Santy Beans; 17 May 2022, 15:14.

  • #2
    Why not just do
    Code:
    reg y F.x(1/13) L.x(1/5)
    I have many other methods I would recommend

    Comment


    • #3
      Thanks Jared, this works well! Do you know how I would use the leads to check for parallel trends?

      I'm confused since the treatments are staggered, and so I'm not sure what period of the control group I would be comparing to the the pre-treatment period of the treated group.

      Comment


      • #4
        Read this paper. There are sophisticated methods in Stata that do what you're looking for. We can discuss those, if you'd like. Out of curiosity, how many treated units are there?

        Comment


        • #5
          Thank you for linking the paper. From what I understand, I set g as the year a state get treated in, and for untreated states, g=infinity. And to test parallel trends I would fill in the two equations to see if they are equal.

          However, I'm not sure how i could code this in Stata - would I have to fill it out multiple times for each treated and untreated state?

          Out of curiosity, how many treated units are there?
          I have 8 treated units, and 42 untreated.

          Comment


          • #6
            Okay so now here's the important part: my advice to you, is to not use difference in differences. Don't bother with it.

            DD is nice to know, and I think it's a very useful tool for policy analysis. But what you want, is the higher form of DD, synthetic controls. And, you can use my colleagues new command to do what you seek.

            Synthetic controls forces parallel trends to be true. No lags and leads, no nothing, it forces it to be true (assuming you use the design correctly, that is).

            His command allsynth is a beast, but it does precisely what you want. So does my command, but it isn't public yet.

            Comment

            Working...
            X