Introduction Residuals Testing Example - KIregstat/presentations/perme_ph_regstat2009.pdf ·...

Post on 01-Jun-2020

8 views 0 download

Transcript of Introduction Residuals Testing Example - KIregstat/presentations/perme_ph_regstat2009.pdf ·...

Introduction Residuals Testing Example

Testing the proportional hazards

assumption

Maja Pohar Perme1,

Janez Stare1, Robin Henderson2

1IBMI, Faculty of Medicine, Ljubljana, Slovenia

2University of Newcastle, UK

Stockholm, September 2009

Introduction Residuals Testing Example

Proportional excess hazard assumption

Additive model

λO = λP + λE

λO(t |Z ) = λP(t) + λ0(t)eβZ

Notation

λO observed hazard

λP populationhazard

λE excess hazard =disease specifichazard

λ0 baseline excesshazard

Z covariates

β regressioncoefficients

Introduction Residuals Testing Example

Proportional excess hazard assumption

Additive model

λO = λP + λE

λO(t |Z ) = λP(t) + λ0(t)eβZ

PH assumption: β is constant in time

Notation

λO observed hazard

λP populationhazard

λE excess hazard =disease specifichazard

λ0 baseline excesshazard

Z covariates

β regressioncoefficients

Introduction Residuals Testing Example

Proportional excess hazard assumption

Additive model

λO = λP + λE

λO(t |Z ) = λP(t) + λ0(t)eβZ

PH assumption: β is constant in time

Presentation resume

Present a method for both graphically and

formally testing the PH assumption.

Notation

λO observed hazard

λP populationhazard

λE excess hazard =disease specifichazard

λ0 baseline excesshazard

Z covariates

β regressioncoefficients

Introduction Residuals Testing Example

Motivational example

Colon cancer, additive model, follow-up time 5 years

Estimate Std. Error z value p

sex -0.091 0.051 -1.767 0.077

age 0.006 0.002 2.772 0.006

Introduction Residuals Testing Example

Motivational example

Colon cancer, additive model, follow-up time 5 years

Estimate Std. Error z value p

sex -0.091 0.051 -1.767 0.077

age 0.006 0.002 2.772 0.006

Age effect allowed to change after the first year

Estimate Std. Error z value p

sex -0.096 0.051 -1.878 0.060

age1 0.041 0.007 6.281 < 0.001

age2 0.002 0.002 0.676 0.499

Likelihood ratio test p < 0.0001

Introduction Residuals Testing Example

Motivational example - Questions

Age effect allowed to change after the first year

Estimate Std. Error z value p

sex -0.096 0.051 -1.878 0.060

age1 0.041 0.007 6.281 < 0.001

age2 0.002 0.002 0.676 0.499

It seems that the effect of age varies in time, but

Introduction Residuals Testing Example

Motivational example - Questions

Age effect allowed to change after the first year

Estimate Std. Error z value p

sex -0.096 0.051 -1.878 0.060

age1 0.041 0.007 6.281 < 0.001

age2 0.002 0.002 0.676 0.499

It seems that the effect of age varies in time, but

Why did we get suspicious?

Introduction Residuals Testing Example

Motivational example - Questions

Age effect allowed to change after the first year

Estimate Std. Error z value p

sex -0.096 0.051 -1.878 0.060

age1 0.041 0.007 6.281 < 0.001

age2 0.002 0.002 0.676 0.499

It seems that the effect of age varies in time, but

Why did we get suspicious?

How do we choose the follow-up intervals?

Introduction Residuals Testing Example

Motivational example - Questions

Age effect allowed to change after the first year

Estimate Std. Error z value p

sex -0.096 0.051 -1.878 0.060

age1 0.041 0.007 6.281 < 0.001

age2 0.002 0.002 0.676 0.499

It seems that the effect of age varies in time, but

Why did we get suspicious?

How do we choose the follow-up intervals?

Is the model now sensible (does it fit well?)

Introduction Residuals Testing Example

Proportional excess hazard assumption

Additive model

λO = λP + λE

λO(t |Z ) = λP(t) + λ0(t)eβZ

Notation

λO observed hazard

λP populationhazard

λE excess hazard =disease specifichazard

λ0 baseline excesshazard

Z covariates

β regressioncoefficients

Introduction Residuals Testing Example

Proportional excess hazard assumption

Additive model

λO = λP + λE

λO(t |Z ) = λP(t) + λ0(t)eβZ

PH assumption: β is constant in time

Notation

λO observed hazard

λP populationhazard

λE excess hazard =disease specifichazard

λ0 baseline excesshazard

Z covariates

β regressioncoefficients

Introduction Residuals Testing Example

Proportional excess hazard assumption

Additive model

λO = λP + λE

λO(t |Z ) = λP(t) + λ0(t)eβZ

PH assumption: β is constant in time

Cox model

λO(t |Z ) = λ0(t)eβZ

Schoenfeld residuals present a standard

method for checking the PH assumption

Notation

λO observed hazard

λP populationhazard

λE excess hazard =disease specifichazard

