Ten patients, two kinds of exits
Say ten patients finish a cancer treatment and we watch for relapse over the next two years. Each patient's story is a line through time, and only two things can end it: the event itself, or the end of observation - the study closes, the patient moves to another city, the follow-up visit never happens. That second ending is called censoring, and it is the reason this curve exists. A censored patient told you something real: no relapse for as long as you watched. Throwing them out of the analysis wastes that information; counting them as relapse-free forever invents information you never had. The Kaplan-Meier estimator is the standard way to keep exactly what they gave you and nothing more.
Build it by hand
The trick is to update the curve only when an event happens, and to use only the patients still under observation at that moment - the patients at risk. Ten are at risk when the first relapse comes at month 3, so survival falls to 9/10 = 90%. At month 5 one patient moves away: a tick on the curve, no drop, but only eight remain at risk. That makes the relapse at month 8 cost more: 90% times 7/8, about 79%. Every event multiplies the current survival by one minus events over at-risk, and censored patients quietly shrink the at-risk count between the drops. The full ladder for our ten patients:
| Month | At risk | Events | Factor | Survival |
|---|---|---|---|---|
| 3 | 10 | 1 | 9/10 | 90% |
| 8 | 8 | 1 | 7/8 | 79% |
| 10 | 7 | 1 | 6/7 | 68% |
| 15 | 5 | 1 | 4/5 | 54% |
| 18 | 4 | 1 | 3/4 | 41% |
| 22 | 2 | 1 | 1/2 | 20% |
Patients censored at months 5, 12, 20 and 24 never get a row of their own: they only thin the at-risk column. The curve crosses 50% at month 18, so the median survival is 18 months.
d₁ events at time t₁, among n₁ patients still at risk. Multiply the factors for every event time up to t.
Try it: drag their timelines
Each line below is one patient. Drag along a line to change when their story ends; tap the letter to switch that ending between E, the event, and C, censored. The steps, the ticks and the median respond as you go. Push the events late or censor enough patients and the median disappears: if the curve never reaches 50%, the median is simply not reached - a phrase you will meet in every oncology paper, and it is good news wearing dry language.