rd_honest
Compute honest confidence intervals for sharp regression discontinuity with provable finite-sample coverage, avoiding bandwidth-selection bias by bounding the second derivative of E[Y|X].
Instructions
Armstrong-Kolesar (2018) honest confidence intervals for sharp regression discontinuity -- the only RD inference procedure with provable finite-sample coverage without bandwidth-selection bias. M is the upper bound on the second derivative of E[Y|X] near the cutoff; smaller M means tighter CIs but riskier coverage if the true curvature is larger. Validation: certified parity evidence. Assumptions: E[Y|X] has bounded second derivative |E[Y|X]''| <= M near c; Continuity of potential outcomes at c (Hahn-Todd-van der Klaauw 2001); No manipulation of x at c (run sp.mccrary_test alongside). Pre-conditions: x is continuous with support on both sides of c; Sample mass within the optimal bandwidth on each side; User-supplied M (or willingness to estimate it from data). Failure modes: M estimated from data and effective sample tiny -> Pass an explicit M based on theory or sensitivity analysis (M_grid in Armstrong-Kolesar 2018 Section 4); Honest CI much wider than rdrobust CI -> rd_honest is honest by construction (covers under any |f''| <= M); rdrobust trades coverage for precision. Reporting both is recommended; McCrary density test p < 0.05 -> Use donut-hole RD (donut=) or partia...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| M | No | Upper bound on |E[Y|X]''| near c; if None, estimated from data | |
| c | No | Cutoff value | |
| h | No | Bandwidth; auto-selected by opt_criterion if None | |
| x | Yes | Running variable | |
| y | Yes | Outcome variable | |
| 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 |
| kernel | No | Local-linear kernel | triangular |
| sclass | No | Smoothness class for the bound M: 'H' (Holder, RDHonest's default -- f' is M-Lipschitz) or 'T' (Taylor) | H |
| 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. | |
| 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. | |
| opt_criterion | No | Bandwidth optimization criterion | mse |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||