Continuous treatment variable in etwfe
Dear Grant, Many thanks for this amazing package. I was so happy to see this after reading Wooldridge (2023)!
Background I am looking at the impact of HIV treatment coverage on HIV incidence in 242 districts. Treatment (HIV treatment coverage) is continuous, outcome is count (>0), and I have person-time data available. 20 units out of 242 have never had treatment. In the remainder, a) coverage first occurred in 2022 and increased in 2023 and 2024 OR b) coverage started in 2023 and increased in 2024.
What I have done so far: IF I were to be interested in solely the binary impact of treatment I would use the below. Here first.treat is the first year that a unit was treated. Area_id is my unit, pt_n is person-years.
mod <- etwfe(
fml = anc_retest_pos ~ 1,
tvar = year,
gvar = first.treat,
cgroup = "never",
data = anc_new,
vcov = ~ area_id,
offset = ~ log(pt_n),
family = "poisson"
)
Where I am struggling Is there a way to apply this package when the treatment is a continuous variable? I would consider discretizing the treatment into multiple categories. I am aware of the new package By Callaway https://github.com/bcallaway11/contdid but the package does not account for time varying treatment. Also, my data is count and I think Callaway / Sant'anna rely on OLS. I decided to use etwfe() because of the Wooldridge 2023 comparison between Callaway,, OLS, and EFTWE in the first place.
Any thoughts and guidance would be helpful! I've been reading literature about this for quite a while now.
Thanks in advance S.