cleverly.sensitivity.missingness_tilt#
- cleverly.sensitivity.missingness_tilt(result: TMLEResult, gamma: Sequence[float] | None = None, *, estimands: Sequence[str] | None = None, arm_gamma: Mapping[Any, float] | None = None) Any[source]#
Estimate under a range of departures from missingness-at-random.
Returns a tidy frame with one row per
(gamma, estimand), and onegamma[<level>]column per arm giving the tilt that arm received – equal togammathroughout unlessarm_gamma=says otherwise. Only defined for a fit that supplieddelta; without missing outcomes there is nothing to tilt.Refuses first by
fit_wide_tilt_refusal, which the capability rows read too. It refuses a longitudinal result, a missing-outcomeNaturalCourseMeanfit, a fit with no missing outcome, a continuous dose, an incremental fit, and a fit that reports no arm-indexed mean or linear contrast, such as a regime, an MSM, or a ratio-only fit. The natural-course target is not indexed by arm, so it needs a natural-course sensitivity parameter that is not implemented.A fit whose inference status supplies no inference, such as a selector-path
CTMLEfit, receivesplugin_std_err,plugin_interval_lowerandplugin_interval_upperin place ofstd_err,ci_lowerandci_upper. The point-estimate curve is unchanged, and no column of it claims coverage this package does not supply.- Parameters:
- result
TMLEResult A fitted result whose outcomes are missing for some rows.
- gammasequence
offloatorNone Tilt values on the logit scale.
NoneusesDEFAULT_GAMMA_GRID.- estimandssequence
ofstrorNone Restrict to a subset. Ratios are excluded automatically: tilting changes the counterfactual means, and re-deriving a ratio’s log-scale influence curve under the tilt would misrepresent the uncertainty.
- arm_gamma
mappingofleveltofloat,orNone One finite multiplier per arm, keyed by the treatment level as the caller wrote it, so that the tilt at arm
aisarm_gamma[a] * gamma.None– the default, and what a two-armed fit has always done – tilts every arm by the samegamma. Every arm must appear; see this module’s docstring for why the choice is not made silently. Thegammacolumn of the returned frame is then the magnitude the direction is scaled by rather than the tilt any one arm received, which is what thegamma[<level>]columns beside it report.
- result
- Returns:
dataframeOne row per
(gamma, estimand), with onegamma[<level>]column per arm giving the tilt that arm received.