sc_cic: Synthetic Control Changes-in-Changes Estimator

View source: R/sc_cic.R

sc_cicR Documentation

Synthetic Control Changes-in-Changes Estimator

Description

Combines synthetic control methods with the Changes-in-Changes estimator. First constructs a synthetic control unit from donor units using elastic net regularization, then applies the CIC estimator using the synthetic control as the comparison group.

Usage

sc_cic(
  y_treated,
  y_donors,
  treatment_period,
  alpha = 1,
  boot = TRUE,
  boot_iters = 500L,
  seed = NULL
)

Arguments

y_treated

Numeric vector. Outcome for the treated unit across all time periods (pre and post).

y_donors

Numeric matrix. Outcomes for donor units, with rows as time periods (matching y_treated) and columns as donor units.

treatment_period

Integer. The index (row number) of the first treatment period. Periods 1 to treatment_period - 1 are pre-treatment.

alpha

Elastic net mixing parameter. alpha = 1 (default) is lasso; alpha = 0 is ridge.

boot

Logical. Compute bootstrap standard errors. Default TRUE. The bootstrap re-estimates the elastic net weights in every iteration to account for first-stage estimation uncertainty.

boot_iters

Integer. Number of bootstrap iterations. Default 500.

seed

Integer or NULL. Random seed for reproducibility.

Details

The procedure works in two steps:

Step 1: Synthetic Control Construction. In the pre-treatment period, the treated unit's outcome is regressed on the donor units' outcomes using elastic net (via cv.glmnet). This yields a sparse set of weights that construct a synthetic control unit as a weighted combination of donors.

Step 2: CIC Estimation. The CIC estimator is applied with the synthetic control as the "control group" and the treated unit as the "treatment group."

Inference. Because the synthetic control is an estimated object, the analytic asymptotic variance of Athey and Imbens (2006) does not directly apply. Instead, sc_cic provides bootstrap standard errors that re-estimate the elastic net weights in each bootstrap iteration, thereby accounting for first-stage estimation uncertainty. The bootstrap resamples time periods (with replacement) within the pre-treatment and post-treatment windows separately, preserving the panel structure.

Value

An object of class "sc_cic" inheriting from "cic", with components:

tau

The SC-CIC average treatment effect estimate.

se

Bootstrap standard error (if boot = TRUE). Note: analytic standard errors from Athey and Imbens (2006) Theorem 5.1 are not provided for sc_cic, because they do not account for first-stage synthetic control estimation uncertainty. Use cic directly if analytic SEs are needed for a pre-specified control group.

z

z-statistic (bootstrap-based).

pval

Two-sided p-value (bootstrap-based).

boot_se

Same as se (for compatibility with cic).

tau_did

The SC-DID estimate for comparison.

sc_weights

Named vector of synthetic control weights (including intercept).

sc_fitted

Synthetic control outcome across all time periods.

donors_selected

Names of donor units with nonzero weights.

pre_fit_rmse

Root mean squared error of pre-treatment fit.

References

Athey, S. and Imbens, G. W. (2006). Identification and Inference in Nonlinear Difference-in-Differences Models. Econometrica, 74(2), 431–497.

Abadie, A., Diamond, A., and Hainmueller, J. (2010). Synthetic Control Methods for Comparative Case Studies. Journal of the American Statistical Association, 105(490), 493–505.

Examples


# Basque Country example
if (requireNamespace("Synth", quietly = TRUE)) {
  data("basque", package = "Synth")
  gdp <- reshape(basque[, c("regionno", "year", "gdpcap")],
                 idvar = "year", timevar = "regionno", direction = "wide")
  y_treated <- gdp[, "gdpcap.17"]
  donors <- as.matrix(gdp[, grep("gdpcap\\.", names(gdp))])
  donors <- donors[, !colnames(donors) %in% c("gdpcap.17", "gdpcap.1")]
  valid <- complete.cases(y_treated, donors)
  result <- sc_cic(y_treated[valid], donors[valid, ],
                   treatment_period = 16, seed = 42)
  print(result)
}



sccic documentation built on April 10, 2026, 5:07 p.m.