pretrends_power
Compute the power of pre-trend tests against a hypothesized violation, showing how likely the test detects a given trend. Use to assess the credibility of parallel-trends evidence.
Instructions
Power of the pre-trend test against a hypothesised violation. Validation: certified parity evidence.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| test | No | Which pre-test the power refers to. ``"individual"`` is the practice Roth (2022) analyses and the one his ``pretrends`` R package implements: the analyst eyeballs the event-study plot and calls the pre-trends into question if *any* pre-period coefficient is individually significant. Power is then one minus the probability that every pre-period coefficient falls inside its own ``+/- z_{1-alpha/2} * SE`` band, integrated over the joint normal with mean ``delta`` -- a multivariate-normal rectangle probability. ``"joint"`` is the power of the joint Wald test that all pre-period coefficients are zero, ``chi2(K)`` with non-centrality ``delta' Sigma^-1 delta``. Reported by :func:`pretrends_test`, and a strictly different quantity -- not a tighter or looser version of the same one. The two are not even comparable at face value: the joint test has size exactly ``alpha``, while the coefficient-by-coefficient test rejects with probability above ``alpha`` under the null because each of the K coefficients gets its own ``alpha``-level look. Which comes out more powerful against a given trend depends on the design. ``power_joint`` is always reported alongside, so both are available from one call. .. versionchanged:: 1.21.0 The default moved from ``"joint"`` to ``"individual"`` so the number matches Roth's ``pretrends`` package. This changes the returned ``power`` for existing calls -- see MIGRATION.md. Pass ``test="joint"`` to recover the previous behaviour. | individual |
| alpha | No | Significance level of the pre-trend test. | |
| delta | No | Hypothesised trend violation in the pre-period (length = number of pre-periods). Default: linear trend ``delta[k] = (k+1) * min(|SE|)`` -- a violation equal to one SE at the furthest lag, declining linearly to near-zero. | |
| 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 | Event-study result with pre-treatment estimates and SEs. | |
| 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 | |||