ATT(d|d') = E[Y(d) - Y(0) | D = d'] is a level effect and
ACRT(d_j|d_k) = E[Y(d_j) - Y(d_{j-1}) | D = d_k]/(d_j - d_{j-1})
is a slope; the paper is explicit that the two can have different
signs, so both curves are returned and neither stands in for the
other. Each ATT(d|d) is the doubly robust panel moment of
Sant'Anna and Zhao (2020) comparing the units at dose d
against the zero-dose units.
Usage
Drctf(y, D_dose, X = NULL)
Arguments
- y
Outcome change, one entry per unit.
- D_dose
Non-negative treatment intensity; zero marks untreated.
- X
Optional baseline covariates.
Value
List with estimate, doses, att,
se, acrt, acrt_dose, n_zero, n.
References
Callaway, B., Goodman-Bacon, A. and Sant'Anna, P. H. C.
(2024). Difference-in-differences with a continuous treatment.
arXiv:2107.02637, Section 3. Sant'Anna, P. H. C. and Zhao, J.
(2020). Journal of Econometrics 219(1), 101-122, equation (2.6).
Examples
set.seed(12)
dose <- c(rep(0, 100), sample(1:3, 200, TRUE))
y <- 0.5 * dose + rnorm(300)
Drctf(y, dose)[c("doses", "att")]
#> $doses
#> [1] 1 2 3
#>
#> $att
#> [1] 0.6622306 1.0064366 1.4951635
#>