
Borusyak, Jaravel & Spiess (2024) imputation estimator
Source:R/did_modern_native.R
morie_did_borusyak.RdFits unit and time fixed effects on the UNTREATED observations only (via the native alternating demeaner), imputes the untreated potential outcome for every treated cell, and averages the treatment-minus-imputation differences. Standard error by cluster (unit) bootstrap of the whole impute-and-average pipeline – conservative and assumption-light.
Usage
morie_did_borusyak(
data,
outcome,
unit,
time,
treatment_time,
n_bootstrap = 199L,
seed = 42L,
alpha = 0.05
)Value
List of class "morie_did": estimate, std.error,
conf.int, p.value, method, n_units, n_periods, call.
Examples
df <- expand.grid(id = 1:40, t = 1:8)
df$g <- ifelse(df$id <= 20, 5L, NA)
df$y <- rnorm(nrow(df)) + ifelse(!is.na(df$g) & df$t >= df$g, 2, 0)
morie_did_borusyak(df, "y", "id", "t", "g", n_bootstrap = 29L)
#> Difference-in-differences -- Borusyak-Jaravel-Spiess imputation (cluster bootstrap SE)
#> ATT: 2.3454 (SE 0.1700) 95% CI [2.0123, 2.6785] p = 2.55e-43
#> Units: 40 Periods: 8