Announcement

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

  • Treatment , Post Treat in case of heterogeneous treatment timing

    Hello all,

    Would like to create an event study but I'm trying to make sure I'm creating treatment, post-treat, leads, and lags correctly because my gut feeling says I'm doing something wrong at the very basic.

    Code:
    **** Min wage change
    
    gen treat=0. [ Treat = time * treated ]
    
    replace treat = 1 if year>=2015  & (statefip==2 /*alaska*/)
    replace treat = 1 if year>=2015  & (statefip==5 /*Arkansas*/)
    replace treat = 1 if year>=2013  & (statefip==4 /*Arizona*/)
    replace treat = 1 if year>=2015  & (statefip==6 /*California*/)
    replace treat = 1 if year>=2014  & (statefip==9 /*Connecticut*/)
    replace treat = 1 if year==2016  & (statefip==8 /*Colorado*/)
    
    
    And I'll create treated variable like the following :
    
    treated = ( statefip == 2 |  statefip ==5 |  statefip== 4 |  statefip == 6 |  statefip==9 |  statefip ==8 ) & !missing(statefip)

    In a normal DiD if I have hetergenous timing of treatment like I created myself here, I cannot make post variable like in case of homogenous treatment ( the following command )
    Code:
    *Create DID components *1. Timedummy gen time = (year>=2016) & !missing(Year)
    May I know how should I create my time dummy or post variable in case of heterogeneous treatment?
    Last edited by Tariq Abdullah; 15 Oct 2021, 11:16.

  • #2
    With different treatment timings, use this:
    Code:
    ssc install csdid
    ssc install drdid
    You need a variable indicating when the treatment started and it will take care of it itself.

    You'll use csdid (drdid is background).

    Comment


    • #3
      Very kind of you for providing such thoughtful feedback! But, the problem is I'm working with a sample of dataset that covers from 1996-2021 where the treatment is taking place since early 2000. therefore, that makes the Callaway and Sant’Anna quite impossible to implement in Stata. I can do that in R but in Stata that takes up all the memory. Thats why trying my luck with the old-fashioned way to see how it can be done. But, due to lack of knowledge and experience haven't had much of a luck! Therefore, asked for everyone's kind guidance!

      Comment


      • #4
        if find csdid works better. give it a try.

        Comment

        Working...
        X