Parametric and Non-Parametric Estimation

Kaplan–Meier estimator

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.

The estimator of the survival function [math]S(t)[/math] (the probability that life is longer than [math]t[/math]) is given by:

[[math]] \widehat S(t) = \prod\limits_{i:\ t_i\le t} \left(1 - \frac{d_i}{n_i}\right),[[/math]]

with [math]t_i[/math] a time when at least one event happened, [math]d_i[/math] the number of events (e.g., deaths) that happened at time [math]t_i[/math], and [math] n_i[/math] the individuals known to have survived (have not yet had an event or been censored) up to time [math]t_i[/math].

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.[3]

Problem definition

Let [math]\tau\ge 0[/math] be a random variable, which we think of as the time that elapses between the start of the possible exposure period, [math]t_0[/math], and the time that an event of interest takes place, [math]t_1[/math]. As indicated above, the goal is to estimate the survival function [math]S[/math] underlying [math]\tau[/math]. Recall that this function is defined as

[[math]]S(t) = \operatorname{Prob}(\tau \gt t )[[/math]]

, where [math]t=0,1,\dots[/math] is the time.

Let [math]\tau_1,\dots,\tau_n\ge 0[/math] be independent, identically distributed random variables, whose common distribution is that of [math]\tau:\tau_j[/math] is the random time when some event [math]j[/math] happened. The data available for estimating [math]S[/math] is not [math](\tau_j)_{j=1,\dots,n}[/math], but the list of pairs [math](\, ( \tilde \tau_j, c_j )\, )_{j=1,\dots,n}[/math] where for [math]j\in [n] := \{1,2,\dots,n\}[/math], [math]c_j\ge 0[/math] is a fixed, deterministic integer, the censoring time of event [math]j[/math] and [math]\tilde \tau_j = \min(\tau_j,c_j)[/math]. In particular, the information available about the timing of event [math]j[/math] is whether the event happened before the fixed time [math]c_j[/math] and if so, then the actual time of the event is also available. The challenge is to estimate [math]S(t)[/math] 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 [math]k\in [n]:=\{1,\dots,n\}[/math] and let [math]t\gt0[/math]. A basic argument shows that the following proposition holds:

Proposition

If the censoring time [math]c_k[/math] of event [math]k[/math] exceeds [math]t[/math] ([math]c_k\ge t[/math]), then [math]\tilde \tau_k\ge t[/math] if and only if [math]\tau_k\ge t[/math].

Show Proof

Let [math]k[/math] be such that [math]c_k\ge t[/math]. It follows from the above proposition that

[[math]]\operatorname{Prob}(\tau_k\ge t) = \operatorname{Prob}(\tilde \tau_k\ge t).[[/math]]

Let [math] X_k = \mathbb{I}(\tilde \tau_k\ge t) [/math] and consider only those [math] k\in C(t) := \{ 1\le k \le n \,:\, c_k \ge t\} [/math], i.e. the events for which the outcome was not censored before time [math]t[/math]. Let [math] m(t)=|C(t)| [/math] be the number of elements in [math] C(t) [/math]. Note that the set [math] C(t) [/math] is not random and so neither is [math] m(t) [/math]. Furthermore, [math] (X_k)_{k\in C(t)} [/math] is a sequence of independent, identically distributed Bernoulli random variables with common parameter [math] S(t)=\operatorname{Prob}(\tau\ge t) [/math]. Assuming that [math] m(t)\gt0 [/math], this suggests to estimate [math]S(t)[/math] using

[[math]] \hat S_\text{naive}(t) = \frac{1}{m(t)} \sum_{k:c_k\ge t} X_k = \frac{|\{1\le k \le n\,:\, \tilde \tau_k\ge t\}|}{|\{1\le k \le n\,:\, c_k\ge t\}|} = \frac{|\{1\le k \le n\,:\, \tilde \tau_k\ge t\}|}{m(t)}, [[/math]]

where the second equality follows because [math] \tilde \tau_k\ge t [/math] implies [math] c_k\ge t [/math], while the last equality is simply a change of notation.


