double_negative_control
Estimates the average treatment effect in the presence of unmeasured confounding by using a negative-control exposure and negative-control outcome as proxies for the hidden confounder.
Instructions
Double negative control estimator (Miao et al. 2018; Shi et al. 2020). Assumptions: Two valid proxies of the hidden confounder U: a treatment-confounding proxy and an outcome-confounding proxy; Negative-control exposure has no causal effect on Y given (U, X) -- exclusion restriction on the NCE arm; Negative-control outcome is not caused by the treatment D given (U, X). Pre-conditions: data has columns for outcome, treatment, a negative-control exposure (nce) and a negative-control outcome (nco); nce and nco share the unmeasured confounder but satisfy the respective exclusion restrictions. Failure modes: Weak proxy: NCE barely correlated with NCO (weak-instrument analogue) -- unstable ATE -> Use stronger proxies or the doubly-robust regression-based estimator instead of just-identified 2SLS; A proxy violates its exclusion restriction (direct effect on Y or caused by D) -- biased ATE -> Validate the negative controls separately or fall back to a sensitivity analysis. Alternatives: sp.proximal, sp.proximal_regression, sp.frontdoor. Typical minimum N: 200.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| y | Yes | Outcome variable column name or outcome array. | |
| nce | Yes | nce parameter (str). | |
| nco | Yes | nco parameter (str). | |
| alpha | No | Significance level for confidence intervals and tests. | |
| treat | Yes | Treatment indicator or first-treatment-period column. | |
| 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 |
| 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 | Covariate matrix, DataFrame, or column names. | |
| 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 | |||