Kaplan–Meier estimator

From Wikipedia, the free encyclopedia
Jump to: navigation, search
An example of a Kaplan–Meier plot for two conditions associated with patient survival.

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. The journal editor, John Tukey, convinced them to combine their work into one paper, which has been cited about 34,000 times since its publication.[4]

Basic concepts[edit]

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 indicate 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 more quickly 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.

In order 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.[5]

Benefits and limitations[edit]

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.

Statistical considerations[edit]

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

In some cases, one may wish to compare different Kaplan–Meier curves. This may be done by several methods including:

Other statistics that may be of use with this estimator are the Hall-Wellner band[7] and the equal-precision band.[8]


  • SAS: The Kaplan–Meier estimator is implemented in the proc lifetest procedure.[9]
  • R: the Kaplan–Meier estimator is available as part of the survival package.[10][11][12]
  • Stata: the command sts returns the Kaplan–Meier estimator.[13][14]
  • Python: the lifelines package includes the Kaplan–Meier estimator.[15]
  • MATLAB: the ecdf function with the 'function','survivor' arguments can calculate or plot the Kaplan–Meier estimator.[16]

Example calculation[edit]

The survival function S(t) is the probability that the lifetime of a member of a given population will be greater than the time t. The Kaplan–Meier estimator is a non-parametric estimator of the survival function. Hosmer and Lemeshow [17] describe the Kaplan–Meier estimator as follows. "This estimator incorporates information from all of the observations available, both uncensored and censored, by considering survival to any point in time as a series of steps defined by the observed survival and censored times. It is analogous to considering a toddler who must take five steps to walk from a chair to a table. This journey of five steps must begin with one successful step. The second step can only be taken if the first was successful. The third step can be taken only if the second (and also the first) was successful. Finally, the fifth step is possible only if the previous four were completed successfully. In an analysis of survival time, we estimated the conditional probabilities of "successful steps" and then multiply them together to obtain an estimate of the overall survivorship function."

Collett [18] describes the calculation of the Kaplan–Meier estimate as follows. "To obtain the Kaplan-Meier estimate, a series of time intervals is constructed … Each of these time intervals is designed to be such that one death time is contained in the interval, and this death time is taken to occur at the start of the interval. As an illustration, suppose that t(1), t(2), and t(3) are three observed survival times arranged in rank order, so that t(1) < t(2) < t(3) and that c is a censored survival time that falls between t(2), and t(3). The constructed intervals than begin at times t(1), t(2), and t(3), and each interval includes one death time, although there could be more than one individual who dies at any particular time. Notice that no interval begins at the censored time of c. Now suppose that two individuals die at t(1), one dies at t(2), and three die at t(3). The situation is illustrated diagrammatically in Figure 2.3 [the basis for the figure below], in which D represents a death and C a censored survival time."

Kaplan-Meier intervals

"The time origin is denoted by t0, and so there is an initial period commencing at t0, which ends just before t(1), the time of the first death. This means that the interval from t0 to t(1) will not include a death time. The first constructed interval extends from t1 to just before t2, and since the second death time is at t(2), this interval includes the single death time at t(1). The second interval begins at time t(2), and ends just before t(3), and includes the death time t(2) and the censored time c. There is also a third interval beginning at t(3), which contains the longest survival time, t(3)." [18]

"In general, suppose that there are n individuals with observed survival times t(1), t(2), ..., t(n). Some of these observations may be right censored, and there may also be more than one individual with the same observed survival time. We therefore suppose that there are r death times amongst the individuals, where rn. After arranging these death times in ascending order, the jth is denoted t(j), for j = 1, 2, …, r, and so the r ordered death times are t(1) < t(2) < t(r). The number of individuals who are alive just before time t(j), including those who are about to die at this time, will be denoted n(j), for j = 1, 2, …, r, and d(j) will denote the number who die at this time…" [18]

"It sometimes happens that there are censored survival times that occur at the same time as one or more deaths, so that a death time and a censored survival time appear to occur simultaneously. In this situation, the censored time is taken to occur immediately after the death time when computing the value of [the number at risk] n(j)." [18]

