Skip to contents

For each horizon h the contrast y_{i,t+h} - y_{i,t-1} is taken between newly treated observations (dD_it = 1) and clean controls (D_{i,t+h} = 0), the sample restriction of equation (8) of the paper. Excluding the already-treated units from the comparison group removes the negative weights that make dynamic two-way fixed effects uninterpretable under heterogeneous effects. Each horizon is estimated by the doubly robust moment of Sant'Anna and Zhao (2020).

Usage

Drlp1(y, D, unit, time, horizon = 3L, X = NULL)

Arguments

y

Outcome, long format, one entry per unit-period.

D

Binary treatment indicator.

unit, time

Unit and period identifiers.

horizon

Largest horizon reported; non-negative.

X

Optional baseline covariates, one row per unit-period.

Value

List with estimate, horizons, beta, se, n_cells, n.

References

Dube, A., Girardi, D., Jorda, O. and Taylor, A. M. (2023). A local projections approach to difference-in-differences. NBER Working Paper 31184, equation (8); Journal of Applied Econometrics 40(7), 741-758 (2025). Sant'Anna, P. H. C. and Zhao, J. (2020). Journal of Econometrics 219(1), 101-122, equation (2.6).

Examples

Drlp1(y = c(1, 2, 3, 4, 5, 6, 7, 8), D = c(1, 2, 3, 4, 5, 6, 7, 8),
  unit = c(1, 2, 3, 4, 5, 6, 7, 8), time = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $estimate
#> [1] NaN
#> 
#> $horizons
#> [1] 0 1 2 3
#> 
#> $beta
#> [1] NaN NaN NaN NaN
#> 
#> $se
#> [1] NaN NaN NaN NaN
#> 
#> $n_cells
#> [1] 0 0 0 0
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "DR-DiD via local projection"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"