| sc_cic | R Documentation |
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.
sc_cic(
y_treated,
y_donors,
treatment_period,
alpha = 1,
boot = TRUE,
boot_iters = 500L,
seed = NULL
)
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 |
treatment_period |
Integer. The index (row number) of the first
treatment period. Periods 1 to |
alpha |
Elastic net mixing parameter. |
boot |
Logical. Compute bootstrap standard errors. Default |
boot_iters |
Integer. Number of bootstrap iterations. Default 500. |
seed |
Integer or |
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.
An object of class "sc_cic" inheriting from "cic",
with components:
tau |
The SC-CIC average treatment effect estimate. |
se |
Bootstrap standard error (if |
z |
z-statistic (bootstrap-based). |
pval |
Two-sided p-value (bootstrap-based). |
boot_se |
Same as |
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. |
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.
# 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.