Premed · Premed · Statistics Biostatistics

Lecture 23: Survival Analysis Introduction

Statistics / Biostatistics


Learning Objectives

By the end of this lecture, students will be able to:

  1. Define survival data and explain the concept of censoring
  2. Construct and interpret a Kaplan-Meier survival curve
  3. Compare survival curves using the log-rank test
  4. Describe the hazard function and hazard ratio
  5. Introduce the Cox proportional hazards model

Lecture Content

I. What Is Survival Analysis?

Survival analysis is a family of statistical methods for analyzing time-to-event data. The "event" can be death (the classic use in oncology), disease recurrence, hospital readmission, recovery, discharge, or any other well-defined event of interest. The key feature that distinguishes survival analysis from other methods is that not all subjects experience the event during the study period. Survival analysis methods are specifically designed to properly handle this incomplete follow-up.

II. Censoring

Censoring occurs when the exact time to event is unknown for some subjects. The most common type is right censoring, which happens when a subject has not experienced the event by the end of the study, when a subject is lost to follow-up (drops out), or when a subject experiences a competing event (such as dying of a different cause). Left censoring occurs when the event happened before the observation period began. Interval censoring occurs when the event happened within a known interval but the exact time is unknown.

Censored observations still contribute valuable information because we know the subject survived at least until the censoring time. Standard methods such as computing mean survival cannot simply ignore censored observations, as doing so would introduce systematic bias.

III. The Survival Function

The survival function S(t) = P(T > t) gives the probability of surviving beyond time t. It has several important properties: S(0) = 1 (everyone is alive or event-free at time 0), S(t) is non-increasing over time, and as t approaches infinity, S(t) approaches 0 (eventually everyone experiences the event). The median survival time is defined as the time at which S(t) = 0.50.

IV. Kaplan-Meier (Product-Limit) Estimator

The Kaplan-Meier estimator is the most widely used method to estimate the survival function from observed data. The procedure works as follows. All observed times (both events and censored) are ordered. At each event time t_j, three quantities are determined: d_j (the number of events at time t_j), n_j (the number of subjects at risk just before t_j), and the conditional survival probability (n_j - d_j) / n_j. The survival function at time t is the product of all conditional survival probabilities up to that time: S(t) = product of [(n_j - d_j) / n_j] for all t_j <= t.

Censored observations reduce the number at risk but do not count as events. The resulting KM curve is a step function that drops at each event time.

<image>A Kaplan-Meier survival curve for a hypothetical cancer treatment study. The x-axis shows time (months, 0 to 60), and the y-axis shows survival probability (0 to 1.0). The step-function curve descends over time. Small tick marks on the curve indicate censored observations. The median survival time is marked where the curve crosses S(t) = 0.50, with a horizontal dashed line at 0.50 and a vertical dashed line to the x-axis. A number-at-risk table is displayed below the x-axis showing the count of patients still being followed at 0, 12, 24, 36, 48, and 60 months.</image>

V. Confidence Intervals for KM Estimates

Greenwood's formula estimates the variance of S(t): Var[S(t)] = [S(t)]^2 sum of [d_j / (n_j (n_j - d_j))]. The 95% CI is S(t) +/- 1.96 * sqrt(Var[S(t)]). Log-transformed CIs are preferred to avoid values outside the [0, 1] range. Confidence bands widen over time as fewer subjects remain at risk, reflecting growing uncertainty.

VI. Comparing Survival Curves: The Log-Rank Test

The log-rank test is used to test whether two or more survival curves are different. The hypotheses are H0: survival functions are the same across groups versus H1: they differ. At each event time, the observed and expected number of events in each group are calculated, and the differences (O - E) are summed across all event times. The test statistic follows a chi-square distribution with df = (number of groups - 1).

The log-rank test gives equal weight to all time points. The Wilcoxon (Breslow) test gives more weight to earlier time points when more subjects are at risk, while the Tarone-Ware test offers a compromise between the two. A limitation of the log-rank test is that it does not adjust for covariates.

<image>Two Kaplan-Meier curves compared on the same plot. Curve 1 (solid line, blue): Treatment group. Curve 2 (dashed line, red): Control group. The treatment group shows higher survival throughout. Both curves have tick marks for censored observations and shaded 95% confidence bands. The log-rank test statistic and p-value are displayed in the corner (e.g., chi-square = 6.8, p = 0.009). A number-at-risk table below shows counts for both groups at regular time intervals.</image>

VII. Hazard Function and Hazard Ratio

The hazard function h(t) represents the instantaneous rate of the event at time t, given survival to that point: h(t) = lim (delta->0) P(t <= T < t + delta | T >= t) / delta. The hazard is not a probability (it can exceed 1) but rather represents a rate.

The hazard ratio (HR) is the ratio of hazard functions between two groups: HR = h_treatment(t) / h_control(t). An HR of 1 indicates no difference in event rates. An HR less than 1 indicates the treatment group has a lower hazard (better survival), while an HR greater than 1 indicates the treatment group has a higher hazard (worse survival). The HR is the most commonly reported effect measure in survival analysis.

VIII. Cox Proportional Hazards Model

The Cox proportional hazards model relates covariates to the hazard function: h(t | X) = h_0(t) exp(beta_1X_1 + beta_2X_2 + ... + beta_pX_p). Here h_0(t) is the baseline hazard function, which is left unspecified, making this a "semi-parametric" model. Each exp(beta_j) represents the hazard ratio for a one-unit increase in X_j, adjusted for all other covariates.

The proportional hazards assumption requires that the HR is constant over time. This assumption can be checked with Schoenfeld residuals or log(-log(S(t))) plots. If violated, stratified Cox models or time-varying coefficients can be used. The Cox model allows adjustment for multiple covariates such as age, sex, stage, and treatment simultaneously.

For example, an HR for treatment of 0.65 (95% CI: 0.48-0.88) means the treatment reduces the hazard of death by 35% compared to control, adjusted for age and stage.

<image>A figure explaining the Cox proportional hazards model. Panel A: Two parallel hazard curves (treatment and control) illustrating the proportional hazards assumption -- the ratio between them is constant over time. Panel B: A forest plot showing hazard ratios from a Cox model with multiple covariates (treatment, age > 65, male sex, stage III-IV). Each row has a point estimate (square) and 95% CI (horizontal line). The vertical line at HR = 1.0 represents no effect. Covariates with CIs excluding 1.0 are highlighted as significant.</image>

IX. Practical Considerations

When reporting survival analyses, always include the median survival time with its confidence interval and survival estimates at key time points (such as 1-year and 5-year survival). Number-at-risk tables should appear below Kaplan-Meier curves, and hazard ratios should be reported with confidence intervals. Caution should be exercised when interpreting survival curves in regions where the number at risk becomes very small, as uncertainty is wide. When the proportional hazards assumption is violated, landmark analysis or restricted mean survival time (RMST) can serve as useful alternatives to the hazard ratio.


Lecture 23: Survival Analysis Introduction — figure 1
Lecture 23: Survival Analysis Introduction — figure 2
Lecture 23: Survival Analysis Introduction — figure 3

Read this lecture as Markdown