Announcement

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

  • How to define 'not yet treated' control cohort using xtevent

    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

    Last edited by Lars Jensen; 06 Jun 2025, 11:34.

  • #2
    Do you have a dummy variable for treated units? If so, then use egen total or some such to find never treated. Or, if you could something similar if you have a year treated variable (and see how the never treated are specified).

    Comment


    • #3
      Update to my own post (in case useful for others): the xtevent package does not allow for estimation of heterogeneous treatment effects using 'not yet' treated units as the control group. One can use 'never' or 'last' treated units. If you like to use 'not yet' treated units you can use the csdid package.

      Best,
      Lars

      Comment

      Working...
      X