---
tag: W94W93RHF5
kind: definition
name: Kaplan–Meier estimator
msc: [62N02, 62G05, 62P10]
defines: B7AJ8RWZRC
uses: [QTM1HZM53Q, MY8ZZP84NP, 0SSS6ERQ0S, A05WR6TEK5]
sources:
  - url: https://en.wikipedia.org/wiki/Kaplan–Meier_estimator
---

## Definition

Let $(\tilde t_1, \delta_1), \dots, (\tilde t_n, \delta_n)$ be right-[[censored|MY8ZZP84NP]] observations of a lifetime.
Here $\tilde t_i \ge 0$ is the observed time, and $\delta_i = 1$ if it is an event and $\delta_i = 0$ if it is censored.
Let $t_{(1)} < \dots < t_{(m)}$ be the distinct times $\tilde t_i$ with $\delta_i = 1$.
For each $j$, let $d_j = \#\set{i : \tilde t_i = t_{(j)}, \delta_i = 1}$ be the number of events at $t_{(j)}$ and $n_j = \#\set{i : \tilde t_i \ge t_{(j)}}$ the number at risk just before $t_{(j)}$.
The *Kaplan–Meier estimator* of the [[survival function|QTM1HZM53Q]] is
$$\hat S(t) = \prod_{j \,:\, t_{(j)} \le t} \left(1 - \frac{d_j}{n_j}\right), \qquad t \ge 0,$$
with the empty product equal to $1$.

## Remarks

It is also called the product-limit [[estimator|0SSS6ERQ0S]].
Its variance is usually estimated by Greenwood's formula $\hat S(t)^2 \sum_{j : t_{(j)} \le t} d_j / (n_j (n_j - d_j))$.
If no observation is censored, $\hat S(t) = 1 - \hat F_n(t)$, where $\hat F_n$ is the [[empirical distribution function|A05WR6TEK5]].

Example: take the observations $2, 3^+, 5, 7$, where $3^+$ is censored.
Then $(n_j, d_j)$ is $(4, 1)$ at $2$, $(2, 1)$ at $5$ and $(1, 1)$ at $7$.
So $\hat S = 1$ on $[0, 2)$, $3/4$ on $[2, 5)$, $3/8$ on $[5, 7)$ and $0$ from $7$ on.

Non-example: dropping the censored observation and using $1 - \hat F_3$ on $2, 5, 7$ gives $1/3$ on $[5, 7)$ instead of $3/8$.
This ignores the information that the censored subject survived past $3$, and it is biased downwards in general.
