Skip to contents

Parallel to morie_did_synthetic: the same native Arkhangelsky et al. (2021) SDID engine, surfaced with the placebo / bootstrap / jackknife variance options and the raw unit / time weights. Use morie_did_synthetic when you want the rmorie result-list shape consumed by morie_did_* downstream code.

Usage

morie_did_synthdid_estimate(
  panel,
  unit,
  time,
  treatment,
  outcome,
  vcov_method = "placebo",
  ...
)

Arguments

panel

Long-format balanced panel.

unit

Unit identifier column.

time

Time period column.

treatment

Binary (0/1) treatment indicator that turns on at onset for treated units and is zero everywhere for controls.

outcome

Outcome column.

vcov_method

Inference method: one of "placebo" (default), "bootstrap", "jackknife".

...

Ignored; retained for back-compat.

Value

An S3 list of class morie_did_synthdid_result with elements att, std_error, vcov_method, n_treated, n_control, n_pre, n_post, method, and raw (the full native SDID fit list).

References

Arkhangelsky, D., Athey, S., Hirshberg, D. A., Imbens, G. W., & Wager, S. (2021). Synthetic difference-in-differences. American Economic Review, 111(12), 4088–4118.

Examples

if (requireNamespace("coresynth", quietly = TRUE)) {
  set.seed(13)
  df <- expand.grid(unit = 1:30, time = 1:8)
  df$treat_time <- ifelse(df$unit <= 5, 6, Inf)
  df$d <- as.integer(df$time >= df$treat_time)
  df$y <- 0.1 * df$time + 0.5 * df$d + rnorm(nrow(df), sd = 0.3)
  out <- morie_did_synthdid_estimate(df, unit = "unit", time = "time",
                                     treatment = "d", outcome = "y")
  out$att
}
#> [1] 0.2555796