Kaplan-Meier curve: construction, analysis and interpretation
Learn how the Kaplan-Meier curve is built from time-to-event data, how survival probabilities and censoring affect it, and how to read software output.
Contents
- Building the curve step by step
- How censoring changes the estimate
- Reading curves and the log-rank test
- Questions about Kaplan-Meier curves
- What does a Kaplan-Meier curve show?
- How do I make a Kaplan-Meier curve in Excel?
- How is a Kaplan-Meier curve produced in R or SPSS?
- Can I generate a Kaplan-Meier curve online for free?
The Kaplan-Meier curve is a step chart of the survival function, showing the estimated probability of staying event-free over time for time-to-event data. This page explains how the curve is constructed, how censoring and the Kaplan-Meier estimator shape its steps, and how to interpret, analyze and produce it in spreadsheet and statistical software.
Building the curve step by step
Construction of the curve follows the order of event times in your data. At each event time the estimator multiplies the previous survival probability by the share of those still at risk who did not have the event. Subjects leave the risk set when they experience the event or are censored, and the curve falls only at event times, which produces its stair-step shape.
How censoring changes the estimate
Censoring means you know a subject survived at least until a certain point but not what happened afterward. The Kaplan-Meier estimator uses censored subjects in the risk set up to their last observation time, then removes them without counting an event. Heavy censoring leaves fewer people at risk and widens the step uncertainty, so the tail of the survival function deserves caution.
Reading curves and the log-rank test
Kaplan-Meier curve interpretation reads height as survival probability and the horizontal axis as follow-up time, and it notes where the curve reaches the median survival time. Comparing two curves relies on the log-rank test, which checks whether groups differ across the whole follow-up period. A hazard function describes the instantaneous event rate, and it complements the survival function without replacing the curve.
Questions about Kaplan-Meier curves
What does a Kaplan-Meier curve show?
A Kaplan-Meier curve shows the estimated survival probability over time for time-to-event data, plotted as a series of steps. The height of the curve at any time estimates the share of subjects still free of the event. Drops mark event times, while flat stretches mean no events were recorded in that interval.
How do I make a Kaplan-Meier curve in Excel?
A Kaplan-Meier curve in Excel requires you to compute the survival probabilities yourself, because a spreadsheet holds no built-in survival estimator. Sort the data by time, then calculate the share at risk and the product for each event time in separate columns. An Excel chart of survival probability against time, drawn as a step line, then gives the curve.
How is a Kaplan-Meier curve produced in R or SPSS?
Software in R or SPSS handles the Kaplan-Meier curve through a survival analysis procedure that takes a time variable and an event indicator. In R, the survival package pairs a survival object with a plot command, and a log-rank test comes from a comparison function. In SPSS, the Kaplan-Meier dialog accepts the time and status fields and outputs the curve and the group comparison.
Can I generate a Kaplan-Meier curve online for free?
An online Kaplan-Meier curve generator can draw the curve from pasted time and status data, and some tools are free to use. Check that the generator uses the event indicator correctly and handles censoring, since a wrong status field distorts the steps. For a comparison of groups, confirm that the tool also reports the log-rank test.