NAG Library Chapter Introduction
G12 – Survival Analysis
1 Scope of the Chapter
This chapter is concerned with statistical techniques used in the analysis of survival/reliability/failure time data.
Other chapters contain routines which are also used to analyse this type of data. Chapter G02
contains generalized linear models, Chapter G07
contains routines to fit distribution models, and
contains rank based methods.
2 Background to the Problems
2.1 Introduction to Terminology
This chapter is concerned with the analysis on the time,
, to a single event. This type of analysis occurs commonly in two areas. In medical research it is known as survival analysis and is often the time from the start of treatment to the occurrence of a particular condition or of death. In engineering it is concerned with reliability and the analysis of failure times, that is how long a component can be used until it fails. In this chapter the time will be referred to as the failure time.
Let the probability density function of the failure time be
, then the survivor function
, which is the probability of surviving to at least time
, is given by
is the cumulative density function. The
, is the probability that failure occurs at time
given that the individual survived up to time
, and is given by
The cumulative hazard
rate is defined as
It is common in survival analysis for some of the data to be
right-censored. That is, the exact failure time is not known, only that failure occurred after a known time. This may be due to the experiment being terminated before all the individuals have failed, or an individual being removed from the experiment for a reason not connected with effects being tested in the experiment. The presence of censored data leads to complications in the analysis.
2.2 Rank Statistics
There are a number of different rank statistics described in the literature, the most common being the logrank statistic. All of these statistics are designed to test the null hypothesis
is the survivor function for group
is the number of groups being tested and
is the largest observed time, against the alternative hypothesis
at least one of the
differ, for some
A rank statistics is calculated as follows:
, for , denote the list of distinct failure times across all groups and a series of weights.
Let denote the number of failures at time in group and denote the number of observations in the group that are known to have not failed prior to time , i.e., the size of the risk set for group at time . If a censored observation occurs at time then that observation is treated as if the censoring had occurred slightly after and therefore the observation is counted as being part of the risk set at time .
The (weighted) number of observed failures in the
, is therefore given by
and the (weighted) number of expected failures in the
denote the vector of differences
otherwise, then the rank statistic,
, is calculated as
denotes a generalized inverse of the matrix
Under the null hypothesis,
where the degrees of freedom, , is taken as the rank of the matrix .
The different rank statistics are defined by using different weights in the above calculations, for example
|Wilcoxon rank statistic
|Tarone–Ware rank statistic
|Peto–Peto rank statistic
2.3 Estimating the Survivor Function and Hazard Plotting
The most common estimate of the survivor function for censored data is the Kaplan–Meier
is the number of failures occurring at time
. This is a step function with steps at each failure time but not at censored times.
the cumulative hazard rate can be estimated by
A plot of
is often useful in identifying a suitable parametric model for the survivor times. The following relationships can be used in the identification.
||Exponential distribution: .
||Weibull distribution: .
||Gompertz distribution: .
||Extreme value (smallest) distribution: .
2.4 Proportional Hazard Models
Often in the analysis of survival data the relationship between the hazard function and the number of explanatory variables or covariates is modelled. The covariates may be, for example, group or treatment indicators or measures of the state of the individual at the start of the observational period. There are two types of covariate time independent covariates such as those described above which do not change value during the observational period and time dependent covariates. The latter can be classified as either external covariates, in which case they are not directly involved with the failure mechanism, or as internal covariates which are time dependent measurements taken on the individual.
The most common function relating the covariates to the hazard function is the proportional hazard function
is a baseline hazard function,
is a vector of covariates and
is a vector of unknown parameters. The assumption is that the covariates have a multiplicative effect on the hazard.
The form of
can be one of the distributions considered above or a nonparametric function. In the case of the exponential, Weibull and extreme value distributions the proportional hazard model can be fitted to censored data using the method described by Aitkin and Clayton (1980)
which uses a generalized linear model with Poisson errors. Other possible models are the gamma distribution and the log-normal distribution.
2.5 Cox's Proportional Hazard Model
Rather than using a specified form for the hazard function, Cox (1972)
considered the case when
was an unspecified function of time. To fit such a model assuming fixed covariates a marginal likelihood is used. For each of the times at which a failure occurred,
, the set of those who were still in the study is considered this includes any that were censored at
. This set is known as the risk set for time
and denoted by
. Given the risk set the probability that out of all possible sets of
subjects that could have failed the actual observed
cases failed can be written as
is the sum of the covariates of the
individuals observed to fail at
and the summation is over all distinct sets of
individuals drawn from
. This leads to a complex likelihood. If there are no ties in failure times the likelihood reduces to
is the number of distinct failure times. For cases where there are ties the following approximation, due to
Peto , can be used:
Having fitted the model an estimate of the baseline survivor function (derived from and the residuals) can be computed to examine the suitability of the model, in particular the proportional hazard assumption.
3 Recommendations on Choice and Use of Available Routines
The following routines are available.
|G12AAF||computes Kaplan–Meier estimates of the survivor function and their standard deviations.|
|G12ABF||comparison of survival curves using rank statistics.|
|G12BAF||fits the Cox proportional hazards model for fixed covariates.|
|G12ZAF||creates the risk sets associated with the Cox proportional hazards model for fixed covariates.|
Depending on the rank statistic required, it may be necessary to call G12ABF
twice, once to calculate the number of failures (
) and the total number of observations (
) at time
, to facilitate in the computation of the required weights, and once to calculate the required rank statistics.
The following routines from other chapters may also be useful in the analysis of survival data.
|G01MBF||the reciprocal of Mills' Ratio, that is the hazard rate for the Normal distribution.|
|G02GCF||fits generalized linear model with Poisson errors (see Aitkin and Clayton (1980)).|
|G02GDF||fits generalized linear model with gamma errors.|
|G07BBF||fits Normal distribution to censored data.|
|G07BEF||fits Weibull distribution to censored data.|
|G08RBF||fits linear model using likelihood based on ranks to censored data
(see Kalbfleisch and Prentice (1980)).|
|G11CAF||fits a conditional logistic model. When applied to the risk sets generated by G12ZAF the Cox proportional hazards model is fitted by exact marginal likelihood in the presence of tied observations.|
4 Functionality Index
|Cox's proportional hazard model,|| |
| parameter estimates and other statistics|| ||G12BAF|
5 Auxiliary Routines Associated with Library Routine Parameters
6 Routines Withdrawn or Scheduled for Withdrawal
Aitkin M and Clayton D (1980) The fitting of exponential, Weibull and extreme value distributions to complex censored survival data using GLIM Appl. Statist. 29 156–163
Cox D R (1972) Regression models in life tables (with discussion) J. Roy. Statist. Soc. Ser. B 34 187–220
Gross A J and Clark V A (1975) Survival Distributions: Reliability Applications in the Biomedical Sciences Wiley
Kalbfleisch J D and Prentice R L (1980) The Statistical Analysis of Failure Time Data Wiley