λ0 baseline excesshazard

Z covariates

β regressioncoefficients

Introduction Residuals Testing Example

Definition of residuals

Cox model

Schoenfeld residuals

Zi

additive model

partial residuals

Zi

Notation

Z covariate

ti ith eventtime

0 1 2 3 4 5

45

50

55

60

65

Time

Age

Introduction Residuals Testing Example

Definition of residuals

Cox model

Schoenfeld residuals

Zi E(Z , ti)

additive model

partial residuals

Zi E(Z , ti)

Notation

Z covariate

ti ith eventtime

0 1 2 3 4 5

45

50

55

60

65

Time

Age

Introduction Residuals Testing Example

Definition of residuals

Cox model

Schoenfeld residuals

Zi − E(Z , ti)

additive model

partial residuals

Zi − E(Z , ti)

Notation

Z covariate

ti ith eventtime

0 1 2 3 4 5

45

50

55

60

65

Time

Age

Introduction Residuals Testing Example

Definition of residuals

Cox model

Schoenfeld residuals

Ui = Zi − E(Z , ti)

additive model

partial residuals

Ui : = Zi − E(Z , ti)

Notation

Z covariate

ti ith eventtime

Ui residual

0 1 2 3 4 5

45

50

55

60

65

Time

Age

Introduction Residuals Testing Example

Definition of residuals

Cox model

Schoenfeld residuals

Ui = Zi − E(Z , ti)

= Zi −

X

j∈Ri

Zjλj

P

k∈Ri

λk

additive model

partial residuals

Ui : = Zi − E(Z , ti)

= Zi −

X

j∈Ri

Zj

λPj + λEjP

k∈Ri

(λPk + λEk )

Notation

Z covariate

ti ith eventtime

Ui residual

Ri risk set attime i

λj hazard forperson j

λP populationhazard

λE excesshazard

0 1 2 3 4 5

45

50

55

60

65

Time

Age

Introduction Residuals Testing Example

Graphical inspection

Time

Be

ta(t

) fo

r x

0.00077 0.0029 0.0079 0.019 0.042 0.086 0.2 0.63

−4

−2

02

46

Introduction Residuals Testing Example

Graphical inspection

Time

Be

ta(t

) fo

r x

0.00077 0.0029 0.0079 0.019 0.042 0.086 0.2 0.63

−4

−2

02

46

Time

Be

ta(t

) fo

r x

0.00096 0.0092 0.021 0.19 0.47 0.96 2.4

−2

02

4

Introduction Residuals Testing Example

Graphical inspection

Time

Be

ta(t

) fo

r x

0.00077 0.0029 0.0079 0.019 0.042 0.086 0.2 0.63

−4

−2

02

46

Time

Be

ta(t

) fo

r x

0.00096 0.0092 0.021 0.19 0.47 0.96 2.4

−2

02

4

β0(ti) ≃ β +(

∂∂β{E(Z |ti , β)}

)−1E [U(β, t)]

Introduction Residuals Testing Example

Graphical inspection

Time

Be

ta(t

) fo

r x

0.00077 0.0029 0.0079 0.019 0.042 0.086 0.2 0.63

−4

−2

02

46

Time

Be

ta(t

) fo

r x

0.00096 0.0092 0.021 0.19 0.47 0.96 2.4

−2

02

4

plot(rs.zph(fit))

Introduction Residuals Testing Example

Testing the PH assumption

The cumulative sum of standardized residuals

Sum up the standardized residuals in time

If the null hypothesis is true, the average is 0

If the null hypothesis is true, the cumulative sum

oscillates around 0

0.0 0.2 0.4 0.6 0.8 1.0

−3 e−

04

−1 e−

04

1 e

−04

Time

sta

ndard

ized r

esid

uals

0.0 0.2 0.4 0.6 0.8 1.0

−2

−1

01

2

time

bro

wnia

n m

otion

Introduction Residuals Testing Example

Testing the PH assumption

The cumulative sum of standardized residuals

Sum up the standardized residuals in time

If the null hypothesis is true, the average is 0

If the null hypothesis is true, the cumulative sum

oscillates around 0

If we know the true β, this process converges to

Brownian motion

0.0 0.2 0.4 0.6 0.8 1.0

−3 e−

04

−1 e−

04

1 e

−04

Time

sta

ndard

ized r

esid

uals

0.0 0.2 0.4 0.6 0.8 1.0

−2

−1

01

2

time

bro

wnia

n m

otion

Introduction Residuals Testing Example

Testing the PH assumption

The Brownian bridge process

Tie down the cumulative sum process at the end

If the null hypothesis is true, the tied down process

(based on the estimated model) can be approximated

with Brownian bridge

0.0 0.2 0.4 0.6 0.8 1.0

−3 e−

04

−1 e−

04

1 e

−04

Time

sta

ndard

ized r

esid

uals

0.0 0.2 0.4 0.6 0.8 1.0

−2

−1

01

2

time

bro

wnia

n m

otion

0.0 0.2 0.4 0.6 0.8 1.0

−2

−1

01

2

time

