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?