The quality of this estimate is governed by the size of [math]m(t)[/math]. This can be problematic when [math]m(t)[/math] 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 [math]t[/math]. Intuitively, these observations still contain information about [math]S(t)[/math]: For example, when for many events with [math]c_k \lt t [/math], [math]\tilde \tau_k \lt c_k [/math] also holds, we can infer that events often happen early, which implies that [math]\operatorname{Prob}(\tau\le t)[/math] is large, which, through [math]S(t) = 1-\operatorname{Prob}(\tau\le t)[/math] means that [math]S(t)[/math] 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,

[[math]] \begin{align} S(t) & = \operatorname{Prob}(\tau \gt t\mid\tau \gt t-1)\operatorname{Prob}(\tau \gt t-1) \\[4pt] & = (1-\operatorname{Prob}(\tau\le t\mid\tau \gt t-1)) \operatorname{Prob}(\tau \gt t-1)\\[4pt] & = (1-\operatorname{Prob}(\tau=t\mid\tau \ge t)) \operatorname{Prob}(\tau \gt t-1) \\[4pt] & = q(t) S(t-1)\,, \end{align} [[/math]]

where the second to last equality used that [math]\tau[/math] is integer valued and for the last line we introduced

[[math]]q(t) = 1-\operatorname{Prob}(\tau=t\mid\tau\ge t).[[/math]]

By a recursive expansion of the equality [math]S(t) = q(t) S(t-1)[/math], we get

[[math]] S(t) = q(t) q(t-1) \cdots q(0). [[/math]]

Note that here [math]q(0) = 1-\operatorname{Prob}(\tau=0\mid\tau \gt -1) = 1-\operatorname{Prob}(\tau=0)[/math].

The Kaplan–Meier estimator can be seen as a "plug-in estimator" where each [math] q(s) [/math] is estimated based on the data and the estimator of [math] S(t) [/math] is obtained as a product of these estimates.

It remains to specify how [math]q(s)=1-\operatorname{Prob}(\tau=s\mid\tau\ge s)[/math] is to be estimated. By Proposition 1, for any [math]k\in [n][/math] such that [math]c_k\ge s[/math], [math]\operatorname{Prob}(\tau=s) = \operatorname{Prob}(\tilde \tau_k=s)[/math] and [math]\operatorname{Prob}(\tau\ge s) = \operatorname{Prob}(\tilde \tau_k\ge s)[/math] both hold. Hence, for any [math] k\in [n] [/math] such that [math] c_k\ge s [/math],

[[math]] \operatorname{Prob}(\tau=s|\tau\ge s) = \operatorname{Prob}(\tilde \tau_k=s)/\operatorname{Prob}(\tilde \tau_k\ge s). [[/math]]

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

[[math]]\hat q(s) = 1 - \frac{|\{1\le k\le n\,:\, c_k\ge s, \tilde \tau_k=s\}|}{|\{1\le k \le n\,:\, c_k\ge s, \tilde \tau_k\ge s\}|} = 1 - \frac{|\{1\le k\le n\,:\,\tilde \tau_k=s\}|}{|\{1\le k \le n\,:\, \tilde \tau_k\ge s\}|}[[/math]]

(think of estimating the numerator and denominator separately in the definition of the "hazard rate" [math]\operatorname{Prob}(\tau=s|\tau\ge s)[/math]). The Kaplan–Meier estimator is then given by

[[math]]\hat S(t) = \prod_{s=0}^t \hat q(s). [[/math]]

The form of the estimator stated at the beginning of the article can be obtained by some further algebra. For this, write [math]\hat q(s)=1-d(s)/n(s)[/math] where, using the actuarial science terminology, [math]d(s)=|\{1\le k\le n\,:\,\tau_k=s\}|[/math] is the number of known deaths at time [math]s[/math], while [math]n(s)=|\{1\le k \le n\,:\, \tilde \tau_k\ge s\}|[/math] is the number of those persons who are alive (and not being censored) at time [math]s-1[/math].

Note that if [math]d(s)=0[/math], [math]\hat q(s)=1[/math]. This implies that we can leave out from the product defining [math]\hat S(t)[/math] all those terms where [math]d(s)=0[/math]. Then, letting [math]0\le t_1 \lt t_2\lt\dots \lt t_m[/math] be the times [math]s[/math] when [math]d(s)\gt0[/math], [math]d_i = d(t_i)[/math] and [math]n_i = n(t_i)[/math], we arrive at the form of the Kaplan–Meier estimator given at the beginning of the article:

