Skip to contents

Computes propensity weights from the two rule strata (left and right of the ODA cutpoint) using stored training confusion counts. Implements the Yarnold/Linden stratum-weight formula: $$w = n_s \times \Pr(Z=z) / n_{z,s}$$

Usage

oda_propensity_weights(fit, adjusted = TRUE)

Arguments

fit

An oda_fit object with ok == TRUE.

adjusted

Logical; if TRUE (default), applies a one-hypothetical-misclassification adjustment when a class is absent from a rule stratum.

Value

Data frame with one row per (stratum, class) combination: stratum_id (1L = rule predicts class 0, 2L = rule predicts class 1), predicted_class (integer), class (character), class_n (integer), stratum_n (integer), marginal_class_n (integer), marginal_total_n (integer), marginal_class_probability (numeric), propensity_weight (numeric), undefined_empirical (logical), adjusted (logical), adjusted_propensity_weight (numeric), model_family ("oda").

Details

Currently implemented for binary (C=2) ODA fits only.

The fitted model must have been trained with the treatment/exposure/group membership as the class variable (y), not a clinical outcome. The user is responsible for this labeling decision.