Module S08

Survival Analysis

Analyzing time until events occur

Time-to-Event Analysis

  • 01

    Survival Function

    Probability of surviving past time t

  • 02

    Censoring

    Incomplete observation of event time

  • 03

    Kaplan-Meier

    Non-parametric survival estimation

  • 04

    Cox Regression

    Testing predictors of survival

01

What Is Survival Analysis?

Time Until Event

Questions Survival Analysis Answers:
• How long do cancer patients survive after diagnosis?
• When do customers churn after signing up?
• How long until machine parts fail?
• When do employees leave after hiring?
All these ask: How long until an event happens? The 'event' can be death, failure, churn, relapse - any well-defined endpoint.

Survival analysis studies the time until an event of interest occurs. Despite the name 'survival,' the event doesn't have to be death - it's any transition from one state to another.

Why Not Just Use Mean Time?

Problem 1: Censoring
The study ends but some patients are still alive. We don't know their full survival time - only that it's AT LEAST as long as follow-up.
Problem 2: Skewed Time Data
Time data is usually right-skewed. Mean is misleading. Median survival is better but still incomplete.
Solution: Survival Analysis
Special methods that handle censoring and estimate the full survival curve, not just a single number.

Standard statistics (mean, regression) can't handle censored observations. Survival analysis uses all available information, including partial information from subjects who didn't experience the event.

Terminology

Event (Failure)
The outcome of interest: death, relapse, churn, etc.
Survival Time
Time from origin (diagnosis, start) until event or censoring
Censoring
Event not observed: lost to follow-up, study ends, competing event
Survival Function S(t)
Probability of surviving beyond time t

Survival analysis has its own vocabulary. The 'event' is what you're tracking. 'Censored' observations are those where we don't observe the event - we only know survival time is greater than observed follow-up.

02

Censoring

Kinds of Censoring

Right Censoring (Most Common)
Event hasn't happened yet when observation ends. We know T > observed time.
Left Censoring
Event already happened before observation began. We know T < observed time.
Interval Censoring
Event happened between two observation times. We know a < T < b.

Right censoring is most common: the study ends or patient is lost to follow-up before the event. We know they survived at least that long, but not exactly how long.

Seeing Censoring

SubjectTime (months)AEventBCensoredCD
Filled circle = event occurred; Open circle = censored (still alive/lost)

Each horizontal line represents one subject. Lines end at either an event (filled circle) or censoring (open circle). Censored subjects contribute information up to their last observation.

Non-informative Censoring

Key Assumption
Censoring must be non-informative: the reason for censoring is unrelated to the likelihood of the event.
OK: Patient moves away (unrelated to health)
OK: Study ends at planned date
PROBLEM: Patient drops out because too sick for appointments
PROBLEM: Healthy patients stop coming because they feel fine

If censoring is related to prognosis, survival estimates are biased. Patients censored because they're too sick (or too healthy) violate this assumption.

03

Kaplan-Meier Curves

Survival Function Estimate

01.00.5TimeS(t)
Stair-step curve drops at each event. Tick marks = censored observations.

The Kaplan-Meier curve shows estimated survival probability over time. It starts at 1.0 (everyone alive) and steps down at each event. Censored observations are marked but don't cause drops.

Interpreting K-M Curves

Median Survival: Time when curve crosses 0.5 (50% survival)
5-Year Survival: Height of curve at t = 5 years
Confidence Band: Uncertainty around the curve (wider at later times)
Comparing Groups: Non-overlapping curves suggest different survival

K-M curves let you read off survival probability at any time point. Median survival is when 50% have experienced the event. Compare groups by plotting multiple curves.

Comparing Groups

DrugPlacebo
Log-Rank Test: χ² = 8.4, p = .004
Drug group has significantly better survival

The log-rank test compares survival curves between groups. It tests H₀: the survival functions are the same. Significant p-value means the curves differ more than expected by chance.

04

Cox Proportional Hazards

Regression for Survival

