Tutorials › Econometrics (Graduate) › Uncertainty For Kaplan-Meier Curves

Duration and Survival Models · Tutorial 574 of 952

Uncertainty For Kaplan-Meier Curves

Estimate Kaplan–Meier uncertainty with Greenwood’s formula and construct pointwise confidence intervals that behave sensibly near the boundaries of the survival scale.

Advanced 12 min read

What You'll Learn

  • Calculate Greenwood’s estimated variance and standard error from event-time risk sets.
  • Construct a pointwise normal interval for a Kaplan–Meier survival estimate.
  • Derive and invert the log-log transformed interval, reversing its endpoints correctly.
  • Explain why log-log intervals stay within the probability range and are often more suitable near zero or one.
  • Recognize the limits of pointwise intervals and the instability of inference at the boundaries.

Why a Kaplan–Meier Curve Needs Uncertainty Bands

A Kaplan–Meier curve is an estimate of the survival function, not a known population curve. Its steps depend on how many subjects remain at risk and how many events occur at each observed event time. In samples with few subjects at risk, the estimated survival probability can be especially uncertain. Reporting only the curve can therefore give a misleading impression of precision.

This tutorial develops pointwise uncertainty for the Kaplan–Meier estimator. The central calculation is Greenwood’s formula, which estimates the variance at a selected time. A normal interval can then be formed directly on the survival-probability scale. A second approach first transforms the estimate using the log-log function; this often behaves better near zero or one because the resulting interval, after inversion, stays within the probability range.

Definition: Let \(t_1,\ldots,t_k\) be the distinct event times up to a time \(t\). At event time \(t_j\), let \(n_j\) be the number at risk immediately before that time and \(d_j\) the number of events. The Kaplan–Meier estimate is $$ \hat S(t)=\prod_{j:t_j\leq t}\left(1-\frac{d_j}{n_j}\right). $$ When \(\hat S(t)>0\) and \(n_j>d_j\) at every included event time, Greenwood’s estimated variance is $$ \widehat{\operatorname{Var}}\{\hat S(t)\} =\hat S(t)^2 \sum_{j:t_j\leq t}\frac{d_j}{n_j(n_j-d_j)}. $$ The square root of this estimated variance is the Greenwood standard error, denoted \(SE\{\hat S(t)\}\).

Reading Greenwood’s Formula

Each summand in Greenwood’s formula reflects the information at one event time. A larger number of events relative to the risk set generally adds more uncertainty. The terms accumulate across event times, while multiplication by \(\hat S(t)^2\) puts the result on the variance scale for the survival estimate itself. Censoring affects these calculations by changing who remains in each later risk set; a censored subject contributes to the risk set until censoring, but not as an event.

The usual large-sample justification assumes independent subjects and noninformative, independent right censoring: censoring must not selectively remove subjects according to their unobserved event times, at least under the conditioning structure of the analysis. Under these conditions, the Kaplan–Meier estimator has an approximately normal sampling distribution at a fixed time when the estimate is away from problematic boundaries and there is adequate information. Greenwood’s formula estimates its variance. Neither the formula nor the normal approximation makes the interval exact in a small sample.

Worked Example: Calculating Greenwood’s Standard Error

Consider hypothetical follow-up data with three event times. At the first event time, 2 of the 20 subjects at risk experience the event. Before the second event time, two additional subjects are censored, leaving 16 at risk; 3 experience the event. Before the third event time, one more subject is censored, leaving 12 at risk; 2 experience the event. Calculate the Kaplan–Meier estimate and Greenwood standard error just after the third event time.

The three event-time risk sets and event counts are \((n_j,d_j)=(20,2),(16,3),(12,2)\). Thus

$$ \hat S(t) =\left(1-\frac{2}{20}\right) \left(1-\frac{3}{16}\right) \left(1-\frac{2}{12}\right) =(0.9)(0.8125)(0.833333) =0.609375. $$

For the Greenwood sum, the three contributions are

$$ \sum_j\frac{d_j}{n_j(n_j-d_j)} =\frac{2}{20(18)}+\frac{3}{16(13)}+\frac{2}{12(10)} =0.0055556+0.0144231+0.0166667 =0.0366453. $$

Therefore,

