Hello,
I am using the xtevent package to undertake an event-study under staggered adaptation (15 yearly time periods across 150 units of analysis).
The xtevent package allows for estimation under heterogeneous treatment effects using the Sun & Abraham (2021) estimator. When setting the control cohort of interest the xtevent package provides a good example on how to do this when the user is interested in the 'last treated' cohort as the control cohort:
gen timet=t if z==1
by id: egen time_of_treat=min(timet)
gen last_treat=time_of_treat==39
xtevent y, panelvar(id) timevar(t) policyvar(z) window(5) impute(nuchange) ///
> cohort(time_of_treat) control_cohort(last_treat)
In the code above, z is the binary treatment indicator, and the 'time_of_treat' variable returns the period t in which treatment is assigned to the unit at the time of, and in all periods after, treatment (and with missing observations for periods before any treatment). The variable 'last treat' is binary taking the value 1 if the unit belongs to the last treated cohort (which in the above example is made up of all units treated in period 39) and zero otherwise. So far, so good.
I am however struggling to figure out how to use 'not yet' treated units as the control cohorts and I was hoping that someone might have an example I could utilize?
Thank you.
Best,
Lars
I am using the xtevent package to undertake an event-study under staggered adaptation (15 yearly time periods across 150 units of analysis).
The xtevent package allows for estimation under heterogeneous treatment effects using the Sun & Abraham (2021) estimator. When setting the control cohort of interest the xtevent package provides a good example on how to do this when the user is interested in the 'last treated' cohort as the control cohort:
gen timet=t if z==1
by id: egen time_of_treat=min(timet)
gen last_treat=time_of_treat==39
xtevent y, panelvar(id) timevar(t) policyvar(z) window(5) impute(nuchange) ///
> cohort(time_of_treat) control_cohort(last_treat)
In the code above, z is the binary treatment indicator, and the 'time_of_treat' variable returns the period t in which treatment is assigned to the unit at the time of, and in all periods after, treatment (and with missing observations for periods before any treatment). The variable 'last treat' is binary taking the value 1 if the unit belongs to the last treated cohort (which in the above example is made up of all units treated in period 39) and zero otherwise. So far, so good.
I am however struggling to figure out how to use 'not yet' treated units as the control cohorts and I was hoping that someone might have an example I could utilize?
Thank you.
Best,
Lars
Comment