cleverly.sensitivity.robustness_value#
- cleverly.sensitivity.robustness_value(result: TMLEResult, estimand: str = 'ate', *, rho: float = 1.0, level: float = 0.95, null_hypothesis: float = 0.0, nu2_estimator: str = 'auto') dict[str, Any][source]#
The confounding strength that would explain the effect away.
Returns
{"rv": ..., "rva": ...}: the value ofcf_y = cf_dat which the point estimate reachesnull_hypothesis, and the value at which its confidence bound does.Nonemeans no equal strength below one reaches the null. A confidence limit that already crosses the null hasrva = 0. This is the single most useful number in this module, because it requires no guess about how strong an unmeasured confounder might be – it reports the threshold and lets the reader judge whether it is plausible.The confidence bound is read off the estimate’s influence curve, so at a non-inferential status
"rva"takes the namespread_name()gives it,"rv_plugin_interval", and the mapping opens with"inference"naming the status, asSensitivityBounds.to_dict()does. Undernu2_estimator="plugin"no derivation gives the confidence bound’s standard error, so the mapping carries"nu2_estimator"and no confidence-limit value under any name (docs/roadmap.md F26).- Parameters:
- result
TMLEResult A fitted result.
- estimand
str Alias to report on.
- rho
float How adversarially the two sensitivity parameters are aligned.
- level
float Coverage level used for the confidence-limit value.
- null_hypothesis
float Value the strength is measured against.
- nu2_estimator{“auto”, “doubly_robust”, “plugin”}
Which estimator of the Riesz second moment to use.
- result
- Returns:
dictofstrtoAnyThe strength that moves the point estimate to the null, the one that moves the confidence limit there, and
max_bias. A threshold isNonewhen unreachable. At a non-inferential status, also the status under"inference". Under the plug-in estimator,"nu2_estimator"in place of the confidence-limit value.
- Raises:
ValueErrorIf
nu2_estimatoris not one ofNU2_ESTIMATORS, or if|rho|exceeds one, or iflevellies outside[0.5, 1).CapabilityErrorOn every refusal
sensitivity_elements()raises: a fit the rule table refuses, an estimand the bound does not cover, or a doubly robust estimate ofnu^2that is not positive.