sequential_sdid
Estimates causal effects in staggered-adoption panels by synthesizing control units from not-yet-treated cohorts, avoiding negative weights and overlap failures.
Instructions
Sequential Synthetic DID for staggered-adoption panels (Arkhangelsky & Samkov 2024): processes cohorts in adoption order using not-yet-treated donors, avoiding TWFE negative weights and SDID overlap failures. Assumptions: Parallel trends in the absence of treatment, after the synthetic/DiD weighting; No anticipation and no interference between units (SUTVA); The control pool's outcome process is stable around the intervention. Pre-conditions: Panel with treated and control units and a clear treatment date; Pre-treatment periods available to assess comparability of trends. Failure modes: Weighted pre-treatment trends still diverge between treated and synthetic control -> Inspect the unit/time weights and pre-trend fit; consider event-study DiD with honest bounds. Alternatives: sp.synth, sp.augsynth, sp.callaway_santanna, sp.gardner_did. Typical minimum N: 15.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| time | Yes | Time period column. | |
| unit | Yes | Unit identifier column. | |
| cohort | Yes | First-treated period column; never-treated = 0 | |
| 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 |
| n_reps | No | Number of reps. | |
| outcome | Yes | Outcome variable column name or outcome array. | |
| 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. | |
| se_method | No | se_method parameter (str). | placebo |
| data_columns | No | Optional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads. | |
| data_sample_n | No | Optional uniform random subsample size (seed=0, deterministic) — useful on huge panels. | |
| cohort_weights | No | cohort_weights parameter (str). | size |
| never_treated_value | No | never_treated_value parameter. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||