Parametric proportional hazards and accelerated failure time models

Göran Broström
February 16, 2009
Abstract

A unified implementation of parametric proportional hazards (PH) and accelerated failure time (AFT) models for right-censored or interval-censored and left-truncated data is described. The description here is vaĺid for time-constant covariates, but the necessary modifications for handling time-varying covariates are implemented in eha. Note that only piecewise constant time variation is handled.

1 Introduction

There is a need for software for analyzing parametric proportional hazards (PH) and accelerated failure time (AFT) data, that are right or interval censored and left truncated.

2 The proportional hazards model

We define proportional hazards models in terms of an expansion of a given survivor function S0,

s𝜽⁢(t,𝐳)={S0⁢(g⁡(t,𝜽))}exp⁡(𝐳⁢𝜷), (1)

where 𝜽 is a parameter vector used in modeling the baseline distribution, 𝜷 is the vector of regression parameters, and g is a positive function, which helps defining a parametric family of baseline survivor functions through

S⁡(t,𝜽)=S0⁢(g⁡(t,𝜽)),t>0,𝜽∈𝚯. (2)

With f0 and h0 defined as the density and hazard functions corresponding to S0, respectively, the density function corresponding to S is

f⁡(t,𝜽)=−∂∂t⁢S⁢(t,𝜽)=−∂∂t⁢S0⁢(g⁡(t,𝜽))=gt⁢(t,𝜽)⁢f0⁢(g⁡(t,𝜽)),

where

gt⁢(t,𝜽)=∂∂t⁢g⁢(t,𝜽).

Correspondingly, the hazard function is

h⁡(t,𝜽)=f⁡(t,𝜽)S⁡(t,𝜽)=gt⁢(t,𝜽)⁢h0⁢(g⁡(t,𝜽)). (3)

So, the proportional hazards model is

λ𝜽⁢(t,𝐳)=h⁡(t,𝜽)⁢exp⁡(𝐳⁢𝜷)=gt⁢(t,𝜽)⁢h0⁢(g⁡(t,𝜽))⁢exp⁡(𝐳⁢𝜷), (4)

corresponding to (1).

2.1 Data and the likelihood function

Given left truncated and right or interval censored data (si,ti,ui,di,𝐳i), i=1,…,n and the model (4), the likelihood function becomes

L⁡((𝜽,𝜷),(𝐬,𝐭,𝐮,𝐝),𝐙)=∏i=1n{(h(ti;𝜽)exp(𝐳i𝜷))I{di=1}×(S(ti;𝜽)exp⁡(𝐳i⁢𝜷))I{di≠2}×(S(ti;𝜽)exp⁡(𝐳i⁢𝜷)−S(ui;𝜽)exp⁡(𝐳i⁢𝜷))I{di=2}×S(si;𝜽)−exp⁡(𝐳i⁢𝜷)} (5)

Here, for i=1,…,n, si<ti≤ui are the left truncation and exit intervals, respectively, di=0 means that ti=ui and right censoring at ui, di=1 means that ti=ui and an event at ui, and di=2 means that ti<ui and an event occurs in the interval (ti,ui) (interval censoring) and 𝐳i=(zi⁢1,…,zi⁢p) is a vector of explanatory variables with corresponding parameter vector 𝜷=(β1,…,βp), i=1,…,n.

From (5) we now get the log likelihood and the score vector in a straightforward manner.

ℓ⁡((𝜽,𝜷),(𝐬,𝐭,𝐮,𝐝),𝐙)=∑i:di=1{logh(ti;𝜽)+𝐳i𝜷}+∑i:di≠2e𝐳i⁢𝜷logS(ui;𝜽)+∑i:di=2log{S(ti;𝜽)e𝐳i⁢𝜷−S(ui;𝜽)e𝐳i⁢𝜷}−∑i=1ne𝐳i⁢𝜷logS(si;𝜽) (6)

