Configuring R
Functions from these packages will be used throughout this document:
Here are some R settings I use in this document:
In many health sciences applications, binary outcomes are incompletely observed. For example, if we are studying whether cancer patients experience a relapse after an initial remission, we may not be able to follow patients to the end of their lives; instead, we may only know whether each patient has relapsed before the end of the study. If a patient has not relapsed by that point, we might not know if they will relapse at some other date or if they will stay cancer-free for the rest of their lives. Their recurrence status at end-of-life is missing data. If some study participants withdraw from a study before the scheduled end date, additional missing data arise. Standard logistic regression cannot handle such right-censored data directly without introducing bias.
However, these outcome observations are not entirely missing. We know that those patients stayed relapse-free at least until the time point when they were last observed. If we also know the time-to-event for participants who experienced events while under study, we can analyze the time-to-event-or-study-exit alongside an event indicator using survival analysis. The survival analysis framework provides the foundation for the topics covered in this module.
Why censoring matters
Example 1 (Six patients followed for relapse) Suppose a study follows six cancer patients in remission for up to 12 months, and we want to estimate the 12-month relapse risk, \(1 - {\operatorname{S}\mathopen{}\left(12\right)\mathclose{}}\), where \(\operatorname{S}\) is the survival function of time to relapse (in months). Table 1 shows each patient’s observed follow-up time and event indicator (1 = relapse observed; 0 = right-censored).
Naive approach 1: treat censored patients as event-free. Counting patients B and D as relapse-free gives \(2/6 \approx 0.333\). This approach can only underestimate the risk, because any relapses that B or D experienced after withdrawal are counted as non-relapses.
Naive approach 2: drop patients with unknown status. Discarding patients B and D gives \(2/4 = 0.5\). This approach throws away the information that B stayed relapse-free for 5 months and D for 9 months, so in this example it overestimates the risk.
Using the censored observations. The Kaplan-Meier estimator keeps each censored patient in the risk set until their censoring time [1, Ch. 2]. Relapses occur at 3 months (6 patients at risk) and at 7 months (4 patients at risk: C, D, E, F), so
\[
\begin{aligned}
{\mathop{\hat{\operatorname{S}}}\nolimits_{\text{KM}}\mathopen{}\left(12\right)\mathclose{}}
&= \mathopen{}\left(1 - \frac{1}{6}\right)\mathclose{} \cdot \mathopen{}\left(1 - \frac{1}{4}\right)\mathclose{}
&& \text{(product over the event times 3 and 7)}
\\
&= \frac{5}{6} \cdot \frac{3}{4}
&& \text{(subtract inside each factor)}
\\
&= \frac{15}{24}
&& \text{(multiply numerators and denominators)}
\\
&= 0.625
&& \text{(divide)}
\end{aligned}
\]
and the estimated 12-month risk is \(1 - 0.625 = 0.375\). That estimate lies between the two naive estimates, and it is valid under non-informative censoring [1, Ch. 1].
Back to top