15.07.2013 Views

ST3242

ST3242

ST3242

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Cox proportional hazards model<br />

<strong>ST3242</strong>: Introduction to Survival Analysis<br />

Alex Cook<br />

September 2008<br />

<strong>ST3242</strong> : Cox proportional hazards model 1/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Unique failure times<br />

The partial likelihood for β is<br />

ℓp(β, x) =<br />

m<br />

<br />

<br />

i=1<br />

φi<br />

j∈R(ti ) φj<br />

<strong>ST3242</strong> : Cox proportional hazards model 2/49<br />

δi<br />

.


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Repeated times<br />

Breslow’s approximation<br />

ℓp(β, x) =<br />

I<br />

i=1<br />

<br />

j∈D(t (i)) φj<br />

j∈R(t (i)) φj<br />

|D(t(i))| .<br />

<strong>ST3242</strong> : Cox proportional hazards model 3/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Repeated times<br />

Efron’s approximation<br />

ℓp(β, x) =<br />

I<br />

i=1<br />

<br />

j∈D(t (i)) φj<br />

|D(t (i))| <br />

k=1 j∈R(t (i)) φj − k−1<br />

|D(t (i))|<br />

<br />

j∈D(t (i)) φj<br />

.<br />

<strong>ST3242</strong> : Cox proportional hazards model 4/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Repeated times<br />

Exact partial likelihood<br />

ℓp(β, x) =<br />

I<br />

i=1<br />

<br />

j∈D(t (i)) φj<br />

<br />

q∈Qi Φq<br />

where Qi is the set of all |D(t(i))|-tuples that could be<br />

selected from R(t(i)) and Φq is the product of φj for all<br />

members j of |D(t(i))|-tuple q.<br />

<strong>ST3242</strong> : Cox proportional hazards model 5/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Repeated times<br />

Example<br />

Suppose individuals labelled 1–5 are at risk at time t(i), i.e. in<br />

R(t(i)), and that of these, individuals 1–3 fail at time t(i)<br />

Breslow:<br />

φ1φ2φ3<br />

,<br />

(φ1 + φ2 + φ3 + φ4 + φ5) 3<br />

Efron:<br />

φ1φ2φ3<br />