and (in the following we drop the long argument list to ℓ), for the regression parameters 𝜷,

∂∂βj⁢ℓ=∑i:di=1zi⁢j+∑i:di≠2zi⁢je𝐳i⁢𝜷logS(ti;𝜽)+∑i:di=2zi⁢je𝐳i⁢𝜷S⁢(ti,𝜽)e𝐳i⁢𝜷⁢log⁡S⁡(ti,𝜽)−S⁢(ui,𝜽)e𝐳i⁢𝜷⁢log⁡S⁡(ui,𝜽)S⁢(ti,𝜽)e𝐳i⁢𝜷−S⁢(ui,𝜽)e𝐳i⁢𝜷−∑i=1nzi⁢je𝐳i⁢𝜷logS(si;𝜽),j=1,…,p, (7)

and for the “baseline” parameters 𝜽, in vector form,

∂∂𝜽⁢ℓ=∑i:di=1h𝜽⁢(ti,𝜽)h⁡(ti,𝜽)+∑i:di≠2e𝐳i⁢𝜷S𝜽⁢(ti,𝜽)S⁡(ti,𝜽)+∑i:di=2e𝐳i⁢𝜷S⁢(ti,𝜽)e𝐳i⁢𝜷−1⁢S𝜽⁢(ti,𝜽)−S⁢(ui,𝜽)e𝐳i⁢𝜷−1⁢S𝜽⁢(ui,𝜽)S⁢(ti,𝜽)e𝐳i⁢𝜷−S⁢(ui,𝜽)e𝐳i⁢𝜷−∑i=1ne𝐳i⁢𝜷S𝜽⁢(si,𝜽)S⁡(si,𝜽). (8)

From (3),

h𝜽⁢(t,𝜽)=∂∂𝜽⁢h⁢(t,𝜽)=gt⁢𝜽⁢(t,𝜽)⁢h0⁢(g⁡(t,𝜽))+gt⁢(t,𝜽)⁢gθ⁢(t,𝜽)⁢h0′⁢(g⁡(t,𝜽)), (9)

and, from (2),

S𝜽⁢(t,𝜽)=∂∂𝜽⁢S⁢(t,𝜽)=∂∂𝜽⁢S0⁢(g⁡(t,𝜽))=−g𝜽⁢(t,𝜽)⁢f0⁢(g⁡(t,𝜽)). (10)

For estimating standard errors, the observed information (the negative of the hessian) is useful. However, instead of the error-prone and tedious work of calculating analytic second-order derivatives, we will rely on approximations by numerical differentiation.

3 The shape–scale families

From (1) we get a shape–scale family of distributions by choosing 𝜽=(p,λ) and

g(t,(p,λ))=(tλ)p,t≥0;p,λ>0.

However, for reasons of efficient numerical optimization and normality of parameter estimates, we use the parametrisation p=exp⁡(γ) and λ=exp⁡(α), thus redefining g to

g⁡(t,(γ,α))=(texp⁡(α))exp⁡(γ),t≥0;−∞<γ,α<∞. (11)

For the calculation of the score and hessian of the log likelihood function, we need some partial derivatives of g. They are found in an appendix.

3.1 The Weibull family of distributions

The Weibull family of distributions is obtained by

S0⁢(t)=exp⁡(−t),t≥0,

leading to

f0⁢(t)=exp⁡(−t),t≥0,

and

h0⁢(t)=1,t≥0.

We need some first and second order derivatives of f and h, and they are particularly simple in this case, for h they are both zero, and for f we get

f0′⁢(t)=−exp⁡(−t),t≥0.

3.2 The EV family of distributions

The EV (Extreme Value) family of distributions is obtained by setting

h0⁢(t)=exp⁡(t),t≥0,

leading to

S0⁢(t)=exp⁡{−(exp⁡(t)−1)},t≥0,

The rest of the necessary functions are easily derived from this.

3.3 The Gompertz family of distributions

The Gompertz family of distributions is given by

