Provenance and dictionaries for the SAR and Cao–Dowd case studies
Three panels ship inside the wheel as plain CSVs:
the sar paper’s two empirical applications, copied verbatim from its replication package’s nonproprietary export;
the cd paper’s Proposition 99 panel, copied from the authors’ repository.
Every loader returns a SpillPanel: the long panel with a 0/1 treated column, what its models need, and a config_kwargs() helper that feeds SCSPILLConfig directly. For sar panels, what the models need is the raw spatial weights aligned by donor label. For the cd panel, it is the paper’s exposed states. config_kwargs() configures sar when the panel has spatial weights and cd otherwise; pass method= to choose. The spatial weights are stored unnormalized. The estimator row-normalizes spatial_W and scales spatial_w to sum to one, exactly as the R package does.
California Proposition 99
from scspill.data import load_californiaca = load_california()ca.df.head()
Provenance: the Abadie–Diamond–Hainmueller (2010) tobacco panel as distributed with Cunningham’s Causal Inference: The Mixtape; contiguity derived from the 2024 TIGER/Line state shapefile with spdep::poly2nb(queen = FALSE).
average 2000–2010 bilateral trade with Sudan (raw US\() |
| `spatial_W` | average bilateral trade among donors (raw US\))
Provenance: World Development Indicators (percentage series stored as proportions), with the treated unit aggregating Sudan and South Sudan after the split; trade weights from the IMF Direction of Trade Statistics, symmetrized and averaged over the pre-period. The loader renames the R export’s mangled WDI headers to snake_case; pass raw_names=True for the original headers:
50 U.S. states plus DC (load_california_cd(51)), or 41 of them (load_california_cd(41))
Periods
1970–2000 (annual); California treated from 1989
Outcome
cigs — per-capita cigarette consumption (packs)
affected_units
51 units: the twelve states that passed their own tobacco-control laws (including Arizona and Oregon) plus Nevada; 41 units: Arizona, Nevada and Oregon
Spatial weights
none — config_kwargs() configures method="cd"
The 41-unit panel drops the ten policy states that do not border California. Provenance: the input data of jcao0/synthetic-control-spillover at commit 86004020, copied byte for byte (cigs_consumption.csv and state_list.csv). It is a different sample from load_california(): it keeps all 50 states and DC, and its treatment starts in 1989, not 1988. The case study fits it.
Using your own data
Any long panel works. Every model needs a DataFrame with unit, time, outcome, and 0/1 treatment-indicator columns (1 for the treated unit in post-treatment periods). Then:
for sar:
spatial_w: a Series/dict keyed by donor label (or an array in sorted donor order) measuring each donor’s exposure to the treated unit;
spatial_W: a labelled DataFrame (or array) of donor-to-donor weights;
optionally, covariate columns.
for cd: the exposed units (affected_units), distances (unit_distances) or a labeled exposure matrix (effect_matrix). Several treated units are allowed if they share the treatment start.
Alignment is by label wherever labels are given, so the order of your weights never has to match the panel’s — mismatched or missing donor labels raise immediately.