Hello Statalist,

I am currently analyzing a repeated cross-sectional data to estimate the impact of county-level treatments (binary variable) on individuals' outcomes. There is a variation in treatment timing by year and all counties get treated eventually. When the treatments are turned on, they stay on during the study time period. I'm trying to estimate the dynamic treatment effects model (two-way FE: county FE and year FE) and I am interested in the coefficients on the treatment variable that correspond to the year when the treatment was implemented, a year and 2 years after the implementation.

Code:
reg outcome i.treatment#i.post_treat_rel i.year i.county
I used the code above. The "treatment" variable is a 0 or 1 variable that indicates 1 if the treatment was implemented in a given county in a specific year. The "post_treat_rel" variable shows the relative time to the year when the treatment gets turned on in each county --i.e. 0 for the pre-treatment years, becomes 1 in the year when the treatment is implemented in each county, and 2 and 3 after each year.

My question is, does my code (specifically, the coefficients on the interaction terms of treatment and post_treat_rel) above correctly estimate the dynamic treatment effects?

Another question is, I want to test the interaction effect of the treatment and one demographic variable (e.g. gender). In that case, how should I code this into the dynamic treatment effects model? I thought about running a three-way interaction, but it really complicates the interpretation. Are there other ways that people do to test the interaction effect in the dynamic DID model?

I would really appreciate any help you can give on this problem. Thank you in advance.