h(t)=τexp(t/λ),t≥0;τ,λ>0.

This family is not directly possible to generate from the described shape-scale models, so it is treated separately by direct maximum likelihood.

3.4 Other families of distributions

Included in the eha package are the lognormal and the loglogistic distributions as well.

4 The accelerated failure time model

In the description of this family of models, we generate a scape-scale family of distributions as defined by the equations (2) and (11). We get

S⁡(t,(γ,α))=S0⁢(g⁡(t,(γ,α)))=S0({texp⁡(α)}exp⁡(γ)),t>0,−∞<γ,α<∞. (12)

Given a vector 𝐳=(z1,…,zp) of explanatory variables and a vector of corresponding regression coefficients 𝜷=(β1,…,βp), the AFT regression model is defined by

S⁡(t,(γ,α,𝜷))=S0⁢(g⁡(t⁢exp⁡(𝐳⁢𝜷),(γ,α)))=S0⁢({t⁢exp⁡(𝐳⁢𝜷)exp⁡(α)}exp⁡(γ))=S0⁢({texp⁡(α−𝐳⁢𝜷)}exp⁡(γ))=S0(g(t,(γ,α−𝐳𝜷))),t>0. (13)

So, by defining 𝜽=(γ,α−𝐳⁢𝜷), we are back in the framework of Section 2. We get

f⁡(t,𝜽)=gt⁢(t,𝜽)⁢f0⁢(g⁡(t,𝜽))

and

h⁡(t,𝜽)=gt⁢(t,𝜽)⁢h0⁢(g⁡(t,𝜽)), (14)

defining the AFT model generated by the survivor function S0 and corresponding density f0 and hazard h0.

4.1 Data and the likelihood function

Given left truncated and right or interval censored data (si,ti,ui,di,𝐳i), i=1,…,n and the model (14), the likelihood function becomes

L⁡((γ,α,𝜷),(𝐬,𝐭,𝐝),𝐙)=∏i=1n{h(ti;𝜽i)I{di=1}×S(ti;𝜽i)I{i≠2}×(S(ti;𝜽i)−S(ui;𝜽i))I{di=2}×S(si;𝜽i)−1} (15)

Here, for i=1,…,n, si<ti≤ui are the left truncation and exit intervals, respectively, di=0 means that ti=ui and right censoring at ti, di=1 means that ti=ui and an event at ti, and di=2 means that ti<ui and an event uccurs in the interval (ti,ui) (interval censoring), and 𝐳i=(zi⁢1,…,zi⁢p) is a vector of explanatory variables with corresponding parameter vector 𝜷=(β1,…,βp), i=1,…,n.

From (15) we now get the log likelihood and the score vector in a straightforward manner.

ℓ⁡((γ,α,𝜷),(𝐬,𝐭,𝐮,𝐝),𝐙)=∑i:di=1logh(ti;𝜽i)+∑i:di≠2logS(ti;𝜽i)+∑i:di=2log(S(ti;𝜽i)−S(ui;𝜽i))−∑i=1nlogS(si;𝜽i)

and (in the following we drop the long argument list to ℓ), for the regression parameters 𝜷,

∂∂βj⁢ℓ=∑di=1hj⁢(ti,𝜽i)h⁡(ti,𝜽i)+∑di≠2Sj⁢(ti,𝜽i)S⁡(ti,𝜽i)+∑di=2Sj⁢(ti,𝜽i)−Sj⁢(ui,𝜽i)S⁡(ti,𝜽i)−S⁡(ui,𝜽i)−∑i=1nSj⁢(si,𝜽i)S⁡(si,𝜽i)=−∑di=1zi⁢jhα⁢(ti,𝜽i)h⁡(ti,𝜽i)−∑di≠2zi⁢jSα⁢(ti,𝜽i)S⁡(ti,𝜽i)−∑di=2zi⁢jSα⁢(ti,𝜽i)−Sα⁢(ui,𝜽i)S⁡(ti,𝜽i)−S⁡(ui,𝜽i)+∑i=1nzi⁢jSα⁢(si,𝜽i)S⁡(si,𝜽i)

