- Review
- Open Access
Statistics review 12: Survival analysis
- Viv Bewick^{1}Email author,
- Liz Cheek^{1} and
- Jonathan Ball^{2}
- Published: 6 September 2004
Abstract
This review introduces methods of analyzing data arising from studies where the response variable is the length of time taken to reach a certain end-point, often death. The Kaplan–Meier methods, log rank test and Cox's proportional hazards model are described.
Keywords
- Cox's proportional-hazards model
- cumulative hazard function H(t)
- hazard ratio
- Kaplan–Meier method
- log rank test
- survival function S(t)
Introduction
Survival times are data that measure follow-up time from a defined starting point to the occurrence of a given event, for example the time from the beginning to the end of a remission period or the time from the diagnosis of a disease to death. Standard statistical techniques cannot usually be applied because the underlying distribution is rarely Normal and the data are often 'censored'. A survival time is described as censored when there is a follow-up time but the event has not yet occurred or is not known to have occurred. For example, if remission time is being studied and the patient is still in remission at the end of the study, then that patient's remission time would be censored. If a patient for some reason drops out of a study before the end of the study period, then that patient's follow-up time would also be considered to be censored.
Survival time, age and outcome for a group of patients diagnosed with a disease and receiving one of two treatments
Patient number | Survival time (days) | Outcome | Treatment | Age (years) |
---|---|---|---|---|
1 | 1 | Died | 2 | 75 |
2 | 1 | Died | 2 | 79 |
3 | 4 | Died | 2 | 85 |
4 | 5 | Died | 2 | 76 |
5 | 6 | Unknown | 2 | 66 |
6 | 8 | Died | 1 | 75 |
7 | 9 | Survived | 2 | 72 |
8 | 9 | Died | 2 | 70 |
9 | 12 | Died | 1 | 71 |
10 | 15 | Unknown | 1 | 73 |
11 | 22 | Died | 2 | 66 |
12 | 25 | Survived | 1 | 73 |
13 | 37 | Died | 1 | 68 |
14 | 55 | Died | 1 | 59 |
15 | 72 | Survived | 1 | 61 |
Estimating the survival curve using the Kaplan–Meier method
In analyzing survival data, two functions that are dependent on time are of particular interest: the survival function and the hazard function. The survival function S(t) is defined as the probability of surviving at least to time t. The hazard function h(t) is the conditional probability of dying at time t having survived to that time.
The graph of S(t) against t is called the survival curve. The Kaplan–Meier method can be used to estimate this curve from the observed survival times without the assumption of an underlying probability distribution. The method is based on the basic idea that the probability of surviving k or more periods from entering the study is a product of the k observed survival rates for each period (i.e. the cumulative proportion surviving), given by the following:
S(k) = p_{1} × p_{2} × p_{3} × ... × p_{k}
Here, p_{1} is the proportion surviving the first period, p_{2} is the proportion surviving beyond the second period conditional on having survived up to the second period, and so on. The proportion surviving period i having survived up to period i is given by:
Where r_{i} is the number alive at the beginning of the period and d_{i} the number of deaths within the period.
Calculations for the Kaplan–Meier estimate of the survival function for the treatment 2 data from Table 1
Patient number | Survival time (days) | Number known to be alive (r_{i}) | Deaths (d_{i}) | Proportion surviving (p_{i}) | Cumulative proportion surviving (S [t]) |
---|---|---|---|---|---|
0 | 1 | ||||
1 | 1 | 8 | |||
2 | 1 | 8 | 2 | (8 - 2)/8 = 0.750 | 1 × 0.750 = 0.750 |
3 | 4 | 6 | 1 | (6 - 1)/6 = 0.833 | 0.750 × 0.833 = 0.625 |
4 | 5 | 5 | 1 | (5 - 1)/5 = 0.800 | 0.625 × 0.800 = 0.500 |
5 | 6+ | ||||
7 | 9 | 3 | 1 | (3 - 1)/3 = 0.667 | 0.500 × 0.667 = 0.333 |
8 | 9+ | ||||
11 | 22 | 1 | 1 | (1 - 1)/1 = 0.00 | 0.333 × 0.00 = 0.000 |
It can be seen that patients on treatment 1 appear to have a higher survival rate than those on treatment 2. The graph can be used to estimate the median survival time because this is the time with probability of survival of 0.5. The median survival time for those on treatment 2 appears to be 5 days versus about 37 days on treatment 1.
Comparing survival curves of two groups using the log rank test
Comparison of two survival curves can be done using a statistical hypothesis test called the log rank test. It is used to test the null hypothesis that there is no difference between the population survival curves (i.e. the probability of an event occurring at any time point is the same for each population). The test statistic is calculated as follows:
Where the O_{1} and O_{2} are the total numbers of observed events in groups 1 and 2, respectively, and E_{1} and E_{2} the total numbers of expected events.
Calculations for the log-rank test to compare treatments for the data in Table 1
Survival time (days) | Treatment group | Number known to be alive (r_{i}) | Deaths (d_{i}) | Risk for death (d_{i}/r_{i}) | Number known to be alive from treatment group 2 (r_{2i}) | Expected number of events in treatment group 2 (E_{2i}) |
---|---|---|---|---|---|---|
0 | ||||||
1 | 2 | 15 | 2 | 2/15 = 0.133 | 8 | 8 × 0.133 = 1.07 |
1 | 2 | |||||
4 | 2 | 13 | 1 | 1/13 = 0.077 | 6 | 6 × 0.077 = 0.46 |
5 | 2 | 12 | 1 | 1/12 = 0.083 | 5 | 5 × 0.083 = 0.42 |
6+ | 2 | 11 | 0 | 0/11 = 0 | 4 | 4 × 0 = 0.00 |
8 | 1 | 10 | 1 | 1/10 = 0.100 | 3 | 3 × 0.100 = 0.30 |
9 | 2 | 9 | 1 | 1/9 = 0.111 | 3 | 3 × 0.111 = 0.33 |
9+ | 2 | 8 | 0 | 0/8 = 0 | 2 | 2 × 0 = 0.00 |
12 | 1 | 7 | 1 | 1/7 = 0.143 | 1 | 1 × 0.143 = 0.14 |
15+ | 1 | 6 | 0 | 0/6 = 0 | 1 | 1 × 0 = 0.00 |
22 | 2 | 5 | 1 | 1/5 = 0.200 | 1 | 1 × 0.200 = 0.20 |
25+ | 1 | 4 | 0 | 0/4 = 0 | 0 | 0 × 0 = 0.00 |
37 | 1 | 3 | 1 | 1/3 = 0.333 | 0 | 0 × 0 = 0.00 |
55 | 1 | 2 | 1 | 1/2 = 0.500 | 0 | 0 × 0 = 0.00 |
72+ | 1 | |||||
E_{2} = 2.92 |
Where r_{2i} is the number alive from group 2 at the time of event i. E_{1} can be calculated as n - E_{2}, where n is the total number of events.
The test statistic is compared with a χ^{2} distribution with 1 degree of freedom. It is a simplified version of a statistic that is often calculated in statistical packages [2].
For the data in Table 1, the total number of expected deaths for treatment group 2 is calculated as 2.92 and the total number of observed deaths is 10, giving a total number of expected deaths for treatment group 1 of 10 - 2.92 = 7.08. The value of the test statistic is therefore calculated as follows:
This gives a P value of 0.032, which indicates a significant difference between the population survival curves.
An assumption for the log rank test is that of proportional hazards. This is discussed below. Small departures from this assumption, however, do not invalidate the test.
Cox's proportional hazards model (Cox regression)
The log rank test is used to test whether there is a difference between the survival times of different groups but it does not allow other explanatory variables to be taken into account.
Cox's proportional hazards model is analogous to a multiple regression model and enables the difference between survival times of particular groups of patients to be tested while allowing for other factors. In this model, the response (dependent) variable is the 'hazard'. The hazard is the probability of dying (or experiencing the event in question) given that patients have survived up to a given point in time, or the risk for death at that moment.
In Cox's model no assumption is made about the probability distribution of the hazard. However, it is assumed that if the risk for dying at a particular point in time in one group is, say, twice that in the other group, then at any other time it will still be twice that in the other group. In other words, the hazard ratio does not depend on time.
The model can be written as:
Where h(t) is the hazard at time t; x_{1}, x_{2}... x_{p} are the explanatory variables; and h_{0}(t) is the baseline hazard when all the explanatory variables are zero. The coefficients b_{1}, b_{2} ... b_{p} are estimated from the data using a statistical package.
Because hazard measures the instantaneous risk for death, it is difficult to illustrate it from sample data. Instead, the cumulative hazard function H(t) can be examined. This can be obtained from the cumulative survival function S(t) as follows:
H(t) = -ln S(t)
Cumulative hazard functions (logarithmic scale) for the example data
Survival time (days): t | Cumulative survival: S(t) | Cumulative hazard: H(t) = -ln S(t) |
---|---|---|
Treatment 1 | ||
8 | 0.8571 | 0.1542 |
12 | 0.7143 | 0.3365 |
15 | 0.7143 | 0.3365 |
25 | 0.7143 | 0.3365 |
37 | 0.4762 | 0.7419 |
55 | 0.2381 | 1.4351 |
72 | 0.2381 | 1.4351 |
Treatment 2 | ||
1 | ||
1 | 0.7500 | 0.2877 |
4 | 0.6250 | 0.4700 |
5 | 0.5000 | 0.6931 |
6 | 0.5000 | 0.6931 |
9 | 0.5000 | 0.6931 |
9 | 0.3333 | 1.0986 |
22 | 0.0000 |
Application of Cox's regression to the example data, using treatment and age as explanatory variables
Coefficient (b) | Standard error | P | e^{b} | 95.0% confidence interval for e^{b} | |
---|---|---|---|---|---|
Treatment | -1.887 | 0.973 | 0.052 | 0.152 | 0.022–1.020 |
Age | 0.220 | 0.085 | 0.010 | 1.247 | 1.054–1.474 |
The P values indicate that the difference between treatments was bordering on statistical significance, whereas there was strong evidence that age was associated with length of survival. The coefficient for treatment, -1.887, is the logarithm of the hazard ratio for a patient given treatment 1 compared with a patient given treatment 2 of the same age. The exponential (antilog) of this value is 0.152, indicating that a person receiving treatment 1 is 0.152 times as likely to die at any time as a patient receiving treatment 2; that is, the risk associated with treatment 1 appears to be much lower. However, the confidence interval contains 1, indicating that there may be no difference in risk associated with the two treatments.
Using the Kaplan–Meier (log rank) test, the P value for the difference between treatments was 0.032, whereas using Cox's regression, and including age as an explanatory variable, the corresponding P value was 0.052. This is not a substantial change and still suggests that a difference between treatments is likely. In this case age is clearly an important explanatory variable and should be included in the analysis.
The exponential of the coefficient for age, 1.247, indicates that a patient 1 year older than another patient, both being given the same treatment, has an increased risk for dying, by a factor of 1.247. Note that, in this case, the confidence interval does not contain 1, indicating the statistical significance of age.
Further models for survival data, allowing for different assumptions, are discussed by Kirkwood and Sterne [3].
An example from the literature
Results of Cox's proportional hazards analysis for the patients with bronchiectasis
Explanatory variables | Risk ratio | 95% confidence interval | P |
---|---|---|---|
Age (>65 years) | 2.7 | 1.15–6.29 | 0.022 |
LTOT (yes) | 3.12 | 1.47–6.90 | 0.003 |
Assumptions and limitations
The log rank test and Cox's proportional hazards model assume that the hazard ratio is constant over time. Care must be taken to check this assumption.
Conclusion
Survival analysis provides special techniques that are required to compare the risks for death (or of some other event) associated with different treatments or groups, where the risk changes over time. In measuring survival time, the start and end-points must be clearly defined and the censored observations noted. Only the most commonly used techniques are introduced in this review. Kaplan–Meier provides a method for estimating the survival curve, the log rank test provides a statistical comparison of two groups, and Cox's proportional hazards model allows additional covariates to be included. Both of the latter two methods assume that the hazard ratio comparing two groups is constant over time.
Declarations
Authors’ Affiliations
References
- Swinscow TDV, Campbell MJ: Statistics at Square One London: BMJ Books 2002.Google Scholar
- Armitage P, Berry G, Matthews JNS: Statistical Methods in Medical Research 4 Edition Oxford, UK: Blackwell Science 2002.View ArticleGoogle Scholar
- Kirkwood BR, Sterne JAC: Essential Medical Statistics 2 Edition Oxford, UK: Blackwell Science Ltd 2003.Google Scholar
- Dupont M, Gacouin A, Lena H, Lavoue S, Brinchault G, Delaval P, Thomas R: Survival of patients with bronchiectasis after the first ICU stay for respiratory failure. Chest 2004, 125: 1815-1820. 10.1378/chest.125.5.1815View ArticlePubMedGoogle Scholar