resid

ual

age

Introduction Residuals Testing Example

Testing the PH assumption

The Brownian bridge process

Tie down the cumulative sum process at the end

If the null hypothesis is true, the tied down process

(based on the estimated model) can be approximated

with Brownian bridge

A sensible test statistic is the maximum of the process

0.0 0.2 0.4 0.6 0.8 1.0

−2

−1

01

2

time

resid

ual

age

Introduction Residuals Testing Example

Brownian motion constructed as the sum of residuals

Cox model & additive model

B(β0,k

n) =

1√

n

kX

i=1

Ui (β0)p

Vi (β0)

n→∞→ Brownian motion

BB(β0,k

n) = B(β0,

k

n)−

k

nB(β0, 1)

n→∞→ Brownian bridge

Notation

Ui Schoenfeld-likeresiduals

V variance

n number ofdeaths

β0 trueregressioncoefficient

0.0 0.2 0.4 0.6 0.8 1.0

−3 e−

04

−1 e−

04

1 e

−04

Time

sta

ndard

ized r

esid

uals

0.0 0.2 0.4 0.6 0.8 1.0

−2

−1

01

2

time

bro

wnia

n m

otion

0.0 0.2 0.4 0.6 0.8 1.0

−2

−1

01

2

time

resid

ual

age

Introduction Residuals Testing Example

Brownian motion constructed as the sum of residuals

Cox model & additive model

B(β0,k

n) =

1√

n

kX

i=1

Ui (β0)p

Vi (β0)

n→∞→ Brownian motion

BB(β0,k

n) = B(β0,

k

n)−

k

nB(β0, 1)

n→∞→ Brownian bridge

Notation

Ui Schoenfeld-likeresiduals

V variance

n number ofdeaths

β0 trueregressioncoefficient

0.0 0.2 0.4 0.6 0.8 1.0

−3 e−

04

−1 e−

04

1 e

−04

Time

sta

ndard

ized r

esid

uals

0.0 0.2 0.4 0.6 0.8 1.0

−2

−1

01

2

time

bro

wnia

n m

otion

0.0 0.2 0.4 0.6 0.8 1.0

−2

−1

01

2

time

resid

ual

age

Introduction Residuals Testing Example

Brownian bridge example; β changes: −0.5 → 0.5

0.0 0.2 0.4 0.6 0.8 1.0

−2

−1

01

2

Time

sta

ndard

ized r

esid

uals

0.0 0.2 0.4 0.6 0.8 1.0

−6

−4

−2

02

46

time

resid

ual

Introduction Residuals Testing Example

Tests based on Brownian bridge properties

β0 in time brownian bridge process test statistic

T1

max(abs(BB(t))

T2

max using weighted residuals

T3

Cramer−Von Mises∫ 1

0BB2(t)dt − (

∫ 1

0BB(t)dt)2

Introduction Residuals Testing Example

Example - colon cancer

Graphical presentation

plot(rs.zph(fit))

0 1 2 3 4 5

−2

−1

01

2

Time

Beta

(t)

for

age

Introduction Residuals Testing Example

Example - colon cancer

Graphical presentation

plot(rs.zph(fit))

0 1 2 3 4 5

−2

−1

01

2

Time

Beta

(t)

for

age

Test using the weighted max of the BB process

rs.br(fit) age: p < 0.001

Introduction Residuals Testing Example

Example - colon cancer

Graphical presentation

plot(rs.zph(fit))

0 1 2 3 4 5

−2

−1

01

2

Time

Beta

(t)

for

age

Test using the weighted max of the BB process

rs.br(fit) age: p < 0.001

Test the model with varying effect

rs.br(fit1) age: p = 0.033

Introduction Residuals Testing Example

Discussion

To sum up

for each covariate in the model, we define residuals

(observed value minus predicted value of covariate)

Introduction Residuals Testing Example

Discussion

To sum up

for each covariate in the model, we define residuals

(observed value minus predicted value of covariate)

smoothed average through residuals describes the

behaviour of β in time

Introduction Residuals Testing Example

Discussion

To sum up

for each covariate in the model, we define residuals

(observed value minus predicted value of covariate)

smoothed average through residuals describes the

behaviour of β in time

the null hypothesis can be tested using the cumulative

sums of standardised residuals

Introduction Residuals Testing Example

Discussion

To sum up

for each covariate in the model, we define residuals

(observed value minus predicted value of covariate)

smoothed average through residuals describes the

behaviour of β in time

the null hypothesis can be tested using the cumulative

sums of standardised residuals

Note

The described methods test the proportional excess

hazard assumption, assuming that all the other

assumptions of the model are met. If this is not true, it

might affect the tests.

Introduction Residuals Testing Example

Bibliography

Stare J., Pohar M., Henderson R.Goodness of fit of relative survival models

Statistics in Medicine, 2005

Pohar M., Stare J.Relative survival analysis in R

Computer methods and programs in biomedicine, 2006

Pohar M., Stare J.Making Relative Survival Analysis Relatively Easy

Computers in Biology and Medicine, 2007