From a Kaplan-Meier Curve to Restricted Mean Survival
A Kaplan-Meier curve records estimated survival as a sequence of downward steps. The restricted mean survival time up to a chosen horizon is the area beneath that curve from time zero to the horizon. For an empirical curve, that area is calculated by adding rectangles: each rectangle’s width is the time spent at a survival level, and its height is that level.
This tutorial focuses on calculating the area when the horizon is an event time on the Kaplan-Meier curve. Because the curve is constant between event times, the calculation is direct once the time intervals and their survival levels are identified. Time units must be consistent: if the times are recorded in months, the result is in months.
At a distinct event time \(t_j\), let \(n_j\) be the number at risk immediately before that time and \(d_j\) the number of failures at that time. The Kaplan-Meier estimate multiplies the preceding survival level by \(1-d_j/n_j\). Thus it drops at failure times; a censoring mark does not itself cause a drop. Censored individuals are no longer included in later risk sets.
Why the Rectangle Sum Works
For a nonnegative survival time, \(\min(T,\tau)\) can be represented as the total length of time, between zero and \(\tau\), for which the individual has survived. In indicator notation, that length is the integral of \(I(T>t)\). Taking expectations gives the survival-area identity:
The interchange of expectation and integration is valid here because the indicator is nonnegative and the interval is bounded. Replacing the population survival function \(S(t)\) by its Kaplan-Meier estimate gives the estimated area. On each interval between event times the Kaplan-Meier estimate is constant, so its integral over that interval is exactly width times height. Adding those interval areas yields the rectangle-sum formula.
An event at the horizon changes the curve at that single time, but a value at a single point has zero area. For a horizon that coincides with an event time, the final rectangle therefore uses the survival level just before the event at the horizon. The survival level just after that event is relevant only beyond the horizon.
Calculating the Area from Risk-Set Information
Worked Example: Three Event Times and a Censored Interval
In a hypothetical follow-up study, times are measured in years. The event-time risk-set information is:
| Event time \(t_j\) | At risk \(n_j\) | Failures \(d_j\) |
|---|---|---|
| 2 | 10 | 2 |
| 5 | 6 | 1 |
| 8 | 5 | 2 |
The horizon is \(\tau=8\) years. There are two censorings between years 2 and 5; they account for the risk set decreasing from 8 after the failures at year 2 to 6 at year 5. Calculate the restricted mean.
Step 1: Calculate each Kaplan-Meier level. Initially, \(\widehat S_{\mathrm{KM}}(0)=1\). At year 2, the conditional survival factor is \(1-2/10=0.8\), so the estimated survival level after that event is \(0.8\). At year 5, the factor is \(1-1/6=5/6\), giving \(0.8(5/6)=2/3\). At year 8, the factor is \(1-2/5=3/5\), giving \((2/3)(3/5)=2/5\).
Step 2: Match levels to intervals. The curve is at 1 from year 0 to year 2, at 0.8 from year 2 to year 5, and at \(2/3\) from year 5 to year 8. The drop at year 8 occurs at the horizon and contributes no area within the interval ending there.
Step 3: Add the rectangle areas.
Check. The result is between 0 and the 8-year horizon, as it must be. The areas are 2, 2.4, and 2 years, summing to 6.4 years. The Kaplan-Meier level after the year-8 event is \(2/5\), but multiplying it by an additional interval would extend the calculation past the specified horizon.
Reading the Step Levels Correctly
A useful way to avoid misalignment is to write down the interval endpoints first, then attach the survival level that was in force throughout each interval. In particular, the level after an event at \(t_j\) applies to the interval beginning at \(t_j\), not to the interval that ends at \(t_j\). The risk-set table supplies the successive step heights; the curve’s horizontal stretches supply the rectangle widths.
Worked Example: Endpoint Event and a Final Drop
A hypothetical study records three event times, in months, with the following risk sets:
| Event time \(t_j\) | At risk \(n_j\) | Failures \(d_j\) |
|---|---|---|
| 1 | 12 | 3 |
| 4 | 6 | 2 |
| 6 | 4 | 1 |
Calculate the restricted mean through \(\tau=6\) months. The risk-set size falls from 9 after the first event to 6 at month 4 because three individuals are censored before month 4.
Step 1: Find the post-event survival levels. At month 1, the level becomes \(1-3/12=3/4\). At month 4, it becomes \((3/4)(1-2/6)=(3/4)(2/3)=1/2\). At month 6, it becomes \((1/2)(1-1/4)=3/8\).
Step 2: Identify the levels contributing area. The intervals are 0 to 1 month at level 1, 1 to 4 months at level \(3/4\), and 4 to 6 months at level \(1/2\). The level \(3/8\) begins at the horizon, so it contributes no area before month 6.
Step 3: Sum the areas.
Check. The estimate is positive and less than 6 months. The event at month 6 changes the estimated survival from \(1/2\) to \(3/8\), but that change is at one point, not over a time interval within the horizon.
Handling Censoring and Checking the Calculation
Censoring matters to the calculation through the risk sets used at later event times. A censored individual contributes to the risk set until censoring, but is not counted as a failure at that time. Consequently, censoring can change a later factor \(1-d_j/n_j\) by changing \(n_j\); it does not create a Kaplan-Meier drop of its own.
Worked Example: Censoring Changes a Later Risk Set
In a hypothetical follow-up measured in years, three failures occur at years 2, 3, and 7. The risk-set information is \(n_1=20,d_1=4\) at year 2; \(n_2=12,d_2=3\) at year 3; and \(n_3=9,d_3=3\) at year 7. Four individuals are censored between years 2 and 3. Calculate the restricted mean through year 7.
Step 1: Calculate the step heights. The year-2 event gives survival \(1-4/20=0.8\). At year 3, the factor is \(1-3/12=0.75\), so survival becomes \(0.8(0.75)=0.6\). At year 7, the factor is \(1-3/9=2/3\), so survival becomes \(0.6(2/3)=0.4\).
Step 2: Assign heights to the intervals. Survival is 1 from year 0 to 2, 0.8 from year 2 to 3, and 0.6 from year 3 to 7. The censoring between years 2 and 3 creates no extra horizontal segment with a new survival level.
Step 3: Calculate and check the area.
The estimate is between 0 and the 7-year horizon. As a further check, the interval widths total \(2+1+4=7\) years, and each height is between 0 and 1, so the area cannot exceed 7 years.
Common Exam Trap: Using the Wrong Height
A frequent error is to use the survival level after an event for the interval ending at that event. For the data in the first worked example, that mistake would assign \(0.8\), rather than 1, to years 0 to 2; \(2/3\), rather than 0.8, to years 2 to 5; and \(2/5\), rather than \(2/3\), to years 5 to 8. The resulting wrong calculation is:
The correction is to use the survival level in force during each interval: 1, 0.8, and \(2/3\). This gives \(6.4\) years, as calculated above. A second common error is treating a censoring time as a failure time and multiplying survival by a failure factor there. Censoring changes subsequent risk sets; it does not itself create a Kaplan-Meier survival drop.
Check Your Understanding
For each question, calculate the Kaplan-Meier restricted mean through the stated event-time horizon.
- In a hypothetical study, the only event before the 5-year horizon is at year 2, with \(n_1=8\) and \(d_1=2\). Find the restricted mean through year 5. (Answer: 4.25 years)
- Events occur at months 1 and 4, with \((n_1,d_1)=(5,1)\) and \((n_2,d_2)=(4,2)\). Find the restricted mean through month 4. (Answer: 3.4 months)
- Events occur at years 2 and 6, with \((n_1,d_1)=(12,3)\) and \((n_2,d_2)=(6,2)\). Find the restricted mean through year 6. (Answer: 5.0 years)
- Events occur at months 1, 3, and 5, with risk-set data \((10,2)\), \((5,2)\), and \((3,1)\), respectively, where each pair is \((n_j,d_j)\). Find the restricted mean through month 5. (Answer: 3.56 months)
- For hypothetical Group A, the only event before year 5 is at year 2 with \(n=10,d=2\). For Group B, it is at year 1 with \(n=10,d=1\). Calculate each restricted mean through year 5 and the difference, Group B minus Group A. (Answer: Group A 4.4 years; Group B 4.6 years; difference 0.2 years)