$$ \widehat{\operatorname{Var}}\{\hat S(t)\} =(0.609375)^2(0.0366453) \approx 0.01361,\qquad SE\{\hat S(t)\}=\sqrt{0.01361}\approx 0.1167. $$

At this time, the estimated survival probability is 0.6094, with a Greenwood standard error of about 0.1167. The estimate is a probability, so it has no physical units; \(t\) and its interpretation retain the time units used to record follow-up.

Pointwise Normal Intervals

A pointwise confidence interval concerns the survival probability at one specified time \(t\). It does not, by itself, provide a confidence band that covers the entire curve simultaneously. A simple large-sample interval uses the approximate normal distribution of \(\hat S(t)\):

$$ \hat S(t)\ \pm\ z_{1-\alpha/2}\,SE\{\hat S(t)\}. $$

Here \(1-\alpha\) is the confidence level and \(z_{1-\alpha/2}\) is the corresponding standard normal quantile; for a 95% interval, it is approximately 1.96. This construction treats the estimate as approximately normal on the probability scale. Consequently, the lower endpoint can be below zero or the upper endpoint above one, particularly when the estimate is close to a boundary or its standard error is large. Truncating such endpoints to zero or one does not change the underlying approximation and does not generally solve its coverage problem.

Worked Example: A Direct 95% Interval

Suppose a hypothetical Kaplan–Meier calculation at a selected follow-up time gives \(\hat S(t)=0.5926\) and Greenwood sum \(G(t)=0.080556\), where \(G(t)\) denotes the sum inside Greenwood’s formula. Calculate the variance, standard error, and ordinary pointwise 95% interval.

First, the estimated variance is the squared survival estimate times the Greenwood sum:

$$ \widehat{\operatorname{Var}}\{\hat S(t)\} =(0.5926)^2(0.080556) =0.0282892 \approx 0.02829. $$

The standard error is

$$ SE\{\hat S(t)\} =0.5926\sqrt{0.080556} \approx 0.1682. $$

Using \(z_{0.975}=1.96\), the interval is

$$ 0.5926\pm 1.96(0.1682) =0.5926\pm 0.3297 \approx [0.2629,\ 0.9223]. $$

This is an approximate pointwise 95% confidence interval for survival at the selected time. In repeated samples satisfying the model assumptions, intervals constructed this way are intended to cover the population survival probability at that fixed time about 95% of the time. The statement is about the long-run performance of the method, not a probability assigned to the fixed parameter after observing this particular interval.

Log-Log Confidence Intervals

A common alternative constructs an interval for a transformation of the survival estimate. Define \(g(S)=\log[-\log(S)]\) for \(0<S<1\). Its inverse is \(g^{-1}(u)=\exp[-\exp(u)]\), which is decreasing. A normal interval for \(g\{\hat S(t)\}\) can therefore be transformed back to the survival scale, reversing the endpoint order.

