weightsKM: Inverse probability of censoring weights

View source: R/weightsKM.R

weightsKMR Documentation

Inverse probability of censoring weights

Description

Computes inverse probability of censoring weights.

Usage

weightsKM(y, delta)

Arguments

y

numerical vector with right-censored follow-up times

delta

numerical vector, same length as y, 1 indicates an event while 0 indicates censoring

Details

Inverse probability of censoring weights are calculated by dividing the event indicator by the Kaplan-Meier estimator of the censoring time. This leads to zero weights for censored observations, while every uncensored event receives a weight larger than 1, representing several censored observations. In the redistribute-to-the-right approach, the last observation always receives a positive weight such that no weight will be lost. Further details can be found in Seipp et al. (2021).

Value

A data frame with 2 coloumns. The first column consists of usual inverse probability of censoring weights. For the second column, IPC weights modified in a redistribute-to-the-right approach are given.

References

Seipp, A., Uslar, V., Weyhe, D., Timmer, A., & Otto-Sobotka, F. (2021). Weighted expectile regression for right-censored data. Statistics in Medicine, 40(25), 5501-5520.

Examples

data(colcancer)
kw <- weightsKM(colcancer$logfollowup, colcancer$death)

dirttee documentation built on Sept. 14, 2022, 5:06 p.m.