evalue
Calculate the E-value to quantify how much unmeasured confounding would be needed to explain away an observed association, helping assess the robustness of causal estimates.
Instructions
Compute the E-value for sensitivity to unmeasured confounding. Validation: certified parity evidence. Assumptions: VanderWeele-Ding (2017) E-value: quantifies the minimum confounder-exposure and confounder-outcome risk ratios that could explain away an observed association; The estimate is expressed (or convertible) to a risk-ratio scale; OR and HR map to RR via the rare-outcome approximation (rare=True) or the Ding-VanderWeele common-outcome conversion (rare=False, default); MD/SMD/OLS use exp(0.91*d); The E-value bounds joint confounding but assumes no other bias (selection, measurement, model misspecification). Pre-conditions: A point estimate on a supported scale (RR/OR/HR/MD/SMD/OLS); for an exact risk-difference E-value call sp.evalue_rd with the 2x2 cell counts; Either an SE or an explicit CI to obtain the CI E-value (OLS also needs the outcome sd). Failure modes: Ratio estimate <= 0 supplied for measure RR/OR/HR, or risk difference outside [-1, 1] -> Pass a positive ratio for RR/OR/HR or a difference within [-1, 1], matching the measure argument; Reported E-value near 1.0, i.e. trivially weak confounding overturns the result -> Treat the finding as fragile to unmeasured co...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ci | No | Confidence interval on the ``measure`` scale. Takes precedence over ``se`` for ratio measures. | |
| sd | No | Outcome standard deviation, required for ``measure='OLS'`` to standardise the coefficient. | |
| se | No | Standard error of ``estimate``. Required for ``MD`` / ``OLS`` to obtain a confidence-interval E-value; for ratio measures it is used (with ``alpha``) to build a CI when ``ci`` is not given. | |
| rare | No | For ``OR`` / ``HR`` only: whether the rare-outcome approximation applies. ``rare=True`` treats OR/HR ~ RR; ``rare=False`` (the default) uses the exact common-outcome conversion to the RR scale (``sqrt(OR)`` for OR; the Ding-VanderWeele formula for HR). | |
| true | No | Reference value the confounding would have to move the estimate to. Defaults to the null: 1 for ratio measures, 0 for difference measures. A non-null ``true`` gives a "non-null" E-value. | |
| alpha | No | Significance level used to build a CI from ``se`` when ``ci`` is not supplied (ratio measures). | |
| delta | No | Contrast size for ``OLS`` (E-value for a ``delta``-unit change in the exposure). | |
| 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 |
| measure | No | One of ``'RR'``, ``'OR'``, ``'HR'``, ``'MD'``, ``'SMD'``, ``'OLS'``, ``'DIFF'``, ``'RD'``. | RR |
| estimate | Yes | Point estimate on the scale given by ``measure``: - ``'RR'`` risk ratio, ``'OR'`` odds ratio, ``'HR'`` hazard ratio (all must be > 0); - ``'MD'`` / ``'SMD'`` standardised mean difference; - ``'OLS'`` raw linear-regression coefficient (supply ``sd``); - ``'DIFF'`` / ``'RD'`` risk difference (approximate scalar path; | |
| 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 | No | 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. | |
| rare_outcome | No | Deprecated alias for ``rare`` (kept for backwards compatibility). | |
| data_sample_n | No | Optional uniform random subsample size (seed=0, deterministic) — useful on huge panels. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||