pretrends_test
Test whether pre-treatment event-study coefficients jointly differ from zero, validating the parallel-trends assumption in difference-in-differences designs.
Instructions
Joint Wald test of pre-treatment ATTs (or event-study leads) against zero -- the canonical sanity check for the parallel-trends assumption in DiD designs. Failing to reject is necessary but not sufficient evidence for parallel trends; always pair with sp.honest_did / sp.sensitivity_rr for design-robust inference. Assumptions: The test asks whether the pre-period ATTs jointly differ from zero; Failing to reject is consistent with parallel trends but does NOT prove it (low power problem -- Roth 2022). Pre-conditions: result has at least one pre-treatment period coefficient and its variance; covariance between pre-period coefficients is available (cluster-robust SE recommended). Failure modes: Single pre-period (no pretrends to test) -> Pretrends test needs >= 2 pre-treatment periods; widen the panel or drop the test; High-power study rejects but visual pretrends look flat -> Use sp.honest_did + sp.sensitivity_rr to bound the bias; reporting both is standard practice. Alternatives: sp.sensitivity_rr, sp.honest_did, sp.event_study. Typical minimum N: 50.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Test statistic | wald |
| 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 |
| result | Yes | DiD or event-study result with pre-period coefficients | |
| 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 | |||