and for the “baseline” parameters γ and α,

∂∂γ⁢ℓ=∑i:di=1hγ⁢(ti,𝜽i)h⁡(ti,𝜽i)+∑i:di≠2Sγ⁢(ti,𝜽i)S⁡(ti,𝜽i)+∑i:di=2Sγ⁢(ti,𝜽i)−Sγ⁢(ui,𝜽i)S⁡(ti,𝜽i)−S⁡(ui,𝜽i)−∑i=1nSγ⁢(si,𝜽i)S⁡(si,𝜽i),

and

∂∂α⁢ℓ=∑i:di=1hα⁢(ti,𝜽i)h⁡(ti,𝜽i)+∑i:di≠2Sα⁢(ti,𝜽i)S⁡(ti,𝜽i)+∑i:di=2Sα⁢(ti,𝜽i)−Sα⁢(ui,𝜽i)S⁡(ti,𝜽i)−S⁡(ui,𝜽i)−∑i=1nSα⁢(si,𝜽i)S⁡(si,𝜽i).

Here, from (3),

hγ⁢(t,𝜽i)=∂∂γ⁢h⁢(t,𝜽i)=gt⁢γ⁢(t,𝜽i)⁢h0⁢(g⁡(t,𝜽i))+gt⁢(t,𝜽i)⁢gγ⁢(t,𝜽i)⁢h0′⁢(g⁡(t,𝜽i)),
hα⁢(t,𝜽i)=∂∂α⁢h⁢(t,𝜽i)=gt⁢α⁢(t,𝜽i)⁢h0⁢(g⁡(t,𝜽i))+gt⁢(t,𝜽i)⁢gα⁢(t,𝜽i)⁢h0′⁢(g⁡(t,𝜽i)),

and

hj⁢(t,𝜽i)=∂∂βj⁢h⁢(t,𝜽i)=∂∂α⁢h⁢(t,𝜽i)⁢∂∂βj⁢(α−𝐳i⁢𝜷)=−zi⁢jhα(t,𝜽i),j=1,…,p.

Similarly, from (2) we get

Sγ⁢(t,𝜽i)=∂∂γ⁢S⁢(t,𝜽i)=∂∂γ⁢S0⁢(g⁡(t,𝜽i))=−gγ⁢(t,𝜽i)⁢f0⁢(g⁡(t,𝜽i)),
Sα⁢(t,𝜽i)=∂∂α⁢S⁢(t,𝜽i)=∂∂α⁢S0⁢(g⁡(t,𝜽i))=−gα⁢(t,𝜽i)⁢f0⁢(g⁡(t,𝜽i)).

and

Sj⁢(t,𝜽i)=∂∂βj⁢S⁢(t,𝜽i)=∂∂α⁢S0⁢(g⁡(t,𝜽i))⁢∂∂βj⁢(α−𝐳i⁢𝜷)=−zi⁢jSα(t,𝜽i),j=1,…,p.

For estimating standard errors, the observed information (the negative of the hessian) is useful, so

−∂2∂βj⁢∂βmℓ=−∑i:di=1zi⁢jzi⁢m{hα⁢α⁢(ti,𝜽i)h⁡(ti,𝜽i)−(hα⁢(ti,𝜽i)h⁡(ti,𝜽i))2}−∑i:i≠2zi⁢jzi⁢m{Sα⁢α⁢(ti,𝜽i)S⁡(ti,𝜽i)−(Sα⁢(ti,𝜽i)S⁡(ti,𝜽i))2}−∑i:i=2zi⁢jzi⁢m{Sα⁢α⁢(ti,𝜽i)−Sα⁢α⁢(ui,𝜽i)S⁡(ti,𝜽i)−S⁡(ui,𝜽i)−(Sα⁢(ti,𝜽i)−Sα⁢(ui,𝜽i)S⁡(ti,𝜽i)−S⁡(ui,𝜽i))2}+∑i=1nzi⁢jzi⁢m{Sα⁢α⁢(si,𝜽i)S⁡(si,𝜽i)−(Sα⁢(si,𝜽i)S⁡(si,𝜽i))2},j,m=1,…,p,

