{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $(\\tilde t_1, \\delta_1), \\dots, (\\tilde t_n, \\delta_n)$ be right-[[censored|MY8ZZP84NP]] observations of a lifetime.\nHere $\\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.\nLet $t_{(1)} \u003c \\dots \u003c t_{(m)}$ be the distinct times $\\tilde t_i$ with $\\delta_i = 1$.\nFor 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)}$.\nThe *Kaplan–Meier estimator* of the [[survival function|QTM1HZM53Q]] is\n$$\\hat S(t) = \\prod_{j \\,:\\, t_{(j)} \\le t} \\left(1 - \\frac{d_j}{n_j}\\right), \\qquad t \\ge 0,$$\nwith the empty product equal to $1$.\n\n## Remarks\n\nIt is also called the product-limit [[estimator|0SSS6ERQ0S]].\nIts 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))$.\nIf no observation is censored, $\\hat S(t) = 1 - \\hat F_n(t)$, where $\\hat F_n$ is the [[empirical distribution function|A05WR6TEK5]].\n\nExample: take the observations $2, 3^+, 5, 7$, where $3^+$ is censored.\nThen $(n_j, d_j)$ is $(4, 1)$ at $2$, $(2, 1)$ at $5$ and $(1, 1)$ at $7$.\nSo $\\hat S = 1$ on $[0, 2)$, $3/4$ on $[2, 5)$, $3/8$ on $[5, 7)$ and $0$ from $7$ on.\n\nNon-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$.\nThis ignores the information that the censored subject survived past $3$, and it is biased downwards in general.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "B7AJ8RWZRC",
    "kind": "definition",
    "msc": [
      "62N02",
      "62G05",
      "62P10"
    ],
    "name": "Kaplan–Meier estimator",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Kaplan–Meier_estimator"
      }
    ],
    "tag": "W94W93RHF5",
    "uses": [
      "QTM1HZM53Q",
      "MY8ZZP84NP",
      "0SSS6ERQ0S",
      "A05WR6TEK5"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/W94W93RHF5/",
  "links": [
    {
      "field": "defines",
      "target": "B7AJ8RWZRC"
    },
    {
      "field": "uses",
      "target": "QTM1HZM53Q"
    },
    {
      "field": "uses",
      "target": "MY8ZZP84NP"
    },
    {
      "field": "uses",
      "target": "0SSS6ERQ0S"
    },
    {
      "field": "uses",
      "target": "A05WR6TEK5"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/W94W93RHF5.md",
  "msc": [
    "62N02",
    "62G05",
    "62P10"
  ],
  "name": "Kaplan–Meier estimator",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/W94/W94W93RHF5.md",
  "status": null,
  "tag": "W94W93RHF5",
  "uri": "m2://W94W93RHF5",
  "url": "https://tamnd.github.io/math2/wiki/kaplan-meier-estimator-definition/",
  "writing": {
    "tag": "W94W93RHF5",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
