| scm_inference | R Documentation |
Confidence intervals and p-values for the aggregate ATT of a staggered SCM fit via the weighted multiplier (wild) bootstrap of Ben-Michael, Feller & Rothstein (2022, Section 5.3), adapting Otsu & Rai (2017). The aggregate ATT is written as a weighted average of per-treated-unit effect contributions; each bootstrap draw perturbs those contributions with independent golden-ratio two-point multipliers (mean 0, variance 1) while donor weights and outcomes are kept fixed.
scm_inference(
fit,
method = "wild_bootstrap",
n_boot = 1000L,
level = 0.95,
alternative = c("two.sided", "greater", "less"),
seed = NULL
)
fit |
A staggered SCM fit from |
method |
Only |
n_boot |
Number of bootstrap draws. Default 1000. |
level |
Confidence level. Default 0.95. |
alternative |
Direction of the alternative hypothesis for the
p-value: |
seed |
Optional RNG seed. |
Works with both staggered SCM paths (nu = NULL legacy and the
partially pooled path) and honours the cohort aggregation weights
N_treated x T_post. For intercept-shifted fits (fixedeff = TRUE)
the per-unit contributions are computed in difference-in-differences
form, i.e. each treated unit is demeaned by its own pre-treatment mean.
With very few treated units the multiplier distribution has few atoms, so the bootstrap is unreliable; a warning is issued below 5 treated units.
A coresynth_inference object with the standard fields
(estimate, se, p_value, ci_lower, ci_upper, method,
staggered, n_controls, alternative, boot_ests), compatible
with tidy.coresynth_inference() and glance.coresynth_inference().
n_treated additionally records the number of treated units
resampled by the multipliers.
Ben-Michael, E., Feller, A., & Rothstein, J. (2022). Synthetic controls with staggered adoption. JRSS-B, 84(2), 351-381.
set.seed(1)
dat <- expand.grid(time = 1:20, id = paste0("u", 1:12))
dat$y <- rnorm(nrow(dat)) + as.numeric(factor(dat$id))
dat$d <- as.integer(
(dat$id == "u1" & dat$time > 10) | (dat$id == "u2" & dat$time > 14)
)
fit <- scm_fit(y ~ d | id + time, data = dat, method = "scm")
scm_inference(fit, n_boot = 200, seed = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.