Lecture 17: Cox Proportional Hazards Model: James J. Dignam
Lecture 17: Cox Proportional Hazards Model: James J. Dignam
James J. Dignam
h i (t ) = exp(β1 x 1i + β2 x 2i + · · · + βp x pi )h 0 (t ) (1)
Model again is
h i (t ) = exp(β1 x 1i + β2 x 2i + · · · + βp x pi )h 0 (t ) (2)
h i (t ) exp(β1 x i 1 + · · · + βp x i p )h 0 (t )
=
h j (t ) exp(β1 x j 1 + · · · + βp x j p )h 0 (t )
= exp(β1 (x i 1 − x j 1 ) + β2 (x i 2 − x j 2 ) + · · · βp (x i p − x j p )) (3)
Table 1: Survival times (in months) of women with tumors that were
negatively or positively stained with HPA. Censored survival times are labeled
with an asterisk.
Negative staining Positive staining
23 5 68
47 8 71
69 10 76*
70* 13 105*
71* 18 107*
100* 24 109*
101* 26 113
148 26 116*
181 31 118
198* 35 143
208* 40 154*
212* 41 162*
224* 48 188*
50 212*
59 217*
61 225*
h i (t ) = e βxi h 0 (t )
f a i l u r e _d : status
analysis time _t : time
W e i b u l l r e g r e s s i o n −− l o g r e l a t i v e − hazard form
No . o f s u b j e c t s = 45 Number o f obs = 45
No . o f f a i l u r e s = 26
Time a t r i s k = 4331
LR c h i 2 ( 1 ) = 4.14
Log l i k e l i h o o d =
− 60.883962 Prob > c h i 2 = 0.0418
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
_ t | Haz . R a t i o Std . E r r . z P> | z | [95% Conf . I n t e r v a l ]
−−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2. stain | 2.545372 1.271665 1.87 0.061 .9560751 6.776579
_cons | .0041365 .0037257 − 6.09 0.000 .0007079 .0241707
−−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
/ l n _ p | − .0646417 .1673746 − 0.39 0.699 − .3926898 .2634064
−−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
p | .9374033 .1568975 .6752382 1.301355
1/p | 1.066777 .1785513 .7684296 1.480959
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
. s t c o x i . s t a i n , nolog
f a i l u r e _d : status
analysis time _t : time
No . o f s u b j e c t s = 45 Number o f obs = 45
No . o f f a i l u r e s = 26
Time a t r i s k = 4331
LR c h i 2 ( 1 ) = 3.87
Log l i k e l i h o o d =
− 85.047944 Prob > c h i 2 = 0.0491
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
_ t | Haz . R a t i o Std . E r r . z P> | z | [95% Conf . I n t e r v a l ]
−−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2. stain | 2.479398 1.241987 1.81 0.070 .9288808 6.618086
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Note that the hazard ratios are almost the same for the two
models; this is because the proportional hazards is quite a good
description for these data, and the Weibull is not a bad choice for
the underlying hazard (see plot last lecture)
J. Dignam (UChicago) Lecture 17 Mar. 10, 2020 18 / 40
Prognosis for women with breast cancer : Cox PH
model ( log hazard ratio form)
. s t c o x i . s t a i n , nolog nohr
f a i l u r e _d : status
analysis time _t : time
No . o f s u b j e c t s = 45 Number o f obs = 45
No . o f f a i l u r e s = 26
Time a t r i s k = 4331
LR c h i 2 ( 1 ) = 3.87
Log l i k e l i h o o d = − 85.047944 Prob > c h i 2 = 0.0491
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
_t | Coef . Std . E r r . z P> | z | [95% Conf . I n t e r v a l ]
−−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2. stain | .9080157 .5009228 1.81 0.070 − .0737749 1.889806
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
h i (t ) = h 0 (t ) exp(βT x i )
and
Hi (t ) = H0 (t ) exp(βT x i )
So
S i (t ) = e −Hi (t )
Tx
= e −H0 (t ) exp(β i)
exp(βT x
= {e −H0 (t ) } i)
exp(βT x i )
= {S 0 (t )}
We can generate the baseline S(t ) function, and all S(t |X ) curves are a
function of this via the quantity
exp(β1 x 1 + β2 x 2 + · · · + β j x j + · · · + βp x p )
. q u i e t l y s t c o x i . s t a i n , basesurv ( s0 )
. s o r t time
. l i s t t i m e s t a t u s s0 i n 1/24
. twoway l i n e s0 survpos t i m e
1
.8
.6
.4
.2
. use treatment_of_hypernephroma . d t a
. l i s t i n 1/10
+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| nephre~y age time status |
|−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−|
1. | 0 1 9 1 |
2. | 0 1 6 1 |
3. | 0 1 21 1 |
4. | 0 2 15 1 |
5. | 0 2 8 1 |
|−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−|
6. | 0 2 17 1 |
7. | 0 3 12 1 |
8. | 1 1 104 0 |
9. | 1 1 9 1 |
10. | 1 1 56 1 |
+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
Let Ag e _2 be the indicator for age being in the range 60-70, and
Ag e _3 be the indicator for age being in the range >70. Then a
proportional hazard model could be specified to be
f a i l u r e _d : status
analysis time _t : time
No . o f s u b j e c t s = 36 Number o f obs = 36
No . o f f a i l u r e s = 32
Time a t r i s k = 1340
LR c h i 2 ( 3 ) = 12.16
Log l i k e l i h o o d = − 82.75418 Prob > c h i 2 = 0.0069
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
_t | Coef . Std . E r r . z P> | z | [95% Conf . I n t e r v a l ]
−−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
nephrectomy | − 1.411453 .515237 − 2.74 0.006 − 2.421299 − .4016071
|
age |
2 | .0125313 .4245943 0.03 0.976 − .8196582 .8447209
3 | 1.341567 .5917646 2.27 0.023 .1817294 2.501404
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
. l i n c o m nephrectomy * ( − 1 ) + 3 . age * 1
( 1) − nephrectomy + 3 . age = 0
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
_t | Coef . Std . E r r . z P> | z | [95% Conf . I n t e r v a l ]
−−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
(1) | 2.75302 .7521929 3.66 0.000 1.278749 4.227291
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
. gen s u r v j = s0 ^ ( exp ( − 1 . 4 1 1 ) )
. s o r t time
. twoway l i n e s u r v k s u r v j s0 t i m e
1
.8
.6
.4
.2
0
0 50 100 150
time
survk survj
baseline survivor
2 3 4 5
ltime
f a i l u r e _d : status
analysis time _t : time
No . o f s u b j e c t s = 45 Number o f obs = 45
No . o f f a i l u r e s = 26
Time a t r i s k = 4331
LR c h i 2 ( 1 ) = 3.87
Log l i k e l i h o o d = − 85.047944 Prob > c h i 2 = 0.0491
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
_ t | Haz . R a t i o Std . E r r . z P> | z | [95% Conf . I n t e r v a l ]
−−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
stain | 2.479398 1.241987 1.81 0.070 .9288808 6.618086
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
. estat phtest
Time : Time
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
| chi2 df Prob > c h i 2
−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
global test | 2.08 1 0.1492
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
4 3
-ln[-ln(Survival Probability)]
0 1 -1 2
1 2 3 4 5
ln(analysis time)
nephrectomy = 0 nephrectomy = 1
0 10 20 30 40
analysis time
Number at risk
trt = Placebo 309 114 47 13 0
trt = Bev 312 174 49 8 0
Time : Time
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
| chi2 df Prob > c h i 2
−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
global test | 50.37 1 0.0000
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
. s t p h p l o t , by ( t r t )
Diagnostic plot:
6
-ln[-ln(Survival Probability)]
0 2-2 4
-4 -2 0 2 4
ln(analysis time)
ausal
al - Example of more flexible analysis
2,286 (54.4)
1,916 (45.6)
1,964 (37.5)
3,278 (62.5)
4,250
5,194
45.0
55.0
\0.001
These estimates are actually from stratified (by treatment type) model -
294 (7.0)
ne receptors (fmol/mg)
224 (4.3) 518 5.5
to3,264
permit
(77.7) inference
937 (17.9) on4,201
whether44.5 hazard shapes differ by treatment
\0.001
458 (10.9) 493 (9.4) 951 10.1
group.
480 (11.4)Other covariates
3,812 (72.7) 4,292 within
45.4 strata are assumed PH
Cox PH model
A widely used method to relate covariates to hazard and survivor
function
Flexible, but does have key assumption that should be checked -
extensions available
Course Wrap-up
1 One more HW - Due Monday - key available after you turn in.
2 Some notes on topics for Final Exam - posted this week
3 Final Exam - March 17 - 10:30-12:30pm