Cox Regression
Like regular regression but for time-to-event outcomes. Tests how predictors affect the hazard (instantaneous risk of event).
Model: h(t) = h₀(t) × exp(β₁X₁ + β₂X₂ + ...)

• h(t) = hazard at time t
• h₀(t) = baseline hazard
• exp(β) = hazard ratio

Cox regression models how covariates affect the hazard function. It's 'semi-parametric' - no assumption about the baseline hazard shape, but assumes proportional hazards.

The Key Output

HR < 1
Protective factor - reduces hazard (better survival)
HR = 1
No effect on hazard
HR > 1
Risk factor - increases hazard (worse survival)
Example: HR = 2.0 for smoking means smokers have 2× the hazard (risk) of death at any time point.

The hazard ratio (HR) is the key output. HR = 2.0 means twice the risk of event. HR = 0.5 means half the risk. The 95% CI tells you if HR differs significantly from 1.0.

Proportional Hazards

Key Assumption
The hazard ratio stays constant over time. If Drug gives HR = 0.5 at month 1, it should still be 0.5 at month 12.
Check with:
• Schoenfeld residuals test (p > .05 = OK)
• Plot log(-log(S(t))) - lines should be parallel

If violated: Use stratified Cox model or time-varying covariates

The proportional hazards assumption means relative risk is constant over time. If the effect of a predictor changes over time (e.g., treatment works early but not late), the assumption is violated.

★

Real-World Examples

Apply your knowledge to practical scenarios

01

Cancer Treatment Comparison

A clinical trial compares a new chemotherapy regimen to standard treatment. 200 patients are randomized and followed for 5 years. Primary outcome is overall survival.

Q At 3 years, 40 patients have died and 30 are lost to follow-up. How is this handled? +
A Deaths are events (n=40). Lost patients are right-censored (n=30) - they contribute data up to their last observation, then are removed from the risk set. The remaining 130 are still at risk.
Q K-M curves show 3-year survival of 70% for new treatment vs 55% for standard. Log-rank p = .02. What does this mean? +
A At 3 years, 70% of new-treatment patients are alive vs 55% of standard. The log-rank test (p = .02) indicates this difference is statistically significant - curves differ more than expected by chance.
Q Cox regression gives HR = 0.65 (95% CI: 0.45-0.95) for new treatment. Interpret this. +
A Patients on new treatment have 35% lower hazard of death at any point (HR = 0.65). Since the 95% CI doesn't include 1.0, this is statistically significant. New treatment significantly improves survival.
Key Insights
  • Censored patients contribute information up to their last observation
  • K-M curves show survival at specific time points
  • HR < 1 indicates protective effect (better survival)
?

Survival Analysis Quiz

Test your understanding • Passing score: 70%

0 of 6 answered
Q1 multiple-choice

Right censoring occurs when:

Explanation: Right censoring means we know survival time is at least as long as observed follow-up, but we don't know the actual event time because observation ended first.
Q2 multiple-choice

In a Kaplan-Meier curve, the line steps down when:

Explanation: K-M curves drop at each event. Censored observations are marked but don't cause drops - they just reduce the number at risk for future calculations.
Q3 multiple-choice

A hazard ratio of 2.0 means:

Explanation: HR = 2.0 means the instantaneous risk (hazard) of the event is twice as high. At any given moment, those with the risk factor are 2× more likely to experience the event.
Q4 multiple-choice

The log-rank test is used to:

Explanation: The log-rank test compares K-M survival curves between two or more groups. It tests the null hypothesis that the survival functions are equal.
Q5 multiple-choice

The proportional hazards assumption means:

Explanation: Proportional hazards requires that the ratio of hazards between groups stays constant over time. If HR = 2.0 at month 1, it should still be 2.0 at month 12.
Q6 multiple-choice

If 95% CI for HR is [0.6, 0.9], the effect is:

Explanation: The CI doesn't include 1.0, so HR is significantly different from 1. Since HR < 1 (0.6-0.9), the factor is protective - it reduces hazard/risk.

Quiz Results

0 %

← Factor Analysis All Supplementary →