The standard error on the transformed scale follows from the delta method. Differentiating gives \(g'(S)=1/[S\log(S)]\). Multiplying the squared derivative by Greenwood’s variance estimate gives

$$ \widehat{\operatorname{Var}}\{g(\hat S(t))\} \approx \left(\frac{1}{\hat S(t)\log\hat S(t)}\right)^2 \hat S(t)^2G(t) =\frac{G(t)}{[\log\hat S(t)]^2}, \qquad SE_g=\frac{\sqrt{G(t)}}{|\log\hat S(t)|}. $$

The absolute value gives a positive standard error. If \(L_g\) and \(U_g\) are the lower and upper normal limits on the transformed scale, then \(L_g<U_g\), but the inverse is decreasing. The corresponding survival interval is therefore \([g^{-1}(U_g),g^{-1}(L_g)]\). Because \(g^{-1}(u)\) is strictly between zero and one for any finite \(u\), finite transformed limits yield survival limits inside that range.

Worked Example: Inverting a Log-Log Interval

Suppose a hypothetical set of event-time risk sets gives \(\hat S(t)\approx 0.8218\). The transformed estimate is approximately \(-1.6280\), and its estimated standard error is approximately 0.4512. Construct and invert a pointwise 95% interval.

On the transformed scale, the normal limits are

$$ -1.6280\pm1.96(0.4512) \approx[-2.5124,\,-0.7436]. $$

Apply \(g^{-1}(u)=\exp[-\exp(u)]\) to both limits and reverse their order:

$$ \left[ \exp\{-\exp(-0.7436)\}, \ \exp\{-\exp(-2.5124)\} \right] \approx[0.6216,\ 0.9221]. $$

The interval is asymmetric around the estimated survival probability, which is appropriate for a probability-scale interval when uncertainty is not symmetric on that scale. This is still an approximate pointwise interval, not a simultaneous band for all follow-up times.

Why the Transformation Helps Near a Boundary

On the original scale, a symmetric normal interval adds and subtracts the same amount from \(\hat S(t)\). Near one, this can produce an upper limit above one; near zero, it can produce a lower limit below zero. A log-log interval instead makes its normal approximation on a transformed scale and maps the limits back through a function whose range is \((0,1)\). The resulting interval is bounded and typically asymmetric.

Bounded endpoints are a practical advantage, not a guarantee of accurate coverage. If only a few subjects remain at risk, the large-sample approximation can still be poor. At \(\hat S(t)=1\), \(\log[-\log\hat S(t)]\) is not finite, and at \(\hat S(t)=0\) it is also undefined. Thus the ordinary log-log construction cannot be applied at these boundary estimates; inference there requires particular caution rather than blind use of the formula.

Worked Example: A Log-Log Interval Near One

Suppose the estimated survival probability at a selected time is 0.970, and the Greenwood sum is 0.000400. These are hypothetical risk-set summaries. Construct the approximate transformed 95% interval and convert it to the survival scale.

The transformed estimate is

$$ g(0.970)=\log[-\log(0.970)]\approx -3.491. $$

Its standard error is

$$ SE_g=\frac{\sqrt{0.000400}}{|\log(0.970)|} =\frac{0.02000}{0.030459} \approx 0.6566. $$

The transformed limits are approximately

$$ -3.491\pm1.96(0.6566) \approx[-4.778,\,-2.204]. $$

The inverse is decreasing, so the survival limits are obtained in reverse order:

$$ \left[ \exp\{-\exp(-2.204)\}, \ \exp\{-\exp(-4.778)\} \right] \approx[0.896,\ 0.992]. $$

The interval remains within the probability range and is asymmetric around 0.970. This addresses a boundary problem of the direct normal interval, but the approximation still depends on adequate information and the censoring assumptions.

Common Pitfalls and Interpretation

  • Using the Greenwood sum as the variance. The sum \(G(t)\) is not itself the variance of \(\hat S(t)\). Greenwood’s formula multiplies it by \(\hat S(t)^2\).
  • Forgetting that the inverse transformation decreases. The transformed lower limit maps to the larger survival endpoint. Reverse the order after applying \(\exp[-\exp(u)]\).
  • Treating a pointwise interval as a curve-wide guarantee. A 95% interval at one fixed time does not imply 95% coverage of the entire estimated curve at once.
  • Calling the interval a probability statement about the parameter. The confidence level describes the repeated-sampling performance of the procedure under its assumptions; it is not the probability that the fixed survival probability lies in the observed interval.
  • Assuming bounded limits ensure good inference. Log-log limits stay within \((0,1)\) when finite, but a small risk set or informative censoring can undermine the approximation or the estimator’s interpretation.
Key takeaway: Greenwood’s formula estimates the variance of a Kaplan–Meier survival estimate by multiplying the squared estimate by a sum of event-time contributions. Direct normal intervals are simple but can cross probability boundaries; log-log intervals are often preferable near zero or one, provided the estimate is interior and the large-sample and censoring assumptions are reasonable.

Check Your Understanding

Answer each question using the definitions and assumptions above.

  1. At one event time, \(n_j=25\) and \(d_j=5\). What contribution does this event time make to the Greenwood sum?
  2. Why is the estimated variance not equal to the Greenwood sum alone?
  3. For a 95% pointwise interval, what standard normal critical value is used, and what does the 95% refer to?
  4. Why must the endpoints be reversed when a transformed interval is mapped back using \(\exp[-\exp(u)]\)?
  5. What is one advantage and one limitation of a log-log interval when the estimated survival probability is close to one?
Clinical Biostats