Kaplan–Meier estimator explained

The Kaplan–Meier estimator,[1] [2] also known as the product limit estimator, is a non-parametric statistic used to estimate the survival function from lifetime data. In medical research, it is often used to measure the fraction of patients living for a certain amount of time after treatment. In other fields, Kaplan–Meier estimators may be used to measure the length of time people remain unemployed after a job loss,[3] the time-to-failure of machine parts, or how long fleshy fruits remain on plants before they are removed by frugivores. The estimator is named after Edward L. Kaplan and Paul Meier, who each submitted similar manuscripts to the Journal of the American Statistical Association.[4] The journal editor, John Tukey, convinced them to combine their work into one paper, which has been cited more than 34,000 times since its publication in 1958.[5] [6]

S(t)

(the probability that life is longer than

t

) is given by:

\widehatS(t)=

\prod\limits
i:ti\let

\left(1-

di
ni

\right),

with

ti

a time when at least one event happened, di the number of events (e.g., deaths) that happened at time

ti

, and

ni

the individuals known to have survived (have not yet had an event or been censored) up to time

ti

.

Basic concepts

A plot of the Kaplan–Meier estimator is a series of declining horizontal steps which, with a large enough sample size, approaches the true survival function for that population. The value of the survival function between successive distinct sampled observations ("clicks") is assumed to be constant.

An important advantage of the Kaplan–Meier curve is that the method can take into account some types of censored data, particularly right-censoring, which occurs if a patient withdraws from a study, is lost to follow-up, or is alive without event occurrence at last follow-up. On the plot, small vertical tick-marks state individual patients whose survival times have been right-censored. When no truncation or censoring occurs, the Kaplan–Meier curve is the complement of the empirical distribution function.

In medical statistics, a typical application might involve grouping patients into categories, for instance, those with Gene A profile and those with Gene B profile. In the graph, patients with Gene B die much quicker than those with Gene A. After two years, about 80% of the Gene A patients survive, but less than half of patients with Gene B.

To generate a Kaplan–Meier estimator, at least two pieces of data are required for each patient (or each subject): the status at last observation (event occurrence or right-censored), and the time to event (or time to censoring). If the survival functions between two or more groups are to be compared, then a third piece of data is required: the group assignment of each subject.[7]

Problem definition

Let

\tau\ge0

be a random variable, which we think of as the time that elapses between the start of the possible exposure period,

t0

, and the time that an event of interest takes place,

t1

. As indicated above, the goal is to estimate the survival function

S

underlying

\tau

. Recall that this function is defined as

S(t)=\operatorname{Prob}(\tau>t)

, where

t=0,1,...

is the time.

Let

\tau1,...,\taun\ge0

be independent, identically distributed random variables, whose common distribution is that of

\tau

:

\tauj

is the random time when some event

j

happened. The data available for estimating

S

is not

(\tauj)j=1,...,n

, but the list of pairs

((\tilde\tauj,cj))j=1,...,n

where for

j\in[n]:=\{1,2,...,n\}

,

cj\ge0

is a fixed, deterministic integer, the censoring time of event

j

and

\tilde\tauj=min(\tauj,cj)

. In particular, the information available about the timing of event

j

is whether the event happened before the fixed time

cj

and if so, then the actual time of the event is also available. The challenge is to estimate

S(t)

given this data.

Derivation of the Kaplan–Meier estimator

Here, we show two derivations of the Kaplan–Meier estimator. Both are based on rewriting the survival function in terms of what is sometimes called hazard, or mortality rates. However, before doing this it is worthwhile to consider a naive estimator.

A naive estimator

To understand the power of the Kaplan–Meier estimator, it is worthwhile to first describe a naive estimator of the survival function.

Fix

k\in[n]:=\{1,...,n\}

and let

t>0

. A basic argument shows that the following proposition holds:

Proposition 1: If the censoring time

ck

of event

k

exceeds

t

(

ck\get

), then

\tilde\tauk\get

if and only if

\tauk\get

.

Let

k

be such that

ck\get

. It follows from the above proposition that

\operatorname{Prob}(\tauk\get)=\operatorname{Prob}(\tilde\tauk\get).

Let

Xk=I(\tilde\tauk\get)

and consider only those

k\inC(t):=\{k:ck\get\}

, i.e. the events for which the outcome was not censored before time

t

. Let

m(t)=|C(t)|

be the number of elements in

C(t)

