Censoring is treated as its own treatment type, distinct from binary, multi-category, and continuous treatments. Weights are estimated only for the units still under observation, and are those that make the covariate distribution of the uncensored units match that of the full at-risk sample. Formally, for \(e(X) = P(C = 1 | X)\), the weights are \((1 - e(X))^{-1}\) for units with \(C = 0\) and exactly 0 for units with \(C = 1\).
Because only one group is weighted, the estimation problem is smaller and better conditioned than the corresponding binary-treatment problem, which would additionally solve for weights among the censored units. This matters most when few units are censored.
Because censored units receive a weight of exactly 0, they contribute nothing to a weighted outcome model, and glm_weightit(), lm_weightit(), multinom_weightit(), ordinal_weightit(), and coxph_weightit() all tolerate missing values in the model variables for those units. This is what makes it possible to fit an outcome model whose outcome is unobserved after censoring. See the Censoring weights (IPCW) section of weightit() for details.
No estimand or focal argument applies to censoring models; supplying one produces a warning and it is ignored. subclass cannot be used. Not all methods support censoring weights; see the treat_type component of .weightit_methods to check.
The right side of the formula may be empty, as in .cens(C) ~ 1, requesting a marginal censoring model in which censoring is assumed independent of the covariates. The weights are then \(1/P(C = 0)\) for the units still under observation and 0 for the censored units, whatever method is supplied; see Empty model formulas in Details at weightit(). Nothing else changes, so a marginal censoring model still composes with by, stabilize, M-estimation, and, in weightitMSM(), the risk sets and the missing values permitted after censoring.
Tagging is the only way to request censoring weights from these interfaces; an untagged 0/1 vector is treated as an ordinary binary treatment.