1.4 Recording survival data
Each subject contributes a pair \((t_i, \delta _i)\): the observed time \(t_i = \min (T_i, C_i)\), the smaller of the survival time and the censoring time, and the event indicator \(\delta _i\), equal to \(1\) if the event was observed and \(0\) if the time is censored. Covariates are recorded alongside. In R the pair is combined into a survival object with Surv(time, event), printed with a + after each censored time. In the lung data the event indicator is coded \(2\) for death and \(1\) for censored, so Surv(time, status == 2) gives the right object.
Three data sets supplied with R’s survival package are used throughout the course: lung (Example 1.1.1); veteran, from a Veterans Administration trial of two chemotherapy treatments for lung cancer; and ovarian, a small trial of two treatments for ovarian cancer.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.