and

−∂2∂βj⁢∂τℓ=∑i:di=1zi⁢j{hα⁢τ⁢(ti,𝜽i)h⁡(ti,𝜽i)−hα⁢(ti,𝜽i)⁢hτ⁢(ti,𝜽i)h2⁢(ti,𝜽i)}+∑i:i≠2zi⁢j{Sα⁢τ⁢(ti,𝜽i)S⁡(ti,𝜽i)−Sα⁢(ti,𝜽i)⁢Sτ⁢(ti,𝜽i)S2⁢(ti,𝜽i)}+∑i:i=2zi⁢j{Sα⁢τ⁢(ti,𝜽i)−Sα⁢τ⁢(ui,𝜽i)S⁡(ti,𝜽i)−S⁡(ui,𝜽i)−(Sα⁢(ti,𝜽i)−Sα⁢(ui,𝜽i))⁢(Sτ⁢(ti,𝜽i)−Sτ⁢(ui,𝜽i))(S⁡(ti,𝜽i)−S⁡(ui,𝜽i))2}−∑i=1nzi⁢j{Sα⁢τ⁢(si,𝜽i)S⁡(si,𝜽i)−Sα⁢(si,𝜽i)⁢Sτ⁢(si,𝜽i)S2⁢(si,𝜽i)}j=1,…,p;τ=γ,α,

and finally

−∂2∂τ⁢∂τ′ℓ=−∑i:di=1{hτ′⁢τ⁢(ti,𝜽i)h⁡(ti,𝜽i)−hτ′⁢(ti,𝜽i)⁢hτ⁢(ti,𝜽i)h2⁢(ti,𝜽i)}−∑i:i≠2{Sτ′⁢τ⁢(ti,𝜽i)S⁡(ti,𝜽i)−Sτ′⁢(ti,𝜽i)⁢Sτ⁢(ti,𝜽i)S2⁢(ti,𝜽i)}−∑i:i=2{Sτ′⁢τ⁢(ti,𝜽i)−Sτ′⁢τ⁢(ui,𝜽i)S⁡(ti,𝜽i)−S⁡(ui,𝜽i)−(Sτ′⁢(ti,𝜽i)−Sτ′⁢(ui,𝜽i))⁢(Sτ⁢(ti,𝜽i)−Sτ⁢(ui,𝜽i))(S⁡(ti,𝜽i)−S⁡(ui,𝜽i))2}+∑i=1n{Sτ′⁢τ⁢(si,𝜽i)S⁡(si,𝜽i)−Sτ′⁢(si,𝜽i)⁢Sτ⁢(si,𝜽i)S2⁢(si,𝜽i)}(τ,τ′)=(γ,γ),(γ,α),(α,α).

The second order partial derivatives hτ⁢τ′ and Sτ⁢τ′ are