Tableman and Kim [19] give the following example. The data are time to relapse for acute myelogenous leukemia patients in a clinical trial. The data set aml is available in the R package "survival" and from the publisher's website (www.crcpress.com). For this example, only the 11 patients receiving extended treatment ("Maintained") are included. The weeks to relapse for the 11 patients were 9, 13, 13+, 18, 23, 28+, 31, 34, 45+, 48, and 161+ weeks, where the + sign indicates a censored observation. The Kaplan-Meier plot for these subjects is shown in the graph.

KM plot for aml Maintained group

The Kaplan-Meier estimate for the aml data is constructed as follows. For the purpose of this example, the notation t(j) for death times and d(j) for number of deaths should be interpreted as relapse. The figure shows the time origin t0 and the death times t(1), t(2), … , t(7). The death (relapse) times are indicated above the line, as are the times of censoring. The intervals t(1), t(2), … , t(7) are indicated below the line. Notice that each interval begins with a death. The censored observations at 28+, 45+, and 161+ weeks do not mark the beginning of an interval. The censored observation at 13+ weeks occurs at the same time as a death at 13 weeks, which marks the beginning of interval t(2). The number of censored observations in interval t(j) is indicated by c(j).

aml relapse intervals

To calculate the Kaplan-Meier estimate, it is useful to lay out the aml data as shown in a table of ordered time intervals.[20]

Time interval Start of interval (weeks) Number of deaths in interval Number of censored in interval Number at risk in interval
0 0 0 0 11
1 9 1 0 11
2 13 1 1 10
3 18 1 0 8
4 23 1 1 7
5 31 1 0 5
6 34 1 1 4
7 48 1 1 2

Column 1 in the table gives the ordered death times, to , plus the time origin, .

Column 2 gives the start of in weeks.

Column 3 is , the number of deaths in the interval.

Column 4 is , the number censored in the interval.

Columns 5 shows the number of subjects at risk at the start of the interval. The number at risk in the interval is , that is, the number at risk in the previous interval, minus losses due to death or censoring.

Time : 0 weeks

At the time origin , all 11 subjects are alive, and the estimated probability of surviving past is 1.

Time : 9 weeks

Next consider the time No deaths occur in the interval from t0 to just before . No subjects are censored in the interval from t0 to just before . At time , = 11 patients are at risk = 1 patient dies

The probability of surviving past the , given that the subject survived up to , is therefore the proportion of the at-risk subjects who survive:

is called a conditional probability: it is conditional on the subject having survived up to . For the aml data, the probability that the subject survived up to is the probability that they survived past , which is :

The Kaplan-Meier estimate of the probability that a subject will survive past time t1 is then

The first death time is at t(1) = 9 weeks. So the probability that a subject will survive past 9 weeks is

Time : 13 weeks

Next consider the time One death occurs in the interval from to just before . No subjects are censored in the interval from to just before . At time , = 10 patients are at risk = 1 patient dies

The probability of surviving past the , given that the subject survived up to , is therefore the proportion

Again, is a conditional probability: it is conditional on the subject having survived up to . For the aml data, the probability that the subject survived up to is the probability that they survived past , which was just calculated:

The Kaplan-Meier estimate of the probability that a subject will survive past time is then

Because , this equation can be re-written as

The second death time is at = 13 weeks. So the probability that a subject will survive past 13 weeks is .

Time : 18 weeks

Next consider time . The calculation for time , at week 18, requires accounting for the one subject who was censored at week 13. That subject is no longer in the risk set at week 18. As shown in the table of ordered time intervals above, the number at risk in the interval is calculated by subjects at risk. Of the original 11 subjects, there are 2 deaths and 1 censored before t3, leaving the 8 at risk. Again:

As before, is a conditional probability: it is conditional on the subject having survived up to . The probability that the subject survived up to is the probability that they survived past :

The Kaplan-Meier estimate of the probability that a subject will survive past time is then

Because , this equation can be re-written as

The third death time is at weeks. So the probability that a subject will survive past 18 weeks is 0.716.

Time : up to 161 weeks

The calculation of the Kaplan-Meier estimates for all the times to are shown in the table.

Weeks at risk deaths
0 0 11 0 1.000 1.000
1 9 11 1 0.909 0.909
2 13 10 1 0.900 0.818
3 18 8 1 0.875 0.716
4 23 7 1 0.857 0.614
5 31 5 1 0.800 0.491
6 34 4 1 0.750 0.368
7 48 2 1 0.500 0.184

