SpillPanel
data.SpillPanel(
df,
spatial_w,
spatial_W,
outcome,
unitid,
time,
treat,
covariates,
treated_unit,
treatment_time,
description,
column_map=dict(),
)
A bundled case study, ready to feed :class:scspill.SCSPILLConfig.
Attributes
| df |
pd.DataFrame |
Long panel with a 0/1 treated indicator column (1 for the treated unit in post-treatment periods). |
| spatial_w |
pd.Series |
Treated-to-control exposure weights, indexed by donor unit label. Raw (unnormalized); the estimator scales it to sum to one. |
| spatial_W |
pd.DataFrame |
Control-to-control spatial weights, indexed and columned by donor unit label. Raw (unnormalized); the estimator row-normalizes it. |
| outcome, unitid, time, treat |
str |
Column names in df. |
| covariates |
tuple of str |
Covariate column names in df. |
| treated_unit |
str |
Label of the treated unit. |
| treatment_time |
int |
First treated period. |
| description |
str |
One-paragraph provenance note. |
| column_map |
dict |
Mapping from original CSV headers to the column names in df (empty when no renaming was applied). |
Methods
| config_kwargs |
Keyword arguments ready to splat into :class:scspill.SCSPILLConfig. |
config_kwargs
data.SpillPanel.config_kwargs()
Keyword arguments ready to splat into :class:scspill.SCSPILLConfig.
Returns
|
dict |
df, outcome, treat, unitid, time, spatial_w, spatial_W, and covariates. |
Examples
from scspill import SCSPILL
from scspill.data import load_california
panel = load_california()
result = SCSPILL({**panel.config_kwargs(), "seed": 1}).fit()