sensemakr
Assess whether an estimated treatment effect survives unobserved confounding. Quantify the minimum confounder strength needed to nullify or reverse a result, benchmarking against observed controls to guide verdicts.
Instructions
Sensitivity analysis for omitted variable bias (Cinelli & Hazlett 2020). Validation: certified parity evidence. Assumptions: Cinelli-Hazlett (2020) omitted-variable sensitivity in the partial-R-squared framework; the Robustness Value is the minimum partial R-squared a confounder needs with both treatment and outcome to nullify the estimate; Outcome is modeled by OLS of y on treat plus observed controls; benchmarking calibrates confounder strength relative to named observed controls; rv_q is the RV to change the point-estimate sign; rv_qa is the RV to lose significance at alpha. Pre-conditions: A DataFrame with outcome, treatment, and observed control columns; At least one control to anchor the benchmark comparison. Failure modes: Benchmark names a control not present in the controls list or data -> Pass benchmark names that are a subset of the controls actually included in the regression; Perfectly collinear controls make the partial-R-squared decomposition unstable -> Drop redundant collinear controls before computing the robustness value. Alternatives: sp.oster_bounds, sp.evalue, sp.unified_sensitivity. Typical minimum N: 50.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| y | Yes | Outcome column | |
| alpha | No | Significance level for confidence intervals and tests. | |
| treat | Yes | Treatment column of interest | |
| 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 |
| controls | Yes | Observed control variables | |
| 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. | |
| benchmark | No | Covariates to benchmark confounding strength against | |
| 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 | |||