Survival Analysis and Kaplan-Meier: An Introduction
A cancer trial enrolls 200 patients and follows them for five years. By the study's end, some have died, some are alive, and some simply stopped showing up. How do you summarize "how long people survive" in this case? The clock cuts off before the story finishes for most subjects. This is the central puzzle that survival analysis solves. Ordinary tools break down here. You cannot use a simple mean survival time. Many patients haven't died yet — you don't know their true survival time. You only know it exceeds what you've observed so far. You cannot treat "still alive at the end of the study" as equivalent to "dead." You also cannot simply drop these incomplete cases. They are disproportionately your longest survivors and healthiest patients. Discarding them would badly bias the results toward pessimism. The statistical machinery built to handle this is the Kaplan-Meier estimator and the log-rank test. This is one of the most consequential inventions in applied statistics. It underlies nearly every clinical trial reported in medicine since the 1960s. The big picture is this: survival analysis treats time until an event as the outcome variable. It builds a special bookkeeping system, called censoring, to honestly incorporate subjects whose event has not yet been observed. The Kaplan-Meier estimator turns censored, incomplete follow-up data into a step-function estimate. This estimate gives the probability of surviving past any given time. The log-rank test then lets you compare two such curves. For example, a drug group versus a placebo group. It asks whether their survival experiences differ by more than chance. This article builds the concept from first principles. It covers what censoring is and why it demands special handling. It explains how the Kaplan-Meier estimator is actually computed step by step. It includes the founding 1958 paper and how survival curves get validated against known truth. It offers two fully worked numerical examples. It covers the classic misconceptions that trip up students and clinicians alike. Finally, it shows where these tools are used today — from oncology trials to conservation biology to reliability engineering.
- Survival analysis studies time-to-event data: how long until death, relapse, failure, or extinction — not just whether the event happened.
- Censoring occurs when a subject's exact event time is unknown, most commonly because the study ended or the subject dropped out before the event occurred.
- The Kaplan-Meier estimator builds a step-function estimate of the survival probability using only subjects still "at risk" at each event time, so censored subjects still contribute information up until they leave the study.
- The log-rank test compares two or more Kaplan-Meier curves by comparing observed vs. expected event counts at every event time, summed into a chi-squared statistic.
- Kaplan and Meier's method (1958) replaced the biased "actuarial" life-table approach and is now standard in every phase of clinical trials.
- Hazard ratios (often from Cox regression, a natural extension) quantify the relative rate of the event between groups, complementing the descriptive Kaplan-Meier curve.
Survival analysis lets censored subjects — those who haven't yet had the event — contribute exactly the information they truly have (that they survived at least this long), instead of being wrongly counted as failures or thrown away.
The core idea
Survival analysis is the branch of statistics devoted to modeling the time until a well-defined event occurs — death, disease relapse, mechanical failure, seed germination, or predator attack. The outcome is not binary "did it happen," as in Logistic Regression for Binary Outcomes, but a duration: time-to-event. The central object of interest is the survival function,
the probability that the event has not yet occurred by time . starts at 1 (everyone is event-free at time zero) and decreases (or stays flat) as increases, eventually approaching 0 if everyone eventually experiences the event. The defining complication is censoring: for many subjects, we do not observe the exact event time, only that it exceeds some known value. The most common form is right censoring — the subject is known to be event-free up to time , but what happens after is unknown, because the study ended, the subject was lost to follow-up, or they died of an unrelated cause. Right censoring differs fundamentally from a missing value: we still have partial information (survival at least to time ), and a valid method must use that information rather than discard it. A crucial assumption, almost always invoked and not always checked, is non-informative censoring: the reason a subject is censored must be unrelated to their underlying prognosis. If sicker patients are more likely to drop out, censoring becomes informative and the estimator is biased. The hazard function is the instantaneous event rate among those still at risk at time — formally, the limiting probability of the event in a small interval given survival to , divided by . Hazard and survival are mathematically linked: . Comparing hazards between groups (via the hazard ratio) is the natural way to summarize "how much faster" one group experiences the event, and it underlies both the log-rank test and Cox proportional-hazards regression, the standard extension of Kaplan-Meier to adjust for covariates.
Mechanism — how Kaplan-Meier actually works
Step 1 — Assemble the data. Each subject contributes a time (from entry to event or censoring) and an indicator (event = 1, censored = 0). Subjects can enter the study at different calendar dates; what matters is time-on-study, not calendar time — this is the standard convention, though "left-truncation" adjustments exist when entry itself must be modeled.
Step 2 — Order the distinct event times. List every unique time at which at least one event (not censoring) occurred: . Censoring times matter too, but they only affect who remains "at risk" — they do not generate their own step in the curve.
Step 3 — At each event time , compute:
The at-risk set shrinks over time both because subjects have events and because subjects become censored and leave the risk set. This is the trick that makes censored subjects useful: a subject censored at time 40 contributes to every risk set up through time 40, then silently drops out — neither counted as a failure nor deleted retroactively.
Step 4 — Estimate the conditional survival probability at each event time:
This is simply "the fraction of the at-risk group that made it past this moment."
Step 5 — Multiply the conditional probabilities. The Kaplan-Meier estimator of overall survival past time is the product of all conditional survival probabilities up to and including :
This is the product-limit formula — the survival curve is a staircase, dropping at each observed event time and flat everywhere else (including at censoring times, where the curve doesn't drop but a tick mark is often plotted to show a censoring occurred).
Step 6 — Quantify uncertainty. Greenwood's formula gives the variance of :
from which confidence bands are built (typically after a log-transform to keep bounds within ).
Step 7 — Compare groups with the log-rank test. At each event time across the pooled sample, construct a table (group × event/no event) among those at risk. Under the null hypothesis that both groups share the same hazard, the expected number of events in group A at time is
(at-risk count in group A, times the overall event fraction). Sum the observed-minus-expected differences over all event times, and compare to their pooled variance to form a chi-squared statistic:
This is essentially a weighted, sequential Mantel-Haenszel test performed at every distinct event time and summed — no assumption of a specific parametric survival distribution is required, which is the test's great strength.
The evidence — how Kaplan-Meier was established and validated
The founding paper. Before 1958, survival data in clinical and actuarial settings were typically handled with the actuarial (life-table) method: time was grouped into coarse intervals (e.g., yearly), and survival probabilities were computed per interval, then multiplied across intervals — essentially a discretized precursor to the product-limit idea. This works reasonably when intervals are wide and data are plentiful, but it wastes information and can be sensitive to arbitrary interval boundaries, especially with the smaller, irregularly-timed clinical datasets typical of the era. In 1958, Edward L. Kaplan, a statistician at Bell Telephone Laboratories, and Paul Meier, a biostatistician then at Johns Hopkins, independently submitted almost identical papers to the Journal of the American Statistical Association solving this problem exactly — using every distinct observed event time, rather than arbitrary intervals, as the unit of calculation. The journal editor persuaded them to merge their manuscripts into a single joint paper, "Nonparametric Estimation from Incomplete Observations" (Kaplan & Meier, 1958), which introduced the product-limit estimator described above. It went on to become one of the most-cited statistics papers of the twentieth century — for decades it held the record as the most-cited paper in all of science according to some citation counts, a reflection of how central time-to-event analysis became across medicine, engineering, and biology.
What the paper actually demonstrated. Kaplan and Meier proved that their estimator is the nonparametric maximum likelihood estimator (NPMLE) of the survival function given right-censored data — that is, among all possible survival curves consistent with the observed data (events and censoring times), the Kaplan-Meier curve is the one that makes the observed data most probable, without assuming any particular parametric shape (no assumption of exponential, Weibull, or any other distribution for survival times). This nonparametric property is exactly why the method spread so fast: it requires no assumption about how survival probability declines, only that censoring is non-informative.
Validating the method against known truth. Because Kaplan-Meier is a nonparametric estimator, its validity has been repeatedly checked via simulation studies: generate survival times from a known distribution (say, exponential with a known true hazard), impose artificial censoring, then verify that the Kaplan-Meier curve — averaged over many simulated datasets — converges to the true survival curve, and that its Greenwood-based confidence intervals achieve their nominal coverage (e.g., a 95% CI contains the true about 95% of the time). Such simulation studies, refined for decades in the biostatistics literature, are the modern analogue of "proving" the estimator, since there is no single decisive experiment analogous to Meselson-Stahl; instead, the guarantee is mathematical (the NPMLE proof) reinforced by simulation.
Establishing the log-rank test. The log-rank test itself traces to independent work by Nathan Mantel (extending the Mantel-Haenszel approach to survival data, 1966) and was placed on rigorous footing by Richard Peto and Julian Peto (1972), whose paper "Asymptotically Efficient Rank Invariant Test Procedures" formalized the test and proved its efficiency properties under the proportional-hazards assumption. Landmark clinical trials from the 1970s onward — for instance, early trials of adjuvant chemotherapy in breast cancer — routinely reported Kaplan-Meier curves with log-rank p-values, cementing the pair as the default reporting standard, later reinforced by the CONSORT reporting guidelines for randomized trials.
Worked examples
Example 1 — Building a Kaplan-Meier curve by hand (asymmetric, realistic censoring pattern). Twelve patients with a rare sarcoma are followed after surgery. Time is in months; "+" denotes censored (alive, lost to follow-up, or study ended). Observed times: 3, 5, 5+, 8, 8, 8, 12+, 15, 15+, 20, 24+, 30 Step through the distinct event times (ignore pure-censoring times except for shrinking the risk set):
| Event time | At risk | Events | Censored before next event | ||
|---|---|---|---|---|---|
| 3 | 12 | 1 | 0 | 11/12 = 0.917 | 0.917 |
| 5 | 11 | 1 | 1 (the 5+) | 10/11 = 0.909 | 0.833 |
| 8 | 9 | 3 | 0 | 6/9 = 0.667 | 0.556 |
| 15 | 6 | 1 | 2 (12+ removed before this row, 15+ after) | 5/6 = 0.833 | 0.463 |
| 20 | 4 | 1 | 1 (24+) | 3/4 = 0.75 | 0.347 |
| 30 | 1 | 1 | 0 | 0/1 = 0 | 0 |
Walk the risk-set bookkeeping carefully: start at . After (1 event), 11 remain. Then one subject is censored at before the event at — so the risk set at is still 11 (the censored-at-5 patient is either counted as "at risk, then censored" or excluded depending on tie-breaking convention; here we assume the death at is recorded as occurring at risk-set size 11, and the censoring removes one more before ). After the event, 10 remain, minus the co-occurring censoring, giving 9 at risk for . Three events occur simultaneously at , dropping to 6. Two censored subjects (one at 12, one at 15+, occurring after the death by convention) leave before 's risk set is fixed at 6; one event occurs, leaving 5, minus the 15+ censoring gives 4 for . One event at leaves 3, minus one censored at 24 gives... this table already reflects the resolved bookkeeping. Reading the final curve: median survival is the first time at which drops to 0.5 or below — that occurs at months (curve falls from 0.833 to 0.556, crossing 0.5). So the estimated median survival is 8 months, even though only 5 of 12 patients have actually died by then — the other 7 are censored at various later times, and their partial information (survived at least that long) is fully used in computing every step up to their censoring time.
Example 2 — Log-rank comparison, asymmetric group sizes. A conservation biologist compares nest survival for a shorebird in two habitat types: restored wetland (n = 40 nests) vs. degraded wetland (n = 15 nests) — deliberately unequal group sizes, typical of field studies where one habitat is rarer. At one particular observed failure day, suppose:
- Total at risk across both groups: (20 restored, 10 degraded)
- Total failures (nest predation) that day:
- Failures in the restored group that day:
Under (equal hazard in both habitats), the expected failures in the restored group at this time point is proportional to its share of the risk set:
So restored wetland had fewer observed failures (1) than expected under the null (2.67) at this time point — evidence, at this single event time, that restored habitat is protective. The log-rank test sums across every failure day in the whole study (not just this one), squares the total, and divides by the summed variance
to build the overall statistic. If, after summing over all failure days, with 1 df, this yields — evidence that nest survival differs meaningfully between habitats, even though the degraded-habitat sample was much smaller. Note that unequal group sizes are perfectly fine for the log-rank test; it automatically weights each time point by the actual composition of the risk set, which is exactly why the calculation uses rather than assuming 50/50 allocation.
Common misconceptions & traps
| Misconception | Reality |
|---|---|
| "Censored = dead" or "censored = failure" | Censored means unknown after this point — the subject may go on to live for decades. Treating censoring as an event massively biases survival estimates downward. |
| "Kaplan-Meier requires an exponential or other parametric survival distribution" | It is explicitly nonparametric — no distributional shape is assumed; that is its entire point. |
| "The curve dropping at a censoring mark means someone died" | No event occurs at censoring; the curve stays flat, and a tick mark simply records that a subject left the risk set alive/unobserved. |
| "You can just delete censored subjects and analyze the rest" | This is called "complete-case" analysis of survival time and induces severe survivorship bias, since censored subjects are disproportionately your best (longest-surviving) cases. |
| "A steeper Kaplan-Meier drop means a worse prognosis at that instant" | A drop's height reflects both the event rate and how many people are still at risk (small risk sets late in follow-up produce large, noisy drops from just one or two events). |
| "The log-rank test tells you the size of the treatment effect" | It only tests whether curves differ; the hazard ratio (typically from Cox regression) quantifies the magnitude. |
| "Median survival time is always estimable" | If fewer than half the subjects have had the event by study's end, never crosses 0.5, and median survival is formally "not reached" — a status, not a missing number. |
The scientist behind it
Origins · 1 minEdward L. Kaplan and how this was discovered
Kaplan trained as a mathematician (PhD, Northwestern) and spent most of his career at Bell Labs working on statistical and mathematical problems in engineering and communications, only turning to the survival-time problem somewhat by circumstance — he had data on vacuum-tube failure times with incomplete observation, a problem structurally identical to a clinical trial with dropout. His 1958 collaboration with Paul Meier, forced by a shared journal editor who noticed their overlapping submissions, became one of the most cited papers in the history of applied statistics. Kaplan remained modest about the achievement for the rest of his career, reportedly surprised that a "little" mathematical trick for tube-failure data became foundational to modern medicine.
Paul Meier, Kaplan's coauthor, came from a very different direction: as a biostatistician working on clinical trial methodology at Johns Hopkins and later the University of Chicago, he was deeply concerned with rigorous inference in medicine, and was also a vocal early advocate for randomization in clinical trials at a time when many physicians resisted it on the grounds that it seemed unethical to leave treatment to chance. Meier's insistence that even censored, incomplete clinical data be handled with full statistical rigor — rather than approximate life-table shortcuts — reflects the same broader push toward quantitative, evidence-based medicine that also drove the adoption of randomized controlled trials.
Origins · 1 minhow this was discovered
Where this matters today
Oncology and clinical trials. Nearly every phase II/III cancer trial reports Kaplan-Meier curves for overall survival and progression-free survival, with a log-rank p-value and often a Cox hazard ratio; regulatory agencies (FDA, EMA) require this as standard evidence for drug approval.
Vaccine and infectious disease studies. Time-to-infection analyses (e.g., COVID-19 vaccine efficacy trials) use Kaplan-Meier curves comparing vaccinated vs. placebo arms, with censoring for participants who never became infected during the trial window.
Organ transplantation and surgery. Graft survival and post-surgical outcomes (e.g., 5-year and 10-year "survival" of a transplanted kidney) are reported as Kaplan-Meier curves, guiding both clinical decisions and organ-allocation policy.
Reliability engineering. The same mathematics, historically the origin of Kaplan's own motivating dataset, estimates time-to-failure distributions for mechanical or electronic components under censored testing (some units haven't failed when testing stops).
Conservation biology and ecology. Nest survival, territory tenure, and time-to-extinction analyses in wildlife populations use Kaplan-Meier-type and related survival models (e.g., the Mayfield method, a close relative developed independently in ornithology) to handle animals that are still alive or unobserved when a field season ends.
Public health and demography. Life tables — the actuarial ancestor of Kaplan-Meier — remain central to insurance underwriting, and modern survival methods extend them to more complex censoring and competing-risks settings (e.g., estimating cause-specific mortality when death can occur from multiple competing causes).
Ask the tutor: How would the Kaplan-Meier analysis change if subjects could experience two different competing events, like death from cancer versus death from an unrelated accident?
Why can't we just compute the average survival time directly from the data?
Because for many subjects — especially in an ongoing or recently-closed study — the true survival time isn't known yet; you only know it's at least as long as their observed follow-up. Averaging observed times as if they were complete either underestimates true survival (if you treat censoring times as event times) or requires discarding censored subjects (which are systematically the longest survivors, biasing the average downward). Kaplan-Meier sidesteps this by estimating the survival probability at each time point using only subjects currently at risk, so censored subjects contribute exactly the information they have — "survived at least this long" — without requiring knowledge of their eventual outcome.
What's the difference between the Kaplan-Meier curve and the log-rank test?
The Kaplan-Meier curve is a descriptive estimator: it produces the step-function estimate of for one group, along with a median survival time and confidence bands. The log-rank test is an inferential test: given two or more Kaplan-Meier curves (e.g., treatment vs. control), it asks whether the underlying survival distributions differ by more than chance, producing a p-value. You typically report both together — the curves visually, the log-rank p-value as the formal significance test — much as you'd report means alongside a t-test.
How does Cox proportional-hazards regression relate to Kaplan-Meier?
Kaplan-Meier and the log-rank test compare survival between a small number of discrete groups (e.g., drug vs. placebo) without adjusting for other variables. Cox regression extends the same censored-data framework to estimate how continuous or multiple covariates (age, tumor stage, biomarker level) affect the hazard simultaneously, producing hazard ratios while implicitly controlling for confounders — conceptually parallel to how multiple regression extends a simple two-group comparison. Cox regression assumes proportional hazards (that the hazard ratio between groups is constant over time), an assumption that should be checked, whereas the log-rank test and Kaplan-Meier curve make no such assumption.
What is "informative censoring," and why does it break the method?
Informative censoring occurs when the reason a subject leaves the study early is correlated with their underlying risk of the event — for example, if patients who are deteriorating quietly drop out of a trial rather than reporting worsening symptoms, or if healthier patients are more likely to move away and be "lost to follow-up." In that case, the remaining at-risk pool becomes unrepresentative of the true population at each time point, and the Kaplan-Meier estimator systematically over- or under-estimates true survival. There is no purely statistical fix from the survival data alone; researchers must design follow-up procedures to minimize informative dropout and, where possible, use sensitivity analyses or auxiliary data to check the non-informative-censoring assumption.
Why does the Kaplan-Meier curve look like a "staircase" rather than a smooth curve?
Because it is a nonparametric estimator built directly from discrete observed event times, with no smoothing or curve-fitting imposed. The true underlying survival function may well be smooth, but with a finite sample the only information available is "how many of those at risk survived past each observed event time," which naturally produces discrete drops. Smoother estimates (kernel-smoothed hazard estimates, or fitting a parametric model like Weibull) exist and can be more efficient if their assumptions hold, but they introduce assumptions the Kaplan-Meier estimator deliberately avoids.
Can Kaplan-Meier handle more than two groups, or events other than death?
Yes to both. The log-rank test generalizes naturally to groups (producing a chi-squared statistic with degrees of freedom), and stratified or trend versions exist for ordered categories (e.g., cancer stage I–IV). The "event" itself can be any well-defined occurrence with a clear time origin: relapse, hospital readmission, device failure, first reproduction, or local extinction of a population — the same mathematics applies as long as event and censoring times are well-defined and censoring is non-informative. When multiple distinct event types compete (e.g., death from cancer vs. death from unrelated causes), a related but distinct framework called competing-risks analysis is required, since naively censoring at a competing event can itself introduce bias.
Is a Kaplan-Meier curve valid with a very small number of subjects still at risk late in follow-up?
Technically the estimator remains defined, but it becomes highly unstable — with only a handful of subjects at risk, one additional event produces a large, noisy drop, and the confidence interval (via Greenwood's formula) widens dramatically. Journals and reporting guidelines typically recommend truncating or flagging the curve, and reporting the number "at risk" at intervals below the plot (a "numbers at risk" table), precisely so readers can judge how much to trust the tail of the curve. A curve's rightmost segment, based on just one or two remaining patients, should never be over-interpreted as a precise probability.