. Note that the set

C(t)

is not random and so neither is

m(t)

. Furthermore,

(Xk)k\in

is a sequence of independent, identically distributed Bernoulli random variables with common parameter

S(t)=\operatorname{Prob}(\tau\get)

. Assuming that

m(t)>0

, this suggests to estimate

S(t)

using

\hatSnaive(t) =

1
m(t)
\sum
k:ck\get

Xk =

|\{1\lek\len:\tilde\tauk\get\
|}{|\{1\le

k\len:ck\get\}|} =

|\{1\lek\len:\tilde\tauk\get\
|}{m(t)},

where the second equality follows because

\tilde\tauk\get

implies

ck\get

, while the last equality is simply a change of notation.

The quality of this estimate is governed by the size of

m(t)

. This can be problematic when

m(t)

is small, which happens, by definition, when a lot of the events are censored. A particularly unpleasant property of this estimator, that suggests that perhaps it is not the "best" estimator, is that it ignores all the observations whose censoring time precedes

t

. Intuitively, these observations still contain information about

S(t)

: For example, when for many events with

ck<t

,

\tauk<ck

also holds, we can infer that events often happen early, which implies that

\operatorname{Prob}(\tau\let)

is large, which, through

S(t)=1-\operatorname{Prob}(\tau\let)

means that

S(t)

must be small. However, this information is ignored by this naive estimator. The question is then whether there exists an estimator that makes a better use of all the data. This is what the Kaplan–Meier estimator accomplishes. Note that the naive estimator cannot be improved when censoring does not take place; so whether an improvement is possible critically hinges upon whether censoring is in place.

The plug-in approach

By elementary calculations,

\begin{align} S(t)&=\operatorname{Prob}(\tau>t\mid\tau>t-1)\operatorname{Prob}(\tau>t-1)\\[4pt] &=(1-\operatorname{Prob}(\tau\let\mid\tau>t-1))\operatorname{Prob}(\tau>t-1)\\[4pt] &=(1-\operatorname{Prob}(\tau=t\mid\tau\get))\operatorname{Prob}(\tau>t-1)\\[4pt] &=q(t)S(t-1), \end{align}

where the second to last equality used that

\tau

is integer valued and for the last line we introduced

q(t)=1-\operatorname{Prob}(\tau=t\mid\tau\get).

By a recursive expansion of the equality

S(t)=q(t)S(t-1)

, we get

S(t)=q(t)q(t-1)q(0).

Note that here

q(0)=1-\operatorname{Prob}(\tau=0\mid\tau>-1)=1-\operatorname{Prob}(\tau=0)

.

The Kaplan–Meier estimator can be seen as a "plug-in estimator" where each

q(s)

is estimated based on the data and the estimator of

S(t)

is obtained as a product of these estimates.

It remains to specify how

q(s)=1-\operatorname{Prob}(\tau=s\mid\tau\ges)

is to be estimated. By Proposition 1, for any

k\in[n]

such that

ck\ges

,

\operatorname{Prob}(\tau=s)=\operatorname{Prob}(\tilde\tauk=s)

and

\operatorname{Prob}(\tau\ges)=\operatorname{Prob}(\tilde\tauk\ges)

both hold. Hence, for any

k\in[n]

such that

ck\ges

,

\operatorname{Prob}(\tau=s|\tau\ges)=\operatorname{Prob}(\tilde\tauk=s)/\operatorname{Prob}(\tilde\tauk\ges).

By a similar reasoning that lead to the construction of the naive estimator above, we arrive at the estimator

\hatq(s)=1-

|\{1\lek\len:ck\ges,\tilde\tauk=s\
|}{|\{1\le

k\len:ck\ges,\tilde\tauk\ges\}|} =1-

|\{1\lek\len:\tilde\tauk=s\
|}{|\{1\le

k\len:\tilde\tauk\ges\}|}

(think of estimating the numerator and denominator separately in the definition of the "hazard rate"

\operatorname{Prob}(\tau=s|\tau\ges)

). The Kaplan–Meier estimator is then given by

\hatS(t)=

t
\prod
s=0

\hatq(s).

The form of the estimator stated at the beginning of the article can be obtained by some further algebra. For this, write

\hatq(s)=1-d(s)/n(s)

where, using the actuarial science terminology,

d(s)=|\{1\lek\len:\tauk=s\}|

is the number of known deaths at time

s

, while