hτ⁢τ′⁢(t,𝜽)=∂∂τ′⁢hτ⁢(t,𝜽)=gt⁢τ⁢τ′⁢(t,𝜽)⁢h0⁢(g⁡(t,𝜽))+gt⁢τ⁢(t,𝜽)⁢gτ′⁢(t,𝜽)⁢h0′⁢(g⁡(t,𝜽))+gt⁢(t,𝜽)⁢gθ⁢(t,𝜽)⁢gτ′⁢(t,𝜽)⁢h0′′⁢(g⁡(t,𝜽))+gt⁢(t,𝜽)⁢gθ⁢θ′⁢(t,𝜽)⁢h0′⁢(g⁡(t,𝜽))+gt⁢τ′⁢(t,𝜽)⁢gθ⁢(t,𝜽)⁢h0′⁢(g⁡(t,𝜽))=h0⁢(g⁡(t,𝜽))⁢gt⁢τ⁢τ′⁢(t,𝜽)+h0′(g(t,𝜽)){gt(t,θ)gθ⁢θ′(t,𝜽)+gt⁢τ⁢(t,𝜽)⁢gτ′⁢(t,𝜽)+gt⁢τ′(t,𝜽)gτ(t,𝜽)}+h0′′⁢(g⁡(t,𝜽))⁢gt⁢(t,𝜽)⁢gθ⁢(t,𝜽)⁢gτ′⁢(t,𝜽),,(τ,τ′)=(γ,γ),(γ,λ),(λ,λ), (16)

and from (10),

Sτ⁢τ′⁢(t,𝜽)=∂∂τ′⁢Sτ⁢(t,𝜽)=−{gτ⁢τ′⁢(t,𝜽)⁢f0⁢(g⁡(t,𝜽))+gτ⁢(t,𝜽)⁢gτ′⁢(t,𝜽)⁢f0′⁢(g⁡(t,𝜽))},(τ,τ′)=(γ,γ),(γ,λ),(λ,λ). (17)

Appendix A Some partial derivatives

The function (see (11))

g⁡(t,(γ,α))=(texp⁡(α))exp⁡(γ),t≥0;−∞<γ,α<∞. (18)

has the following partial derivatives:

gt⁢(t,(γ,α)) =exp⁡(γ)t⁢g⁢(t,(γ,α)),t>0
gγ⁢(t,(γ,α)) =g⁡(t,(γ,α))⁢log⁢{g⁡(t,(γ,α))}
gα⁢(t,(γ,α)) =−exp⁡(γ)⁢g⁢(t,(γ,α))
gt⁢γ⁢(t,(γ,α)) =gt⁢(t,(γ,α))+exp⁡(γ)t⁢gγ⁢(t,(γ,α)),t>0
gt⁢α⁢(t,(γ,α)) =−exp⁡(γ)⁢gt⁢(t,(γ,α)),t>0
gγ2⁢(t,(γ,α)) =gγ⁢(t,(γ,α))⁢{1+log⁡g⁡(t,(γ,α))}
gγ⁢α⁢(t,(γ,α)) =gα⁢(t,(γ,α))⁢{1+log⁡g⁡(t,(γ,α))}
gα2⁢(t,(γ,α)) =−exp⁡(γ)⁢gα⁢(t,(γ,α))
gt⁢γ2⁢(t,(γ,α)) =gt⁢γ⁢(t,(γ,α))
+exp⁡(γ)t⁢gγ⁢(t,(γ,α))⁢{2+log⁡g⁡(t,(γ,α))}
gt⁢γ⁢α⁢(t,(γ,α)) =−exp(γ){gt(t,(γ,α))+gt⁢γ(t,(γ,α))}
gt⁢α2⁢(t,(γ,α)) =−exp⁡(γ)⁢gt⁢α⁢(t,(γ,α))

The formulas will be easier to read if we remove all function arguments, i.e., (t,(γ,α)):

gt =exp⁡(γ)t⁢g,t>0
gγ =g⁢log⁡g
gα =−exp⁡(γ)⁢g
gt⁢γ =gt+exp⁡(γ)t⁢gγ,t>0
gt⁢α =−exp⁡(γ)⁢gt,t>0
gγ2 =gγ⁢{1+log⁡g}
gγ⁢α =gα⁢{1+log⁡g}
gα2 =−exp⁡(γ)⁢gα
gt⁢γ2 =gt⁢γ+exp⁡(γ)t⁢gγ⁢{2+log⁡g},t>0
gt⁢γ⁢α =−exp⁡(γ)⁢{gt+gt⁢γ},t>0
gt⁢α2 =−exp⁡(γ)⁢gt⁢α,t>0