rdplot
Create a regression-discontinuity plot with binned scatter and polynomial fits on both sides of a cutoff to visually inspect treatment effects and discontinuity at the threshold.
Instructions
RD plot: binned scatter with polynomial fit on each side of the cutoff.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| c | No | Cutoff. | |
| h | No | Bandwidth to display. | |
| p | No | Polynomial order for the fitted curve. | |
| x | Yes | Outcome and running variable names. | |
| y | Yes | Outcome and running variable names. | |
| ax | No | ax parameter (Optional[Any]). | |
| covs | No | Covariates to partial out before binning and plotting. | |
| donut | No | If > 0, shades the donut region |x - c| <= donut. | |
| nbins | No | Bins per side. If None, uses data-driven selection via binselect. | |
| title | No | title parameter (Optional[str]). | |
| 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 | Kernel for the fitted curve. | triangular |
| figsize | No | figsize parameter (Tuple[float, float]). | |
| hide_ci | No | If True, suppress CI bands entirely. | |
| scatter | No | Show binned scatter points. | |
| show_bw | No | If True, shades the bandwidth window. | |
| weights | No | Column name for observation weights in polynomial fitting. | |
| x_label | No | x_label parameter (Optional[str]). | |
| y_label | No | y_label parameter (Optional[str]). | |
| ci_level | No | Confidence level for pointwise CI bands. | |
| shade_ci | No | Show confidence interval bands around the polynomial fit. | |
| 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. | |
| binselect | No | Bin selection method (when nbins=None): - 'es' : IMSE-optimal evenly spaced - 'espr' : IMSE-optimal evenly spaced (mimicking variance) - 'qs' : IMSE-optimal quantile-spaced - 'qspr' : IMSE-optimal quantile-spaced (mimicking variance) - 'esmv' : IMSE-optimal evenly spaced with variance mimicking (default) - 'qsmv' : IMSE-optimal quantile-spaced with variance mimicking | esmv |
| 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||