[[math]]\hat S(t) = \prod_{i:t_i\le t} \left(1-\frac{d_i}{n_i}\right). [[/math]]

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.[4][self-published source?] More specifically given [math]d_i[/math] as the number of events and [math] n_i[/math] the total individuals at risk at time [math] t_i[/math], discrete hazard rate [math] h_i[/math] can be defined as the probability of an individual with an event at time [math] t_i[/math]. Then survival rate can be defined as:

[[math]] S(t) = \prod\limits_{i:\ t_i\le t} (1-h_i)[[/math]]

and the likelihood function for the hazard function up to time [math] t_i[/math] is:

[[math]] \mathcal{L}(h_{j: j\le i}\mid d_{j: j\le i},n_{j: j\le i}) = \prod_{j=1}^i h_j^{d_j}(1-h_j)^{n_j-d_j} {n_j \choose d_j} [[/math]]

therefore the log likelihood will be:

[[math]] \log(\mathcal{L}) = \sum_{j=1}^i \left(d_j\log(h_j)+(n_j-d_j)\log(1-h_j) + \log {n_j \choose d_j} \right)[[/math]]

finding the maximum of log likelihood with respect to [math] h_i[/math] yields:

[[math]] \frac{\partial \log(\mathcal{L})}{\partial h_i} = \frac{d_i}{\widehat{h}_i}-\frac{n_i-d_i}{1-\widehat{h}_i} = 0 \Rightarrow \widehat{h}_i=\frac{d_i}{n_i} [[/math]]

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

[[math]] \widehat S(t) = \prod\limits_{i:\ t_i\le t} \left(1 - \widehat{h}_i\right) = \prod\limits_{i:\ t_i\le t} \left(1 - \frac{d_i}{n_i}\right)[[/math]]

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

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:[6]

[[math]] \widehat{\operatorname{Var}} \left( \widehat S(t) \right) = \widehat S(t)^2 \sum_{i:\ t_i\le t} \frac{d_i}{n_i(n_i-d_i)},[[/math]]

where [math] d_i [/math] is the number of cases and [math]n_i[/math] is the total number of observations, for [math]t_i \lt t[/math].

Nelson–Aalen estimator

The Nelson–Aalen estimator is a non-parametric estimator of the cumulative hazard rate function. The estimator is given by

[[math]]\hat{H}(t)=\sum_{t_i\leq t}\frac{d_i}{n_i},[[/math]]

with [math]d_i[/math] the number of events up to [math]t_i[/math] and [math]n_i[/math] the total individuals at risk at [math]t_i[/math].[7] The estimate for the survival function is then

[[math]] \hat{S}(t) = \exp(-\hat{H}(t)) = \exp\left(-\sum_{t_i\leq t}\frac{d_i}{n_i}\right). [[/math]]

Wikipedia Referencs

  • Wikipedia contributors. "Kaplan–Meier estimator". Wikipedia. Wikipedia. Retrieved 14 January 2024.
  • Wikipedia contributors. "Nelson–Aalen estimator". Wikipedia. Wikipedia. Retrieved 14 January 2024.

References

  1. "Nonparametric estimation from incomplete observations" (1958). J. Amer. Statist. Assoc. 53 (282): 457–481. doi: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. "A practical guide to understanding Kaplan-Meier curves" (September 2010). Otolaryngology–Head and Neck Surgery 143 (3): 331–336. doi:10.1016/j.otohns.2010.05.007. PMID 20723767. 
  4. "STAT331 Unit 3" (PDF). Retrieved 12 May 2023.
  5. Andersen, Per Kragh; Borgan, Ornulf; Gill, Richard D.; Keiding, Niels (1993). Statistical models based on counting processes. New York: Springer-Verlag. ISBN 0-387-97872-0.
  6. Greenwood, Major (1926). A report on the natural duration of cancer. Issue 33 of Reports on public health and medical subjects. HMSO. OCLC 14713088.
  7. "Kaplan–Meier Survival Estimates".