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 one gamma[<level>] column per arm giving the tilt that arm received – equal to gamma throughout unless arm_gamma= says otherwise. Only defined for a fit that supplied delta; 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-outcome NaturalCourseMean fit, 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 CTMLE fit, receives plugin_std_err, plugin_interval_lower and plugin_interval_upper in place of std_err, ci_lower and ci_upper. The point-estimate curve is unchanged, and no column of it claims coverage this package does not supply.

Parameters:
resultTMLEResult

A fitted result whose outcomes are missing for some rows.

gammasequence of float or None

Tilt values on the logit scale. None uses DEFAULT_GAMMA_GRID.

estimandssequence of str or None

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_gammamapping of level to float, or None

One finite multiplier per arm, keyed by the treatment level as the caller wrote it, so that the tilt at arm a is arm_gamma[a] * gamma. None – the default, and what a two-armed fit has always done – tilts every arm by the same gamma. Every arm must appear; see this module’s docstring for why the choice is not made silently. The gamma column of the returned frame is then the magnitude the direction is scaled by rather than the tilt any one arm received, which is what the gamma[<level>] columns beside it report.

Returns:
dataframe

One row per (gamma, estimand), with one gamma[<level>] column per arm giving the tilt that arm received.