pretrends_equivalence
Tests that pre-treatment trends are demonstrably small using F and TOST equivalence tests, countering low-power false reassurance from standard pre-trend tests.
Instructions
Pre-trend equivalence tests (Liu, Wang & Xu 2024, the fect diagnostic panel). Reverses the usual null: instead of testing whether pre-period effects are zero, tests whether they are demonstrably small. Failing to reject 'no pre-trend' is often just low power (Roth 2022), so the conventional test alone overstates the evidence for parallel trends. Reports the joint F test alongside its non-central-F and TOST equivalence counterparts, where a small p-value is the reassuring outcome. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Known limitations: the TOST is computed only when tost_threshold is supplied; there is no universal outcome-scale default, so it is not invented. Pre-conditions: result carries influence functions so the joint pre-period covariance can be recovered; at least two pre-treatment periods (one is absorbed as the normalisation reference); more treated units than pre-periods. Alternatives: sp.pretrends_test, sp.pretrends_power, sp.honest_did.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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 result carrying an event study and influence functions (e.g. sp.callaway_santanna) | |
| 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. | |
| f_threshold | No | Dimensionless effect-size bound for the F equivalence test (fect's default) | |
| 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. | |
| tost_threshold | No | Equivalence bound in outcome units. Omitted by default because there is no defensible universal scale for 'negligible pre-trend'; the TOST is skipped when it is not supplied. fect uses 0.36 * residual SD. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||