staggered_cs
Estimates causal effects with Callaway-Sant'Anna weights when treatment timing is randomly assigned, using design-based inference for valid standard errors.
Instructions
Callaway-Sant'Anna's estimand with design-based inference (Roth & Sant'Anna 2023). Same weights as sp.callaway_santanna -- every not-yet-treated cohort is a control -- but the standard error comes from random adoption timing rather than parallel trends. Use when timing was randomised and you want the familiar CS estimand; use sp.callaway_santanna when it was not. Units already treated in the first period are dropped, since ATT(g,t) is not identified for them. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Do NOT use when: adoption timing was not randomised -- use sp.callaway_santanna, whose inference rests on parallel trends instead. Assumptions: treatment timing is randomly assigned; balanced panel. Pre-conditions: balanced panel with at least two cohorts. Alternatives: sp.staggered_rollout, sp.staggered_sa, sp.callaway_santanna. Typical minimum N: 50.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| g | Yes | First-treatment period; never-treated may be 0, NaN or inf | |
| i | Yes | Unit identifier | |
| t | Yes | Time period | |
| y | Yes | Outcome variable column name or outcome array. | |
| alpha | No | Significance level for confidence intervals and tests. | |
| detail | No | Payload depth: 'minimal' (~150 tokens) for sub-step calls where only the point estimate is needed; 'standard' (~1K tokens) for diagnostics + coefficient table; 'agent' (~2K tokens, default) adds violations / next_steps / suggested_functions so the LLM can plan its next call without another round-trip. | agent |
| fisher | No | fisher parameter (bool). | |
| se_type | No | Conservative bound, or the adjusted SE R staggered prints | neyman |
| estimand | No | Weighting scheme, as in sp.staggered_rollout | simple |
| n_fisher | No | Number of fisher. | |
| as_handle | No | If true, cache the fitted result on the server and return result_id + result_uri alongside the JSON payload so a subsequent tools/call can chain without re-running. | |
| data_path | Yes | Absolute path or URL to a data file. Supported: .csv / .tsv / .txt (delimited), .parquet / .pq, .feather / .arrow, .xlsx / .xls, .dta (Stata), .json / .jsonl. Schemes: file://, s3://, gs://, https://. | |
| result_id | No | Optional handle to a previously-fitted result (returned by an earlier call when as_handle=true). Tools that operate on a fitted object accept this in place of re-supplying data_path + columns. | |
| event_time | No | event_time parameter (float or list). | |
| data_columns | No | Optional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads. | |
| random_state | No | Random seed or RandomState for reproducible stochastic steps. | |
| data_sample_n | No | Optional uniform random subsample size (seed=0, deterministic) — useful on huge panels. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||