n(s)=|\{1\lek\len:\tilde\tauk\ges\}|

is the number of those persons who are alive (and not being censored) at time

s-1

.

Note that if

d(s)=0

,

\hatq(s)=1

. This implies that we can leave out from the product defining

\hatS(t)

all those terms where

d(s)=0

. Then, letting

0\let1<t2<...<tm

be the times

s

when

d(s)>0

,

di=d(ti)

and

ni=n(ti)

, we arrive at the form of the Kaplan–Meier estimator given at the beginning of the article:

\hatS(t)=

\prod\left(1-
i:ti\let
di
ni

\right).

As opposed to the naive estimator, this estimator can be seen to use the available information more effectively: In the special case mentioned beforehand, when there are many early events recorded, the estimator will multiply many terms with a value below one and will thus take into account that the survival probability cannot be large.

Derivation as a maximum likelihood estimator

Kaplan–Meier estimator can be derived from maximum likelihood estimation of the discrete hazard function.[8] More specifically given

di

as the number of events and

ni

the total individuals at risk at time 

ti

, discrete hazard rate

hi

can be defined as the probability of an individual with an event at time 

ti

. Then survival rate can be defined as:

S(t)=

\prod\limits
i:ti\let

(1-hi)

and the likelihood function for the hazard function up to time

ti

is:

l{L}(hj:\middj:,nj:)=

i
\prod
j=1
dj
h
j
nj-dj
(1-h
j)

{nj\choosedj}

therefore the log likelihood will be:

log(l{L})=

i
\sum
j=1

\left(djlog(hj)+(nj-dj)log(1-hj)+log{nj\choosedj}\right)

finding the maximum of log likelihood with respect to

hi

yields:
\partiallog(l{L
)}{\partial

hi}=

di
\widehat{h
i}-ni-di
1-\widehat{h

i}=0

\widehat{h}
i=di
ni

where hat is used to denote maximum likelihood estimation. Given this result, we can write:

\widehatS(t)=

\prod\limits
i:ti\let

\left(1-\widehat{h}i\right)=

\prod\limits
i:ti\let

\left(1-

di
ni

\right)

More generally (for continuous as well as discrete survival distributions), the Kaplan-Meier estimator may be interpreted as a nonparametric maximum likelihood estimator.[9]

Benefits and limitations

The Kaplan–Meier estimator is one of the most frequently used methods of survival analysis. The estimate may be useful to examine recovery rates, the probability of death, and the effectiveness of treatment. It is limited in its ability to estimate survival adjusted for covariates; parametric survival models and the Cox proportional hazards model may be useful to estimate covariate-adjusted survival.

The Kaplan-Meier estimator is directly related to the Nelson-Aalen estimator and both maximize the empirical likelihood.[10]

Statistical considerations

The Kaplan–Meier estimator is a statistic, and several estimators are used to approximate its variance. One of the most common estimators is Greenwood's formula:[11]

\widehat{\operatorname{Var}}\left(\widehatS(t)\right)=\widehatS(t)2

\sum
i:ti\let
di
ni(ni-di)

,

where

di

is the number of cases and

ni

is the total number of observations, for

ti<t

.

In some cases, one may wish to compare different Kaplan–Meier curves. This can be done by the log rank test, and the Cox proportional hazards test.

Other statistics that may be of use with this estimator are pointwise confidence intervals,[12] the Hall-Wellner band[13] and the equal-precision band.[14]

Software

Kaplan–Meier estimator survival curves and results for the log rank test are obtained with the KMSURVIVAL command.[28]

See also

Further reading

External links

