Kaplan-Meier and the Log-Rank Test
In Lesson 1 you met Dr. Meera Rao's heart-failure trial and the two things that make time-to-event data special: right-censoring (patients still alive when we last saw them) and the survival curve \(S(t)\), the probability of surviving past time \(t\). You could describe such a curve. Now you will build one from real, censored data, read its median, and answer the question Dr. Rao actually cares about: does her new drug beat the standard one, or is the gap just noise?
By the end of this lesson you will be able to:
- Estimate a Kaplan-Meier survival curve from censored data, by hand and with
survfit, and read its median - Read a KM curve correctly: the steps, the censoring ticks, and the 50% crossing
- Compare two arms with the log-rank test, and say exactly what its p-value does and does not claim
Prerequisites: Lesson 1 (right-censoring, the Surv(time, status) outcome, the survival function \(S(t)\) and its median). You can run R and read a small table.
Why you cannot just count heads
Here is the obvious idea, and why it breaks. To estimate survival at month 15, count how many of Dr. Rao's 15 standard-arm patients are still alive and divide by 15. Simple, until you hit a censored patient.
One standard-arm patient was last seen alive at 9.4 months, then lost to follow-up: she moved, or the study ended for her, or she simply stopped coming in. At month 15, is she alive or dead? We do not know. Counting her as alive is too optimistic. Dropping her entirely throws away a real fact, that she survived at least 9.4 months. Neither choice is honest, and every censored patient forces the same bad choice.
Kaplan and Meier's fix is to never ask the month-15 question directly. Instead, walk forward in time and stop only at the moments a death actually happens. At each death, look only at the patients still under observation right then, the at-risk set, and ask a tiny question: of those at risk, what fraction survived this instant? A censored patient counts fully, right up until the moment we lose her, and then quietly leaves the at-risk set without ever being called alive-or-dead.