parallel_trends_robustness
Run a robustness pipeline for difference-in-differences findings: test parallel-trends assumptions, assess sensitivity to pre-trend violations, and determine if conclusions hold.
Instructions
Run the full parallel-trends robustness pipeline on a DiD result. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| e | No | Relative time whose effect the sensitivity analysis targets. | |
| alpha | No | Significance level. | |
| delta | No | Hypothesised pre-trend violation passed to ``pretrends_power``. | |
| 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 |
| m_grid | No | Grid of violation magnitudes. Default: the ``honest_did`` default, multiples of the standard error at ``e``. | |
| result | Yes | A fitted DiD/event-study result carrying event-study estimates in ``result.model_info['event_study']`` (e.g. from ``sp.event_study``, ``sp.callaway_santanna``, ``sp.sun_abraham``). .. note:: If the result does not carry a pre-period covariance matrix in ``model_info['vcv_pre']``, the pre-trend test and power fall back to assuming the pre-period coefficients are mutually independent and warn loudly. ``sp.event_study`` computes the full cluster-robust covariance; pass ``expose_pre_vcov=True`` to it to have this pipeline use the correct covariance instead of the diagonal fallback. | |
| families | No | Restriction families. ``"SD"`` maps to ``honest_did``'s ``method='smoothness'`` (bounded second differences); ``"RM"`` maps to ``method='relative_magnitude'``. | |
| 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 | No | 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. | |
| 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||