staggered_sa
Estimates Sun-Abraham causal effects with design-based inference when treatment timing is randomly assigned, using only the last-treated cohort as control.
Instructions
Sun-Abraham's estimand with design-based inference (Roth & Sant'Anna 2023). Identical to sp.staggered_cs except that only the last-treated cohort serves as control, which is what Sun & Abraham's interaction-weighted estimator does. Inference identifies off random adoption timing, not parallel trends. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Do NOT use when: adoption timing was not randomised -- use sp.sun_abraham, 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_cs, sp.sun_abraham. 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 | |||