Notes and References

  1. Kaplan . E. L. . Meier . P. . Nonparametric estimation from incomplete observations . . 53 . 282 . 457–481 . 1958 . 2281868 . 10.2307/2281868.
  2. Kaplan, E.L. in a retrospective on the seminal paper in "This week's citation classic". Current Contents 24, 14 (1983). Available from UPenn as PDF.
  3. Meyer . Bruce D. . 1990 . Unemployment Insurance and Unemployment Spells . . 58 . 4 . 757–782 . 10.2307/2938349. 2938349 . 154632727 .
  4. Stalpers . Lukas J A . Kaplan . Edward L . Edward L. Kaplan and the Kaplan-Meier Survival Curve . BSHM Bulletin: Journal of the British Society for the History of Mathematics . 4 May 2018 . 33 . 2 . 109–135 . 10.1080/17498430.2018.1450055 . 125941631 . free .
  5. Nonparametric Estimation from Incomplete Observations . Journal of the American Statistical Association . 1958 . 53 . 282 . 457–481 . 10.1080/01621459.1958.10501452 . 27 February 2023. Kaplan . E. L. . Meier . Paul .
  6. News: Paul Meier, 1924–2011 . Chicago Tribune . August 18, 2011 .
  7. Rich . Jason T. . Neely . J. Gail . Paniello . Randal C. . Voelker . Courtney C. J. . Nussenbaum . Brian . Wang . Eric W. . A practical guide to understanding Kaplan-Meier curves . Otolaryngology–Head and Neck Surgery . September 2010 . 143 . 3 . 331–336 . 10.1016/j.otohns.2010.05.007 . 20723767 . 3932959 .
  8. Web site: STAT331 Unit 3. 12 May 2023.
  9. Book: Andersen . Per Kragh . Borgan . Ornulf . Gill . Richard D. . Keiding . Niels . Statistical models based on counting processes . 1993 . Springer-Verlag . New York . 0-387-97872-0.
  10. Zhou, M. (2015). Empirical Likelihood Method in Survival Analysis (1st ed.). Chapman and Hall/CRC. https://doi.org/10.1201/b18598, https://books.google.com/books?id=9-b5CQAAQBAJ&dq=Does+the+Nelson%E2%80%93Aalen+estimator+construct+an+empirical+likelihood%3F&pg=PA7
  11. Book: Greenwood . Major . 1926 . A report on the natural duration of cancer . Issue 33 of Reports on public health and medical subjects . . 14713088 .
  12. Fay . Michael P. . Brittain . Erica H.. Erica Brittain . Proschan . Michael A. . Pointwise confidence intervals for a survival distribution with small samples or heavy censoring . Biostatistics . 1 September 2013 . 14 . 4 . 723–736 . 10.1093/biostatistics/kxt016 . 23632624 . 3769999 .
  13. Hall . W. J. . Wellner . Jon A. . Confidence bands for a survival curve from censored data . Biometrika . 1980 . 67 . 1 . 133–143 . 10.1093/biomet/67.1.133 .
  14. Nair . Vijayan N. . Confidence Bands for Survival Functions With Censored Data: A Comparative Study . Technometrics . August 1984 . 26 . 3 . 265–275 . 10.1080/00401706.1984.10487964 .
  15. Web site: Survival Analysis – Mathematica SurvivalModelFit. wolfram.com. 2017-08-14.
  16. Web site: SAS/STAT(R) 14.1 User's Guide. support.sas.com. 12 May 2023.
  17. Web site: Therneau . Terry M. . 2022-08-09 . survival: Survival Analysis . 2022-11-30 . The Comprehensive R Archive Network.
  18. Book: Willekens, Frans . Statistical Packages for Multistate Life History Analysis . Use R! . Multistate Analysis of Life Histories with R . Springer . 2014 . 978-3-319-08383-4 . 135–153 . https://books.google.com/books?id=Cd2CBAAAQBAJ&pg=PA135 . 10.1007/978-3-319-08383-4_6 .
  19. Book: Ding-Geng . Chen . Karl E. . Peace . Clinical Trial Data Analysis Using R . CRC Press . 2014 . 9781439840214. 99–108 .
  20. Web site: sts — Generate, graph, list, and test the survivor and cumulative hazard functions . Stata Manual .
  21. Book: Cleves, Mario . An Introduction to Survival Analysis Using Stata . College Station . Stata Press . Second . 2008 . 978-1-59718-041-2 . 93–107 .
  22. Web site: lifelines — lifelines 0.27.7 documentation. lifelines.readthedocs.io. 12 May 2023.
  23. Web site: sksurv.nonparametric.kaplan_meier_estimator — scikit-survival 0.20.0. scikit-survival.readthedocs.io. 12 May 2023.
  24. Web site: Empirical cumulative distribution function – MATLAB ecdf. mathworks.com. 2016-06-16.
  25. Web site: statsdirect.co.uk. Kaplan-Meier Survival Estimates. 12 May 2023.
  26. Web site: Kaplan-Meier method in SPSS Statistics Laerd Statistics.
  27. Web site: Kaplan-Meier · Survival.jl.
  28. Web site: Epi Info™ User Guide - Command Reference - Analysis Commands: KMSURVIVAL. 30 Oct 2023.