(φ1 + φ2 + φ3 + φ4 + φ5)( 2<br />

3 φ1 + 2<br />

3 φ2 + 2<br />

3 φ3 + φ4 + φ5)( 1<br />

3 φ1 + 1<br />

3 φ2 +<br />

Exact:<br />

φ1φ2φ3<br />

.<br />

φ1φ2φ3 + φ1φ2φ4 + φ1φ2φ5 + . . . + φ3φ4φ5<br />

<strong>ST3242</strong> : Cox proportional hazards model 6/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

How to maximise these?<br />

In practice<br />

Luckily, R does it for you.<br />

But exact method may take a long time.<br />

Theory behind R’s method<br />

Problem of maximising a (log) (partial) likelihood<br />

common in statistics<br />

For applied problems, often searching over 10+ of<br />

dimensions<br />

“Grid search” okay for 1D or 2D<br />

Deterministic or stochastic methods—see ST4231<br />

Computer Intensive Statistical Methods<br />

<strong>ST3242</strong> : Cox proportional hazards model 7/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

How to maximise these?<br />

In practice<br />

Luckily, R does it for you.<br />

But exact method may take a long time.<br />

Theory behind R’s method<br />

Problem of maximising a (log) (partial) likelihood<br />

common in statistics<br />

For applied problems, often searching over 10+ of<br />

dimensions<br />

“Grid search” okay for 1D or 2D<br />

Deterministic or stochastic methods—see ST4231<br />

Computer Intensive Statistical Methods<br />

<strong>ST3242</strong> : Cox proportional hazards model 7/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

How to maximise these?<br />

In practice<br />

Luckily, R does it for you.<br />

But exact method may take a long time.<br />

Theory behind R’s method<br />

Problem of maximising a (log) (partial) likelihood<br />

common in statistics<br />

For applied problems, often searching over 10+ of<br />

dimensions<br />

“Grid search” okay for 1D or 2D<br />

Deterministic or stochastic methods—see ST4231<br />

Computer Intensive Statistical Methods<br />

<strong>ST3242</strong> : Cox proportional hazards model 7/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

How to maximise these?<br />

In practice<br />

Luckily, R does it for you.<br />

But exact method may take a long time.<br />

Theory behind R’s method<br />

Problem of maximising a (log) (partial) likelihood<br />

common in statistics<br />

For applied problems, often searching over 10+ of<br />

dimensions<br />

“Grid search” okay for 1D or 2D<br />

Deterministic or stochastic methods—see ST4231<br />

Computer Intensive Statistical Methods<br />

<strong>ST3242</strong> : Cox proportional hazards model 7/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

How to maximise these?<br />

In practice<br />

Luckily, R does it for you.<br />

But exact method may take a long time.<br />

Theory behind R’s method<br />

Problem of maximising a (log) (partial) likelihood<br />

common in statistics<br />

For applied problems, often searching over 10+ of<br />

dimensions<br />

“Grid search” okay for 1D or 2D<br />

Deterministic or stochastic methods—see ST4231<br />

Computer Intensive Statistical Methods<br />

<strong>ST3242</strong> : Cox proportional hazards model 7/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Naïve grid search<br />

<strong>ST3242</strong> : Cox proportional hazards model 8/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Newton–Raphson<br />

This is a deterministic, iterative procedure:<br />

deterministic because no random search involved<br />

at each stage the estimate gets better<br />

hopefully<br />

<strong>ST3242</strong> : Cox proportional hazards model 9/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Newton–Raphson<br />

This is a deterministic, iterative procedure:<br />

deterministic because no random search involved<br />

at each stage the estimate gets better<br />

hopefully<br />

<strong>ST3242</strong> : Cox proportional hazards model 9/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Newton–Raphson<br />

Assume parameters are θ, dim(θ) = p and log-likelihood is<br />

ℓ(θ)<br />

1 k = 1<br />

2 choose θ (k)<br />

3 Solve<br />

I (θ (k) )(θ (k+1) −θ (k) ) = U(θ (k) )<br />

for θ (k+1) .<br />

4 Increment k by one.<br />

5 Go back to step 3 and repeat<br />

until convergence.<br />

Where<br />

U(θ) = ( ∂l(θ)<br />

)<br />

∂θ1<br />

T<br />

2 ∂ l(θ)<br />

I (θ) = −<br />

∂θr∂θs<br />

<strong>ST3242</strong> : Cox proportional hazards model 10/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Newton–Raphson<br />

Assume parameters are θ, dim(θ) = p and log-likelihood is<br />

ℓ(θ)<br />

1 k = 1<br />

2 choose θ (k)<br />

3 Solve<br />

I (θ (k) )(θ (k+1) −θ (k) ) = U(θ (k) )<br />

for θ (k+1) .<br />

4 Increment k by one.<br />

5 Go back to step 3 and repeat<br />

until convergence.<br />

Where<br />

U(θ) = ( ∂l(θ)<br />

)<br />

∂θ1<br />

T<br />

2 ∂ l(θ)<br />

I (θ) = −<br />

∂θr∂θs<br />

<strong>ST3242</strong> : Cox proportional hazards model 10/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Newton–Raphson<br />

Assume parameters are θ, dim(θ) = p and log-likelihood is<br />

ℓ(θ)<br />

1 k = 1<br />

2 choose θ (k)<br />

3 Solve<br />

I (θ (k) )(θ (k+1) −θ (k) ) = U(θ (k) )<br />

for θ (k+1) .<br />

4 Increment k by one.<br />

5 Go back to step 3 and repeat<br />

until convergence.<br />

Where<br />

U(θ) = ( ∂l(θ)<br />

)<br />

∂θ1<br />

T<br />

2 ∂ l(θ)<br />

I (θ) = −<br />

∂θr∂θs<br />

<strong>ST3242</strong> : Cox proportional hazards model 10/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Newton–Raphson<br />

Assume parameters are θ, dim(θ) = p and log-likelihood is<br />

ℓ(θ)<br />

1 k = 1<br />

2 choose θ (k)<br />

3 Solve<br />

I (θ (k) )(θ (k+1) −θ (k) ) = U(θ (k) )<br />

for θ (k+1) .<br />

4 Increment k by one.<br />

5 Go back to step 3 and repeat<br />

until convergence.<br />

Where<br />

U(θ) = ( ∂l(θ)<br />

)<br />

∂θ1<br />

T<br />

2 ∂ l(θ)<br />

I (θ) = −<br />

∂θr∂θs<br />

<strong>ST3242</strong> : Cox proportional hazards model 10/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Newton–Raphson<br />

Assume parameters are θ, dim(θ) = p and log-likelihood is<br />

ℓ(θ)<br />

1 k = 1<br />

2 choose θ (k)<br />

3 Solve<br />

I (θ (k) )(θ (k+1) −θ (k) ) = U(θ (k) )<br />

for θ (k+1) .<br />

4 Increment k by one.<br />

5 Go back to step 3 and repeat<br />

until convergence.<br />

Where<br />

U(θ) = ( ∂l(θ)<br />

)<br />

∂θ1<br />

T<br />

2 ∂ l(θ)<br />

I (θ) = −<br />

∂θr∂θs<br />

<strong>ST3242</strong> : Cox proportional hazards model 10/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Newton–Raphson<br />

Assume parameters are θ, dim(θ) = p and log-likelihood is<br />

ℓ(θ)<br />

1 k = 1<br />

2 choose θ (k)<br />

3 Solve<br />

I (θ (k) )(θ (k+1) −θ (k) ) = U(θ (k) )<br />

for θ (k+1) .<br />

4 Increment k by one.<br />

5 Go back to step 3 and repeat<br />

until convergence.<br />

Where<br />

U(θ) = ( ∂l(θ)<br />

)<br />

∂θ1<br />

T<br />

2 ∂ l(θ)<br />

I (θ) = −<br />

∂θr∂θs<br />

<strong>ST3242</strong> : Cox proportional hazards model 10/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Newton–Raphson<br />

Assume parameters are θ, dim(θ) = p and log-likelihood is<br />

ℓ(θ)<br />

1 k = 1<br />

2 choose θ (k)<br />

3 Solve<br />

I (θ (k) )(θ (k+1) −θ (k) ) = U(θ (k) )<br />

for θ (k+1) .<br />

4 Increment k by one.<br />

5 Go back to step 3 and repeat<br />

until convergence.<br />

Note<br />

θ (0) is arbitrary: if far<br />

from ˆ θ we might not<br />

converge<br />

Can write ℓp instead of<br />

ℓ and β instead of θ<br />

<strong>ST3242</strong> : Cox proportional hazards model 11/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Newton–Raphson<br />

Assume parameters are θ, dim(θ) = p and log-likelihood is<br />

ℓ(θ)<br />

1 k = 1<br />

2 choose θ (k)<br />

3 Solve<br />

I (θ (k) )(θ (k+1) −θ (k) ) = U(θ (k) )<br />

for θ (k+1) .<br />

4 Increment k by one.<br />

5 Go back to step 3 and repeat<br />

until convergence.<br />

Example<br />

i t (i) x (i)<br />

1 6 31.4<br />

2 98 21.5<br />

3 189 27.1<br />

4 374 22.7<br />

5 1002 35.7<br />

6 1205 30.7<br />

7 2065 26.5<br />

8 2201 28.3<br />

9 2421 27.9<br />

h(t, xi) = h0(t)e βxi<br />

<strong>ST3242</strong> : Cox proportional hazards model 12/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Score and information<br />

lp(β) = β<br />

d<br />

dβ lp(β) =<br />

9<br />

x(i) −<br />

i=1<br />

9<br />

x(i) −<br />

i=1<br />

d 2<br />

dβ 2 lp(β) = −<br />

where A =<br />

⎛<br />

9<br />

i=1<br />

⎝ <br />

j∈R(t (i))<br />

⎛<br />

9<br />

log ⎝ <br />

i=1<br />

9<br />

<br />

i=1<br />

j∈R(t (i))<br />

βxj<br />

j∈R(t xje<br />

(i))<br />

<br />

j∈R(t (i)) eβxj<br />

A<br />

j∈R(t (i)) eβxj<br />

2<br />

x 2 j e βxj<br />

⎞ ⎛<br />

⎠ ⎝ <br />

j∈R(t (i))<br />

e βxj<br />

e βxj<br />

⎞<br />

⎠<br />

⎞ ⎛<br />

⎠ − ⎝ <br />

j∈R(t (i))<br />

xje βxj<br />

<strong>ST3242</strong> : Cox proportional hazards model 13/49<br />

⎞<br />


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Score and information<br />

If we write<br />

U(β) = d<br />

dβ lp(β)<br />

I (β) = d2<br />

lp(β)<br />

dβ2 then Newton–Raphson update step is just<br />

β (k+1) = β (k) + U(β (k) )/I (β (k) ).<br />

<strong>ST3242</strong> : Cox proportional hazards model 14/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Score and information<br />

Try β (0) = 0 first<br />

U(0) = −2.51 and I (0) = 77.13, so our new guess at the<br />

MLE is<br />

β (1) = 0 − 2.51/77.13 = −0.0326.<br />

β (2) = −0.0326 − 0.069/72.83 = −0.0335.<br />

β (3) = −0.0335 − 0.000061/72.70 = −0.0335 = β (2)<br />

MLE<br />

Here it worked, as our first guess was quite close to the MLE.<br />

But. . .<br />

<strong>ST3242</strong> : Cox proportional hazards model 15/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Score and information<br />

Try β (0) = 0 first<br />

U(0) = −2.51 and I (0) = 77.13, so our new guess at the<br />

MLE is<br />

β (1) = 0 − 2.51/77.13 = −0.0326.<br />

β (2) = −0.0326 − 0.069/72.83 = −0.0335.<br />

β (3) = −0.0335 − 0.000061/72.70 = −0.0335 = β (2)<br />

MLE<br />

Here it worked, as our first guess was quite close to the MLE.<br />

But. . .<br />

<strong>ST3242</strong> : Cox proportional hazards model 15/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Score and information<br />

Try β (0) = 0 first<br />

U(0) = −2.51 and I (0) = 77.13, so our new guess at the<br />

MLE is<br />

β (1) = 0 − 2.51/77.13 = −0.0326.<br />

β (2) = −0.0326 − 0.069/72.83 = −0.0335.<br />

β (3) = −0.0335 − 0.000061/72.70 = −0.0335 = β (2)<br />

MLE<br />

Here it worked, as our first guess was quite close to the MLE.<br />

But. . .<br />

<strong>ST3242</strong> : Cox proportional hazards model 15/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Score and information<br />

Try β (0) = 0 first<br />

U(0) = −2.51 and I (0) = 77.13, so our new guess at the<br />

MLE is<br />

β (1) = 0 − 2.51/77.13 = −0.0326.<br />

β (2) = −0.0326 − 0.069/72.83 = −0.0335.<br />

β (3) = −0.0335 − 0.000061/72.70 = −0.0335 = β (2)<br />

MLE<br />

Here it worked, as our first guess was quite close to the MLE.<br />

But. . .<br />

<strong>ST3242</strong> : Cox proportional hazards model 15/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Score and information<br />

Try β (0) = 0 first<br />

U(0) = −2.51 and I (0) = 77.13, so our new guess at the<br />

MLE is<br />

β (1) = 0 − 2.51/77.13 = −0.0326.<br />

β (2) = −0.0326 − 0.069/72.83 = −0.0335.<br />

β (3) = −0.0335 − 0.000061/72.70 = −0.0335 = β (2)<br />

MLE<br />

Here it worked, as our first guess was quite close to the MLE.<br />

But. . .<br />

<strong>ST3242</strong> : Cox proportional hazards model 15/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Non-convergence<br />

ββ<br />

−1.5 −0.5 0.5 1.5<br />

2 4 6 8 10<br />

iteration<br />

<strong>ST3242</strong> : Cox proportional hazards model 16/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Non-convergence<br />

ββ<br />

−1.5 −0.5 0.5 1.5<br />

2 4 6 8 10<br />

iteration<br />

<strong>ST3242</strong> : Cox proportional hazards model 17/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Non-convergence<br />

ββ<br />

−1.5 −0.5 0.5 1.5<br />

2 4 6 8 10<br />

iteration<br />

<strong>ST3242</strong> : Cox proportional hazards model 18/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Non-convergence<br />

ββ<br />

−1.5 −0.5 0.5 1.5<br />

2 4 6 8 10<br />

iteration<br />

<strong>ST3242</strong> : Cox proportional hazards model 19/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Non-convergence<br />

ββ<br />

−1.5 −0.5 0.5 1.5<br />

2 4 6 8 10<br />

iteration<br />

<strong>ST3242</strong> : Cox proportional hazards model 20/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Non-convergence<br />

ββ<br />

−1.5 −0.5 0.5 1.5<br />

2 4 6 8 10<br />

iteration<br />

<strong>ST3242</strong> : Cox proportional hazards model 21/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Replace<br />

by<br />

A solution<br />

for ξ < 1<br />

I (θ (k) )(θ (k+1) − θ (k) ) = U(θ (k) )<br />

I (θ (k) )(θ (k+1) − θ (k) ) = ξU(θ (k) )<br />

<strong>ST3242</strong> : Cox proportional hazards model 22/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

A solution<br />

ββ<br />

−1.5 −0.5 0.5 1.5<br />

0 20 40 60 80 100<br />

iteration<br />

<strong>ST3242</strong> : Cox proportional hazards model 23/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Easy peasy<br />

coxph<br />

coxph(Surv(times,deltas) covariates)<br />

<strong>ST3242</strong> : Cox proportional hazards model 24/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Easy peasy<br />

coxph<br />

coxph(Surv(times,deltas) covariates)<br />

<strong>ST3242</strong> : Cox proportional hazards model 24/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Optional arguments<br />

data = aml<br />

subset = 1:100<br />

init = 10<br />

init = c(0.01, 0.01)<br />

method = ’efron’<br />

method = ’breslow’<br />

method = ’exact’<br />

<strong>ST3242</strong> : Cox proportional hazards model 25/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Example<br />

Worcester heart attack study<br />

start time = heart attack<br />

end time = death (or censoring)<br />

covariate: body mass index<br />

<strong>ST3242</strong> : Cox proportional hazards model 26/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Example<br />

> library(survival)<br />

><br />

><br />

cols=c(’id’,’age’,’sex’,’c4’,’c5’,’c6’,’bmi’,’history’,<br />

’c9’,’c10’,’c11’, ’c12’,’c13’,’c14’,’c15’,’c16’,<br />

’c17’,’c18’,’c19’,’c20’,’t’,’delta’)<br />

attach(read.table(’http://www.umass.edu/statdata/statdata<br />

/data/whas500.dat’ ,col.names=cols))<br />

> phm.bmi = coxph(Surv(t,delta) bmi)<br />

> summary(phm.bmi)<br />

<strong>ST3242</strong> : Cox proportional hazards model 27/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Example<br />

<strong>ST3242</strong> : Cox proportional hazards model 28/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Example—using Breslow<br />

<strong>ST3242</strong> : Cox proportional hazards model 29/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Standard error<br />

R provides us with the standard error of β. Note:<br />

asymptotically.<br />

ˆβ ∼ N(β, E{I (β)} −1 )<br />

Actually. . .<br />

R provides an estimated standard error, replacing the expected<br />

information E{I (β)} by the observed information I ( ˆ β).<br />

<strong>ST3242</strong> : Cox proportional hazards model 30/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Standard error<br />

R provides us with the standard error of β. Note:<br />

asymptotically.<br />

ˆβ ∼ N(β, E{I (β)} −1 )<br />

Actually. . .<br />

R provides an estimated standard error, replacing the expected<br />

information E{I (β)} by the observed information I ( ˆ β).<br />

<strong>ST3242</strong> : Cox proportional hazards model 30/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Confidence interval<br />

CI<br />

1 − α confidence interval for β is<br />

Example<br />

ˆβ<br />

1<br />

± z1−α/2 <br />

I ( ˆ β)<br />

i.e. ˆ β ± z1−α/2se( ˆ ˆ β).<br />

−0.0985 ± 1.96 × 0.0148 = (−0.13, −0.07) for effect of BMI<br />

<strong>ST3242</strong> : Cox proportional hazards model 31/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Confidence interval<br />

CI<br />

1 − α confidence interval for β is<br />

Example<br />

ˆβ<br />

1<br />

± z1−α/2 <br />

I ( ˆ β)<br />

i.e. ˆ β ± z1−α/2se( ˆ ˆ β).<br />

−0.0985 ± 1.96 × 0.0148 = (−0.13, −0.07) for effect of BMI<br />

<strong>ST3242</strong> : Cox proportional hazards model 31/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Confidence interval<br />

<strong>ST3242</strong> : Cox proportional hazards model 32/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Confidence interval<br />

This CI can be transformed to a confidence interval for the<br />

hazard ratio.<br />

<strong>ST3242</strong> : Cox proportional hazards model 33/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Confidence interval<br />

<strong>ST3242</strong> : Cox proportional hazards model 34/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

All test:<br />

Three tests<br />

Wald test<br />

score test<br />

likelihood ratio test<br />

H0 : β = 0 versus H1 : β = 0<br />

for h(t, xi) = h0(t, α) exp(βxi)<br />

<strong>ST3242</strong> : Cox proportional hazards model 35/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

H0 true<br />

Wald test<br />

If H0 is true, z 2 ∼ χ 2 1.<br />

z 2 = ˆ β 2<br />

ˆV( ˆ β) = ˆβ 2 I ( ˆβ)<br />

<strong>ST3242</strong> : Cox proportional hazards model 36/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

H0 true<br />

Wald test<br />

If H0 is true, z 2 ∼ χ 2 1.<br />

z 2 = ˆ β 2<br />

ˆV( ˆ β) = ˆβ 2 I ( ˆβ)<br />

<strong>ST3242</strong> : Cox proportional hazards model 36/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

H0 true<br />

Score test<br />

If H0 is true, z ⋆2 ∼ χ 2 1.<br />

z ⋆2 = U(0) 2 I ( ˆ β) −1<br />

<strong>ST3242</strong> : Cox proportional hazards model 37/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

H0 true<br />

Score test<br />

If H0 is true, z ⋆2 ∼ χ 2 1.<br />

z ⋆2 = U(0) 2 I ( ˆ β) −1<br />

<strong>ST3242</strong> : Cox proportional hazards model 37/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

H0 true<br />

Likelihood ratio test<br />

If H0 is true, G ∼ χ 2 1.<br />

G = 2[ℓp( ˆ β) − ℓp(0)]<br />

But<br />

The tests give different p-values.<br />

<strong>ST3242</strong> : Cox proportional hazards model 38/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

H0 true<br />

Likelihood ratio test<br />

If H0 is true, G ∼ χ 2 1.<br />

G = 2[ℓp( ˆ β) − ℓp(0)]<br />

But<br />

The tests give different p-values.<br />

<strong>ST3242</strong> : Cox proportional hazards model 38/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

H0 true<br />

Likelihood ratio test<br />

If H0 is true, G ∼ χ 2 1.<br />

G = 2[ℓp( ˆ β) − ℓp(0)]<br />

But<br />

The tests give different p-values.<br />

<strong>ST3242</strong> : Cox proportional hazards model 38/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

More general test<br />

β has p dimensions<br />

H0 : first q dimensions are equal to specified β ⋆ j<br />

last p − q dimensions are free parameters<br />

H1 : βj = β ⋆ j<br />

for at least one j ≤ q<br />

<strong>ST3242</strong> : Cox proportional hazards model 39/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

More general test<br />

β has p dimensions<br />

H0 : first q dimensions are equal to specified β ⋆ j<br />

last p − q dimensions are free parameters<br />

H1 : βj = β ⋆ j<br />

for at least one j ≤ q<br />

<strong>ST3242</strong> : Cox proportional hazards model 39/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

More general test<br />

β has p dimensions<br />

H0 : first q dimensions are equal to specified β ⋆ j<br />

last p − q dimensions are free parameters<br />

H1 : βj = β ⋆ j<br />

for at least one j ≤ q<br />

<strong>ST3242</strong> : Cox proportional hazards model 39/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

More general test<br />

β has p dimensions<br />

H0 : first q dimensions are equal to specified β ⋆ j<br />

last p − q dimensions are free parameters<br />

H1 : βj = β ⋆ j<br />

for at least one j ≤ q<br />

<strong>ST3242</strong> : Cox proportional hazards model 39/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

More general test<br />

β has p dimensions<br />

H0 : first q dimensions are equal to specified β ⋆ j<br />

last p − q dimensions are free parameters<br />

H1 : βj = β ⋆ j<br />

for at least one j ≤ q<br />

<strong>ST3242</strong> : Cox proportional hazards model 39/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

More general test<br />

Perform the test by fitting two nested models<br />

General model<br />

Lets all p parameters be estimated.<br />

ℓp( ˆ β)<br />

Particular model<br />

Fixes q parameters at hypothesised values.<br />

Lets other p − q parameters be estimated.<br />

ℓp(β ⋆<br />

1:q, ˆ β q+1:p)<br />

Test statistic<br />

If H0 is true, G = 2[ℓp( ˆ β) − ℓp(β ⋆<br />

1:q, ˆ β q+1:p)] ∼ χ 2 q<br />

<strong>ST3242</strong> : Cox proportional hazards model 40/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

More general test<br />

Perform the test by fitting two nested models<br />

General model<br />

Lets all p parameters be estimated.<br />

ℓp( ˆ β)<br />

Particular model<br />

Fixes q parameters at hypothesised values.<br />

Lets other p − q parameters be estimated.<br />

ℓp(β ⋆<br />

1:q, ˆ β q+1:p)<br />

Test statistic<br />

If H0 is true, G = 2[ℓp( ˆ β) − ℓp(β ⋆<br />

1:q, ˆ β q+1:p)] ∼ χ 2 q<br />

<strong>ST3242</strong> : Cox proportional hazards model 40/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

More general test<br />

Perform the test by fitting two nested models<br />

General model<br />

Lets all p parameters be estimated.<br />

ℓp( ˆ β)<br />

Particular model<br />

Fixes q parameters at hypothesised values.<br />

Lets other p − q parameters be estimated.<br />

ℓp(β ⋆<br />

1:q, ˆ β q+1:p)<br />

Test statistic<br />

If H0 is true, G = 2[ℓp( ˆ β) − ℓp(β ⋆<br />

1:q, ˆ β q+1:p)] ∼ χ 2 q<br />

<strong>ST3242</strong> : Cox proportional hazards model 40/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

More general test<br />

Perform the test by fitting two nested models<br />

General model<br />

Lets all p parameters be estimated.<br />

ℓp( ˆ β)<br />

Particular model<br />

Fixes q parameters at hypothesised values.<br />

Lets other p − q parameters be estimated.<br />

ℓp(β ⋆<br />

1:q, ˆ β q+1:p)<br />

Test statistic<br />

If H0 is true, G = 2[ℓp( ˆ β) − ℓp(β ⋆<br />

1:q, ˆ β q+1:p)] ∼ χ 2 q<br />

<strong>ST3242</strong> : Cox proportional hazards model 40/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

More general test<br />

Perform the test by fitting two nested models<br />

General model<br />

Lets all p parameters be estimated.<br />

ℓp( ˆ β)<br />

Particular model<br />

Fixes q parameters at hypothesised values.<br />

Lets other p − q parameters be estimated.<br />

ℓp(β ⋆<br />

1:q, ˆ β q+1:p)<br />

Test statistic<br />

If H0 is true, G = 2[ℓp( ˆ β) − ℓp(β ⋆<br />

1:q, ˆ β q+1:p)] ∼ χ 2 q<br />

<strong>ST3242</strong> : Cox proportional hazards model 40/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

More general test<br />

Perform the test by fitting two nested models<br />

General model<br />

Lets all p parameters be estimated.<br />

ℓp( ˆ β)<br />

Particular model<br />

Fixes q parameters at hypothesised values.<br />

Lets other p − q parameters be estimated.<br />

ℓp(β ⋆<br />

1:q, ˆ β q+1:p)<br />

Test statistic<br />

If H0 is true, G = 2[ℓp( ˆ β) − ℓp(β ⋆<br />

1:q, ˆ β q+1:p)] ∼ χ 2 q<br />

<strong>ST3242</strong> : Cox proportional hazards model 40/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Worcester heart attacks<br />

x b<br />

i is body mass index<br />

x a<br />

i is age at heart attack<br />

x s<br />

i is sex (0 male, 1 female)<br />

x h<br />

i is history of heart problems (0 no history, 1 history)<br />

First fit terms individually<br />

<strong>ST3242</strong> : Cox proportional hazards model 41/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Worcester heart attacks<br />

x b<br />

i is body mass index<br />

x a<br />

i is age at heart attack<br />

x s<br />

i is sex (0 male, 1 female)<br />

x h<br />

i is history of heart problems (0 no history, 1 history)<br />

First fit terms individually<br />

<strong>ST3242</strong> : Cox proportional hazards model 41/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Commands<br />

<strong>ST3242</strong> : Cox proportional hazards model 42/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

BMI<br />

<strong>ST3242</strong> : Cox proportional hazards model 43/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Age<br />

<strong>ST3242</strong> : Cox proportional hazards model 44/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

Sex<br />

<strong>ST3242</strong> : Cox proportional hazards model 45/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

History<br />

<strong>ST3242</strong> : Cox proportional hazards model 46/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

BMI, age, sex<br />

Male mean age: 67; female mean age: 75.<br />

<strong>ST3242</strong> : Cox proportional hazards model 47/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

BMI, age<br />

<strong>ST3242</strong> : Cox proportional hazards model 48/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

BMI, age<br />

<strong>ST3242</strong> : Cox proportional hazards model 48/49


Reminder Maximising the partial likelihood Estimation in R Hypothesis testing Example<br />

BMI, age<br />

<strong>ST3242</strong> : Cox proportional hazards model 49/49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!