simulate_sccic: Simulation Study for SC-CIC

View source: R/simulate.R

simulate_sccicR Documentation

Simulation Study for SC-CIC

Description

Generates data under controlled DGPs and evaluates SC-CIC performance.

Usage

simulate_sccic(
  n_sims = 500,
  T_pre = 25,
  T_post = 15,
  J = 15,
  tau_true = 1,
  dgp = c("linear", "nonlinear", "sc_good", "sc_bad"),
  alpha = 1,
  boot_iters = 200,
  seed = 42,
  verbose = TRUE
)

Arguments

n_sims

Integer. Number of simulation replications.

T_pre

Integer. Number of pre-treatment periods.

T_post

Integer. Number of post-treatment periods.

J

Integer. Number of donor units.

tau_true

Numeric. True average treatment effect.

dgp

Character. Data generating process. See Details.

alpha

Elastic net mixing parameter for SC construction.

boot_iters

Integer. Bootstrap iterations per simulation.

seed

Integer. Random seed.

verbose

Logical. Print progress.

Details

Four DGPs are available, designed to test different aspects of SC-CIC:

DGP 1: "linear" — Baseline. Outcomes are linear in a common factor and unit-specific loadings. DID is correctly specified. CIC matches DID. SC fits well. Purpose: verify the method works in the easy case.

DGP 2: "nonlinear" — CIC advantage. Cross-sectional DGP (not SC). N observations per cell. Control and treated have different distributions of unobservables. The production function is nonlinear and changes over time. DID is biased due to the nonlinear distributional shift; CIC is correct. Purpose: demonstrate the advantage of CIC over DID. Note: this tests cic(), not sc_cic().

DGP 3: "sc_good" — SC with good distributional fit. The treated unit is a true sparse combination of donors plus noise. SC recovers the weights well; the distributional dynamics are similar. Purpose: show SC-CIC works when SC fit is good.

DGP 4: "sc_bad" — SC with mean-only fit. The SC matches the treated mean, but donors have much lower variance than the treated unit. The distributional transport is wrong. Purpose: show SC-CIC fails when distributional assumptions are violated.

Value

A data frame with simulation results.

Examples

# Quick example (runs in seconds)
r <- simulate_sccic(n_sims = 2, dgp = "nonlinear", tau_true = 1, boot_iters = 5, verbose = FALSE)
summarize_simulation(r, tau_true = 1)


# Full simulation
r <- simulate_sccic(n_sims = 200, dgp = "nonlinear", tau_true = 1)
summarize_simulation(r, tau_true = 1)



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