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]
The estimator of the survival function (the probability that life is longer than ) is given by:
with a time when at least one event happened, di the number of events (e.g., deaths) that happened at time , and the individuals known to have survived (have not yet had an event or been censored) up to time .
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]
Let be a random variable, which we think of as the time that elapses between the start of the possible exposure period, , and the time that an event of interest takes place, . As indicated above, the goal is to estimate the survival function underlying . Recall that this function is defined as
Let be independent, identically distributed random variables, whose common distribution is that of : is the random time when some event happened. The data available for estimating is not , but the list of pairs where for , is a fixed, deterministic integer, the censoring time of event and . In particular, the information available about the timing of event is whether the event happened before the fixed time and if so, then the actual time of the event is also available. The challenge is to estimate given this data.
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.
To understand the power of the KaplanâMeier estimator, it is worthwhile to first describe a naive estimator of the survival function.
Fix and let . A basic argument shows that the following proposition holds:
Let be such that . It follows from the above proposition that
Let and consider only those , i.e. the events for which the outcome was not censored before time . Let be the number of elements in . Note that the set is not random and so neither is . Furthermore, is a sequence of independent, identically distributed Bernoulli random variables with common parameter . Assuming that , this suggests to estimate using
where the second equality follows because implies , while the last equality is simply a change of notation.
The quality of this estimate is governed by the size of . This can be problematic when 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 . Intuitively, these observations still contain information about : For example, when for many events with , also holds, we can infer that events often happen early, which implies that is large, which, through means that 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.
By elementary calculations,
where the second to last equality used that is integer valued and for the last line we introduced
By a recursive expansion of the equality , we get
Note that here .
The KaplanâMeier estimator can be seen as a "plug-in estimator" where each is estimated based on the data and the estimator of is obtained as a product of these estimates.
It remains to specify how is to be estimated. By Proposition 1, for any such that , and both hold. Hence, for any such that ,
By a similar reasoning that lead to the construction of the naive estimator above, we arrive at the estimator
(think of estimating the numerator and denominator separately in the definition of the "hazard rate" ). The KaplanâMeier estimator is then given by
The form of the estimator stated at the beginning of the article can be obtained by some further algebra. For this, write where, using the actuarial science terminology, is the number of known deaths at time , while is the number of those persons who are alive (and not being censored) at time .
Note that if , . This implies that we can leave out from the product defining all those terms where . Then, letting be the times when , and , we arrive at the form of the KaplanâMeier estimator given at the beginning of the article:
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.
KaplanâMeier estimator can be derived from maximum likelihood estimation of the discrete hazard function. [8][ self-published source?] More specifically given as the number of events and the total individuals at risk at time , discrete hazard rate can be defined as the probability of an individual with an event at time . Then survival rate can be defined as:
and the likelihood function for the hazard function up to time is:
therefore the log likelihood will be:
finding the maximum of log likelihood with respect to yields:
where hat is used to denote maximum likelihood estimation. Given this result, we can write:
More generally (for continuous as well as discrete survival distributions), the Kaplan-Meier estimator may be interpreted as a nonparametric maximum likelihood estimator. [9]
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]
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]
where is the number of cases and is the total number of observations, for .
Greenwood's formula is derived [12][ self-published source?] by noting that probability of getting failures out of cases follows a binomial distribution with failure probability . As a result for maximum likelihood hazard rate we have and . To avoid dealing with multiplicative probabilities we compute variance of logarithm of and will use the delta method to convert it back to the original variance:
using martingale central limit theorem, it can be shown that the variance of the sum in the following equation is equal to the sum of variances: [12]
as a result we can write:
using the delta method once more:
as desired.
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, [13] the Hall-Wellner band [14] and the equal-precision band. [15]
SurvivalModelFit
creates survival models.
[16]proc lifetest
procedure.
[17]survival
package.
[18]
[19]
[20]sts
returns the KaplanâMeier estimator.
[21]
[22]lifelines
and scikit-survival
packages each include the KaplanâMeier estimator.
[23]
[24]ecdf
function with the 'function','survivor'
arguments can calculate or plot the KaplanâMeier estimator.
[25]Survival Analysis
menu.
[26]Analyze > Survival > Kaplan-Meier...
menu.
[27]Survival.jl
package includes the KaplanâMeier estimator.
[28]KMSURVIVAL
command.
[29]
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]
The estimator of the survival function (the probability that life is longer than ) is given by:
with a time when at least one event happened, di the number of events (e.g., deaths) that happened at time , and the individuals known to have survived (have not yet had an event or been censored) up to time .
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]
Let be a random variable, which we think of as the time that elapses between the start of the possible exposure period, , and the time that an event of interest takes place, . As indicated above, the goal is to estimate the survival function underlying . Recall that this function is defined as
Let be independent, identically distributed random variables, whose common distribution is that of : is the random time when some event happened. The data available for estimating is not , but the list of pairs where for , is a fixed, deterministic integer, the censoring time of event and . In particular, the information available about the timing of event is whether the event happened before the fixed time and if so, then the actual time of the event is also available. The challenge is to estimate given this data.
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.
To understand the power of the KaplanâMeier estimator, it is worthwhile to first describe a naive estimator of the survival function.
Fix and let . A basic argument shows that the following proposition holds:
Let be such that . It follows from the above proposition that
Let and consider only those , i.e. the events for which the outcome was not censored before time . Let be the number of elements in . Note that the set is not random and so neither is . Furthermore, is a sequence of independent, identically distributed Bernoulli random variables with common parameter . Assuming that , this suggests to estimate using
where the second equality follows because implies , while the last equality is simply a change of notation.
The quality of this estimate is governed by the size of . This can be problematic when 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 . Intuitively, these observations still contain information about : For example, when for many events with , also holds, we can infer that events often happen early, which implies that is large, which, through means that 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.
By elementary calculations,
where the second to last equality used that is integer valued and for the last line we introduced
By a recursive expansion of the equality , we get
Note that here .
The KaplanâMeier estimator can be seen as a "plug-in estimator" where each is estimated based on the data and the estimator of is obtained as a product of these estimates.
It remains to specify how is to be estimated. By Proposition 1, for any such that , and both hold. Hence, for any such that ,
By a similar reasoning that lead to the construction of the naive estimator above, we arrive at the estimator
(think of estimating the numerator and denominator separately in the definition of the "hazard rate" ). The KaplanâMeier estimator is then given by
The form of the estimator stated at the beginning of the article can be obtained by some further algebra. For this, write where, using the actuarial science terminology, is the number of known deaths at time , while is the number of those persons who are alive (and not being censored) at time .
Note that if , . This implies that we can leave out from the product defining all those terms where . Then, letting be the times when , and , we arrive at the form of the KaplanâMeier estimator given at the beginning of the article:
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.
KaplanâMeier estimator can be derived from maximum likelihood estimation of the discrete hazard function. [8][ self-published source?] More specifically given as the number of events and the total individuals at risk at time , discrete hazard rate can be defined as the probability of an individual with an event at time . Then survival rate can be defined as:
and the likelihood function for the hazard function up to time is:
therefore the log likelihood will be:
finding the maximum of log likelihood with respect to yields:
where hat is used to denote maximum likelihood estimation. Given this result, we can write:
More generally (for continuous as well as discrete survival distributions), the Kaplan-Meier estimator may be interpreted as a nonparametric maximum likelihood estimator. [9]
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]
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]
where is the number of cases and is the total number of observations, for .
Greenwood's formula is derived [12][ self-published source?] by noting that probability of getting failures out of cases follows a binomial distribution with failure probability . As a result for maximum likelihood hazard rate we have and . To avoid dealing with multiplicative probabilities we compute variance of logarithm of and will use the delta method to convert it back to the original variance:
using martingale central limit theorem, it can be shown that the variance of the sum in the following equation is equal to the sum of variances: [12]
as a result we can write:
using the delta method once more:
as desired.
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, [13] the Hall-Wellner band [14] and the equal-precision band. [15]
SurvivalModelFit
creates survival models.
[16]proc lifetest
procedure.
[17]survival
package.
[18]
[19]
[20]sts
returns the KaplanâMeier estimator.
[21]
[22]lifelines
and scikit-survival
packages each include the KaplanâMeier estimator.
[23]
[24]ecdf
function with the 'function','survivor'
arguments can calculate or plot the KaplanâMeier estimator.
[25]Survival Analysis
menu.
[26]Analyze > Survival > Kaplan-Meier...
menu.
[27]Survival.jl
package includes the KaplanâMeier estimator.
[28]KMSURVIVAL
command.
[29]