NAG Toolbox Chapter Introduction

G12 — Survival Analysis

Scope of the Chapter

This chapter is concerned with statistical techniques used in the analysis of survival/reliability/failure time data.

Other chapters contain functions which are also used to analyse this type of data. Chapter G02 contains generalized linear models, Chapter G07
contains functions to fit distribution models, and
Chapter G08 contains rank based methods.

Background to the Problems

Introduction to Terminology

This chapter is concerned with the analysis on the time,
tt, 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 tt will be referred to as the failure time.

Let the probability density function of the failure time be f(t)f(t), then the survivor function,
S(t)S(t), which is the probability of surviving to at least time tt, is given by

∞

S(t) =

∫

f(τ)dτ = 1 − F(t)

t

S(t)=∫t∞f(τ)dτ=1-F(t)

where F(t)F(t) is the cumulative density function. The
hazard function, λ(t)λ(t), is the probability that failure occurs at time tt given that the individual survived up to time tt, and is given by

λ(t) = f(t) / S(t).

λ(t)=f(t)/S(t).

The cumulative hazard rate is defined as

t

Λ(t) =

∫

λ(τ)dτ,

0

Λ(t)=∫0tλ(τ)dτ,

hence S(t) = e − Λ(t)S(t)=e-Λ(t).

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.

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

H0 : S1(t) = S2(t) = ⋯ = Sg(t), ∀ t ≤ τH0:S1(t)=S2(t)=⋯=Sg(t),∀t≤τ

where SjSj is the survivor function for group jj, gg is the number of groups being tested and ττ is the largest observed time, against the alternative hypothesis

H1 : H1: at least one of the
Sj(t)Sj(t) differ, for some
t ≤ τt≤τ.

A rank statistics TT is calculated as follows:

Let
titi, for i = 1,2, … ,ndi=1,2,…,nd, denote the list of distinct failure times across all gg groups and wiwi a series of ndnd weights.

Let dijdij denote the number of failures at time titi in group jj and nijnij denote the number of observations in the group jj that are known to have not failed prior to time titi, i.e., the size of the risk set for group jj at time titi. If a censored observation occurs at time titi then that observation is treated as if the censoring had occurred slightly after titi and therefore the observation is counted as being part of the risk set at time titi.

Finally let

g

g

di =

∑

dij and ni =

∑

nij.

j = 1

j = 1

di=∑j=1gdij and ni=∑j=1gnij.

The (weighted) number of observed failures in the jjth group, OjOj, is therefore given by

nd

Oj =

∑

widij

i = 1

Oj=∑i=1ndwidij

and the (weighted) number of expected failures in the jjth group, EjEj, by

Estimating the Survivor Function and Hazard Plotting

The most common estimate of the survivor function for censored data is the Kaplan–Meier or product-limit
estimate,

i

Ŝ(t) =

∏

((nj − dj)/(nj)), ti ≤ t < ti + 1

j = 1

S^(t)=∏j=1i(nj-djnj), ti≤t<ti+1

where djdj is the number of failures occurring at time tjtj out of njnj surviving to tjtj. This is a step function with steps at each failure time but not at censored times.

As S(t) = e − Λ(t)S(t)=e-Λ(t) the cumulative hazard rate can be estimated by

Λ̂(t) = − log(Ŝ(t)).

Λ^(t)=-log(S^(t)).

A plot of Λ̂(t)Λ^(t) or log(Λ̂(t))log(Λ^(t)) against tt or logtlog⁡t is often useful in identifying a suitable parametric model for the survivor times. The following relationships can be used in the identification.

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

λ(t,z) = λ0(t)exp(βTz)

λ(t,z)=λ0(t)exp(βTz)

where λ0(t)λ0(t) is a baseline hazard function,
zz 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 λ0(t)λ0(t) 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.

Cox's Proportional Hazard Model

Rather than using a specified form for the hazard function, Cox (1972) considered the case when λ0(t)λ0(t) 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,
titi, the set of those who were still in the study is considered this includes any that were censored at titi. This set is known as the risk set for time titi and denoted by R(ti)R(ti). Given the risk set the probability that out of all possible sets of didi subjects that could have failed the actual observed didi cases failed can be written as

(exp(siTβ))/( ∑ exp(zlTβ))

exp(siTβ)∑exp(zlTβ)

(1)

where sisi is the sum of the covariates of the didi individuals observed to fail at titi and the summation is over all distinct sets of nini individuals drawn from R(ti)R(ti). This leads to a complex likelihood. If there are no ties in failure times the likelihood reduces to

nd

L =

∏

(exp(ziTβ))/([∑l ∈ R(ti)exp(zlTβ)])

i = 1

L=∏i=1ndexp(ziTβ)[∑l∈R(ti)exp(zlTβ)]

(2)

where ndnd is the number of distinct failure times. For cases where there are ties the following approximation, due to
Peto [2], can be used:

nd

L =

∏

(exp(siTβ))/([∑l ∈ R(ti)exp(zlTβ)]di).

i = 1

L=∏i=1ndexp(siTβ)[∑l∈R(ti)exp(zlTβ)]di.

(3)

Having fitted the model an estimate of the baseline survivor function (derived from λ0(t)λ0(t) and the residuals) can be computed to examine the suitability of the model, in particular the proportional hazard assumption.

Depending on the rank statistic required, it may be necessary to call nag_surviv_logrank (g12ab) twice, once to calculate the number of failures (didi) and the total number of observations (nini) at time titi, to facilitate in the computation of the required weights, and once to calculate the required rank statistics.

The following functions from other chapters may also be useful in the analysis of survival data.

fits a conditional logistic model. When applied to the risk sets generated by nag_surviv_coxmodel_risksets (g12za) the Cox proportional hazards model is fitted by exact marginal likelihood in the presence of tied observations.