From these examples, it can be seen that the Kaplan-Meier estimate can be calculated as

The graph shows the intervals and the Kaplan-Meier estimate of survival for each interval.

aml km intervals plot

Finally, these estimates are displayed in a Kaplan-Meier plot as shown below, to which the estimate for each interval has been added. Censored subjects are indicated on the graph by a +, visible at weeks 28, 45, and 161.

aml KM with estimates

When there is no censoring, is simply the number of survivors just prior to time . With censoring, is the number of survivors minus the number of losses (censored cases). It is only those surviving cases that are still being observed (have not yet been censored) that are "at risk" of an (observed) death.[21]

There is an alternative definition that is sometimes used, namely

The two definitions differ only at the observed event times. The first definition is right-continuous whereas the alternative definition is left-continuous.

Let be the random variable that measures the time of failure and let be its cumulative distribution function. Note that

Consequently, the right-continuous definition of may be preferred in order to make the estimate compatible with a right-continuous estimate of .

See also[edit]


  1. ^ Kaplan, E. L.; Meier, P. (1958). "Nonparametric estimation from incomplete observations". J. Amer. Statist. Assn. 53 (282): 457–481. doi:10.2307/2281868. JSTOR 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". Econometrica. 58 (4): 757–782. doi:10.2307/2938349. 
  4. ^ "Paul Meier, 1924–2011". Chicago Tribune. August 18, 2011. 
  5. ^ Rich JT, Neely JG, Paniello RC, Voelker CC, Nussenbaum B, Wang EW (2010). "A practical guide to understanding Kaplan–Meier curves.". Otolaryngol Head Neck Surg. 143 (3): 331–6. doi:10.1016/j.otohns.2010.05.007. PMC 3932959Freely accessible. PMID 20723767. 
  6. ^ Greenwood, M. (1926). "The natural duration of cancer". Reports on Public Health and Medical Subjects. London: Her Majesty's Stationery Office. 33: 1–26. 
  7. ^ Hall WJ and Wellner JA (1980) Confidence bands for a survival curve for censored data. Biometrika 69
  8. ^ Nair VN (1984) Confidence bands for survival functions with censored data: A comparative study. Technometrics 26: 265–275
  9. ^ The LIFETEST Procedure
  10. ^ "survival: Survival Analysis". R Project. 
  11. ^ Willekens, Frans (2014). "The Survival Package". Multistate Analysis of Life Histories with R. Springer. pp. 135–153. doi:10.1007/978-3-319-08383-4_6. ISBN 978-3-319-08383-4. 
  12. ^ Chen, Ding-Geng; Peace, Karl E. (2014). Clinical Trial Data Analysis Using R. CRC Press. pp. 99–108. 
  13. ^ "sts — Generate, graph, list, and test the survivor and cumulative hazard functions" (PDF). Stata Manual. 
  14. ^ Cleves, Mario (2008). An Introduction to Survival Analysis Using Stata (Second ed.). College Station: Stata Press. pp. 93–107. ISBN 1-59718-041-6. 
  15. ^ "lifelines". .
  16. ^ "Empirical cumulative distribution function - MATLAB ecdf". mathworks.com. Retrieved 2016-06-16. 
  17. ^ Hosmer, David; Lemeshow, Stanley (1999), Applied Survival Analysis: Regression Modeling of Time to Event Data (First ed.), Wiley 
  18. ^ a b c d Collett, David (2014), Modelling Survival Data in Medical Research (Third ed.), Chapman & Hall/CRC, ISBN 978-1439856789 
  19. ^ Tableman, Mara; Kim, Jong Sung (2003), Survival Analysis Using S (First ed.), Chapman and Hall/CRC, ISBN 978-1584884088 
  20. ^ Kleinbaum, David G.; Klein, Mitchel (2012), Survival analysis: A Self-learning text (Third ed.), Springer, ISBN 978-1441966452 
  21. ^ Costella, John P. (2010). "A simple alternative to Kaplan–Meier for survival curves" (PDF). Unpublished. 

Further reading[edit]

External links[edit]