proximal
Estimates causal effect of a treatment on an outcome despite unmeasured confounders, using two proxies and linear 2SLS on an outcome bridge.
Instructions
Proximal Causal Inference via linear 2SLS on the outcome bridge. Identifies ATE with unmeasured confounding using two proxy variables: a treatment-side Z (instrument for W) and an outcome-side W (endogenous bridge regressor). Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Assumptions: Existence of an outcome bridge function h(w, a, x) that recovers E[Y(a) | U, X]; Z and W are conditionally independent given U and (A, X); Z perp Y | U, A, X (exclusion on Z). Pre-conditions: at least one treatment-side proxy Z (independent of outcome given U, X); at least one outcome-side proxy W (independent of treatment given U, X); proxy_z and proxy_w measure the same unmeasured confounder U from different angles. Failure modes: First-stage (Z -> W) too weak -> Try richer Z or more proxies; without first-stage strength the bridge is underidentified; Proxies collapse to nearly-constant -> Proxy variation insufficient -- redesign measurement or fall back to sensitivity (sp.sensemakr); Estimate highly sensitive to bridge specification -> Report multiple bridge families; compare with sp.negative_control_outcome / _exposure. Alternatives: sp.neg...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| y | Yes | Outcome | |
| treat | Yes | Treatment | |
| bridge | No | Bridge function family | linear |
| 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 |
| n_boot | No | Bootstrap SE replications | |
| proxy_w | Yes | Outcome-side proxies (endogenous) | |
| proxy_z | Yes | Treatment-side proxies (instruments for W) | |
| 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. | |
| covariates | No | Baseline covariates | |
| 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 | |||