Kaplan–Meier and Nelson–Aalen Estimation › Example - A Ten-Person Failure Table
Machine Learning from ScratchAll chapters Kaplan–Meier and Nelson–Aalen Estimation › Example - A Ten-Person Failure TableSection view · Sections in this chapter5 / 10 ↓
Reading tools Definitions, links & notes
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
The formulas are compact, so it is worth slowing down and watching the risk set change row by row. We now work through a small failure table by hand. The observed times and event indicators are:
| Subject | ||
|---|---|---|
| 1 | 2 | 1 |
| 2 | 3 | 1 |
| 3 | 3 | 1 |
| 4 | 5 | 0 |
| 5 | 6 | 1 |
| 6 | 6 | 0 |
| 7 | 8 | 1 |
| 8 | 9 | 0 |
| 9 | 10 | 1 |
| 10 | 12 | 0 |
The distinct event times are . We process tied events and censorings using events first. At each event time, the first question is always the same: who is still in the risk set?
At , all ten subjects are at risk and one event occurs:
Thus and . The risk set has shrunk by one because subject 1 has now had the event.
At , subject 1 has already had an event, so nine subjects remain at risk. Two events occur at time 3.
The updated estimates are
At subject 4 is censored. This does not create a step, but it removes subject 4 from later risk sets. That is the only role of censoring here: it changes who is available for future events.
At , subject 4 is gone, but subject 6 is censored at time 6 and remains in the risk set for the event at time 6 under our convention. Six subjects are at risk and one event occurs:
Therefore
At , subjects 5 and 6 have left after time 6, so four subjects remain at risk. One event occurs:
Thus
At , two subjects remain at risk and one event occurs:
So
At , the one remaining subject is censored, so the Kaplan-Meier curve remains flat at after time 10. It never reaches zero because the last subject leaves the study without an observed event.
The Nelson–Aalen estimate at time 10 is , and
This is above the Kaplan–Meier value . The gap is the finite-sample effect of using rather than at each event time. It is not a bug, and it is one reason we should not label as Kaplan–Meier.
For uncertainty, the Greenwood increments are
Their sum is approximately . At the final event time,
The median is the first time the curve is at or below . At time 6 the estimate is , and at time 8 it is , so the estimated median is . This is a useful check on the risk-set arithmetic: the median is read from the step function, not computed by interpolating between event times.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!