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.

Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<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/44


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

NUS news<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

NUS news<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

NUS news<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

NUS news<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

NUS news<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

NUS news<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Plan for today<br />

Go over mock mid-term test<br />

3pm feedback<br />

Lecture: confidence intervals for the Cox phm<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Exam advice<br />

Read all questions at start of exam<br />

Read all instructions<br />

Ensure do everything asked and nothing more<br />

Write as neatly as you can<br />

Don’t “do a Ravi”<br />

Avoid rounding too much too soon<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Exam advice<br />

INSTRUCTIONS TO CANDIDATES:<br />

1 This test contains EIGHT questions and comprises<br />

FOUR printed pages.<br />

2 Answer ALL questions for a total of 100 marks.<br />

3 This is a closed-book test; only non-programmable<br />

calculators are allowed.<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q1: [3]<br />

If the survival function is S(t), what is the hazard function<br />

h(t)?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q2: [6]<br />

If the hazard function is h(t) = θt for a parameter θ > 0,<br />

what are the survival and density functions?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q3: [10]<br />

If survival times in the absence of censoring are distributed<br />

according to a log-logistic distribution with parameters κ and<br />

λ, the hazard and survival functions are<br />

h(t) = λκtκ−1<br />

1 + λtκ S(t) =<br />

1<br />

1 + λtκ respectively. If we have observed data of the form (ti, δi),<br />

where δi = 1 if individual i fails at time ti and δi = 0 if i is<br />

right-censored at ti, for i = 1, . . . , m, what is the<br />

log-likelihood function?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q4: [6]<br />

Consider a study into the length of time people can survive<br />

without purchasing or receiving plastic goods. The study<br />

starts at time Tstart and ends at time Tend. Three nus<br />

students are among the participants.<br />

Student A is recruited to the study at time Tstart. She<br />

buys no plastic until time tA < Tend, when she buys a<br />

bottle of Pocari Sweat.<br />

For each student, say if the datum is uncensored,<br />

right-censored, left-censored or interval-censored.<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q4: [6]<br />

Consider a study into the length of time people can survive<br />

without purchasing or receiving plastic goods. The study<br />

starts at time Tstart and ends at time Tend. Three nus<br />

students are among the participants.<br />

Student B is recruited to the study at time Tstart. He<br />

reports to the organisers at time tB < Tend that he has<br />

bought no plastics, but they never hear from him again.<br />

For each student, say if the datum is uncensored,<br />

right-censored, left-censored or interval-censored.<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q4: [6]<br />

Consider a study into the length of time people can survive<br />

without purchasing or receiving plastic goods. The study<br />

starts at time Tstart and ends at time Tend. Three nus<br />

students are among the participants.<br />

Student C is recruited to the study at time<br />

tC ∈ (Tstart, Tend). She buys no plastic for the remainder<br />

of the study.<br />

For each student, say if the datum is uncensored,<br />

right-censored, left-censored or interval-censored.<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q5: [12]<br />

Use the delta method to approximate the mean and variance<br />

of √ X , where X is a random variable with mean µ and<br />

variance σ 2 . When do you expect these will provide a good<br />

approximation to the true mean and variance of √ X ?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q6(i): [36]<br />

Calculate and sketch the Kaplan–Meier estimate of S(t) for<br />

the following data, where δi = 1 if individual i died at time ti<br />

and δi = 0 if i was censored at that time.<br />

i ti δi<br />

1 0.6 1<br />

2 0.9 1<br />

3 1.1 0<br />

4 1.5 1<br />

5 2.0 0<br />

6 2.0 0<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q6(ii): [36]<br />

Recall that<br />

<br />

ˆV{ˆS(t)} = ˆS(t)<br />

2<br />

d(i)<br />

n(i<br />

t (i)≤t<br />

− )(n(i − ) − d(i))<br />

where t(i) is the ith ordered event time, d(i) is the number of<br />

deaths at that time and n(i − ) is the number at risk an instant<br />

before that time.<br />

Construct the “naïve” 95% confidence interval described in<br />

the lecture notes for S(1), the probability of surviving at least<br />

to one time unit. What is the probability the true value of<br />

S(1) lies within your confidence interval?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q7: [12]<br />

The following are data on the times to recurrence of breast<br />

cancer following treatment in German women. These data<br />

have been grouped according to whether the patients have<br />

undergone the menopause (g = 2) or not (g = 1); t(i) is the<br />

time in years until the ith unique recurrence time, ng,(i − ) is the<br />

total number at risk in group g an instant before time t(i),<br />

dg,(i) is the number in group g that had a recurrence at time<br />

t(i), while n(i − ) = n1,(i − ) + n2,(i − ) and d(i) = d1,(i) + d2,(i). The<br />

columns marked êg,(i) and ˆvg,(i) are the expected value and<br />

variance of dg,(i) under the hypothesis that menopause is<br />

independent of recurrence, respectively. Note that for your<br />

convenience, the data have been grouped into years. [To find<br />

out more about these data, see Hosmer et al., 2008.]<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q7: [12]<br />

i t (i) n 1,(i − ) n 2,(i − ) n (i − ) d 1,(i) d 2,(i) d (i) ê 1,(i) ê 2,(i) ˆv 1,(i)<br />

1 1 290 396 686 29 27 56 23.7 32.3 12.6<br />

2 2 245 357 602 44 65 109 44.4 64.6 21.6<br />

3 3 183 275 458 20 39 59 23.6 35.4 12.4<br />

4 4 140 191 331 16 23 39 16.5 22.5 8.4<br />

5 5 98 130 228 4 18 22 9.5 12.5 4.9<br />

6 6 56 65 121 6 5 11 5.1 5.9 2.5<br />

7 7 14 22 36 0 3 3 1.2 1.8 0.7<br />

Test the hypothesis that the menopause is independent of<br />

breast cancer recurrence.<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q8(i): [15]<br />

Given that the Cox proportional hazards model for a single<br />

continuous covariate xi is<br />

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

for individual i, what is the corresponding survival function<br />

incorporating this covariate?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Q8(ii): [15]<br />

What is the hazard ratio comparing an individual with<br />

covariate x1 to one with covariate x2 at time t?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for β, hazard ratios<br />

So far. . .<br />

Saw an equation for asymptotic distribution of ˆβ:<br />

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

Can replace by observed information:<br />

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

R gives us standard errors for the individual βs<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for β, hazard ratios<br />

So far. . .<br />

Saw an equation for asymptotic distribution of ˆβ:<br />

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

Can replace by observed information:<br />

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

R gives us standard errors for the individual βs<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for β, hazard ratios<br />

So far. . .<br />

Saw an equation for asymptotic distribution of ˆβ:<br />

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

Can replace by observed information:<br />

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

R gives us standard errors for the individual βs<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for β, hazard ratios<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for β, hazard ratios<br />

We want more!<br />

CIs for β<br />

CIs for hazard ratio between two categories<br />

CIS for hazard ratio between two individuals<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for β<br />

The asymptotic distribution of β can be estimated using the<br />

observed information<br />

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

If β is vector of length p, I( ˆ β) is p × p matrix<br />

i, j element is<br />

− d2 lp(ˆβ)<br />

dβi dβj<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

where<br />

⎛<br />

⎝<br />

Example<br />

⎛<br />

⎝<br />

ˆβ1<br />

ˆβ2<br />

ˆβ3<br />

⎞<br />

σ11 σ12 σ13<br />

σ21 σ22 σ23<br />

σ31 σ32 σ33<br />

⎛⎛<br />

⎠ ∼ N ⎝⎝<br />

⎞<br />

⎠ =<br />

⎛<br />

⎜<br />

⎝<br />

β1<br />

β2<br />

β3<br />

⎞<br />

⎛<br />

⎠ , ⎝<br />

σ11 σ12 σ13<br />

σ21 σ22 σ23<br />

σ31 σ32 σ33<br />

⎞⎞<br />

⎠⎠<br />

− d2 lp(ˆβ)<br />

dβ1 dβ1 − d2 lp( ˆ β)<br />

dβ1 dβ2 − d2 lp( ˆ β)<br />

dβ1 dβ3<br />

− d2 lp(ˆβ)<br />

dβ2 dβ1 − d2 lp(ˆβ)<br />

dβ2 dβ2 − d2 lp(ˆβ)<br />

dβ2 dβ3<br />

− d2 lp( ˆ β)<br />

dβ3 dβ1 − d2 lp( ˆ β)<br />

dβ3 dβ2 − d2 lp( ˆ β)<br />

dβ3 dβ3<br />

<strong>ST3242</strong> : Cox proportional hazards model 28/44<br />

⎞<br />

⎟<br />

⎠<br />

−1


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Example<br />

If ⎛<br />

⎝<br />

ˆβ1<br />

ˆβ2<br />

ˆβ3<br />

⎞<br />

⎛⎛<br />

⎠ ∼ N ⎝⎝<br />

β1<br />

β2<br />

β3<br />

⎞<br />

the marginal distribution of ˆβ1 is<br />

R<br />

gives √ σii as standard output!<br />

⎛<br />

⎠ , ⎝<br />

ˆβ1 ∼ N(β1, σ11)<br />

σ11 σ12 σ13<br />

σ21 σ22 σ23<br />

σ31 σ32 σ33<br />

⎞⎞<br />

⎠⎠<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Example<br />

If ⎛<br />

⎝<br />

ˆβ1<br />

ˆβ2<br />

ˆβ3<br />

⎞<br />

⎛⎛<br />

⎠ ∼ N ⎝⎝<br />

β1<br />

β2<br />

β3<br />

⎞<br />

the marginal distribution of ˆβ1 is<br />

R<br />

gives √ σii as standard output!<br />

⎛<br />

⎠ , ⎝<br />

ˆβ1 ∼ N(β1, σ11)<br />

σ11 σ12 σ13<br />

σ21 σ22 σ23<br />

σ31 σ32 σ33<br />

⎞⎞<br />

⎠⎠<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Confidence interval for β<br />

<br />

p β1 − 1.96 √ σ11 < ˆ β1 < β1 + 1.96 √ <br />

σ11 = 0.95<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Confidence interval for β<br />

<br />

p ˆβ1 − 1.96 √ σ11 < β1 < ˆ β1 + 1.96 √ <br />

σ11 = 0.95<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Example<br />

A 95% confidence interval for βbmi is<br />

(−0.0985 − 1.96 × 0.0148, −0.0985 + 1.96 × 0.0148)<br />

= (−0.13, −0.07)<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Confidence interval for g(β)<br />

If (a, b) is a confidence interval for β,<br />

(e a , e b ) is a confidence interval for e β<br />

(e ax , e bx ) is a confidence interval for e βx<br />

What about a CI for e β1−β2 ?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Confidence interval for g(β)<br />

If (a, b) is a confidence interval for β,<br />

(e a , e b ) is a confidence interval for e β<br />

(e ax , e bx ) is a confidence interval for e βx<br />

What about a CI for e β1−β2 ?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Confidence interval for g(β)<br />

If (a, b) is a confidence interval for β,<br />

(e a , e b ) is a confidence interval for e β<br />

(e ax , e bx ) is a confidence interval for e βx<br />

What about a CI for e β1−β2 ?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Confidence interval for g(β)<br />

If (a, b) is a confidence interval for β,<br />

(e a , e b ) is a confidence interval for e β<br />

(e ax , e bx ) is a confidence interval for e βx<br />

What about a CI for e β1−β2 ?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Example<br />

h(t, xla, xad, xsm, xsq) = h0(t) exp(βlaxla+βadxad+βsmxsm+βsqxsq)<br />

where xc = 1 if the individual has cell type c and xc = 0 if<br />

not. Output relative to one category (adeno) as baseline<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Example<br />

h(t, xla, xad, xsm, xsq) = h0(t) exp(βlaxla+βadxad+βsmxsm+βsqxsq)<br />

where xc = 1 if the individual has cell type c and xc = 0 if<br />

not. Output relative to one category (adeno) as baseline<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Multivariate normal distribution<br />

If x ∼ N(µ, Σ) then any subset of the rows of x also has a<br />

Normal distribution with corresponding rows of µ and rows<br />

and columns of Σ.<br />

For example<br />

⎛ ⎞ ⎛⎛<br />

ˆβ1<br />

⎝ ˆβ2<br />

⎠ ∼ N ⎝⎝<br />

ˆβ3<br />

<br />

ˆβ1<br />

⇒ ∼ N<br />

ˆβ3<br />

β1<br />

β2<br />

β3<br />

β1<br />

β3<br />

⎞<br />

⎛<br />

⎠ , ⎝<br />

<br />

,<br />

σ11 σ12 σ13<br />

σ21 σ22 σ23<br />

σ31 σ32 σ33<br />

<br />

σ11 σ13<br />

σ31 σ33<br />

<br />

⎞⎞<br />

⎠⎠<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Multivariate normal distribution<br />

If x ∼ N(µ, Σ) then any subset of the rows of x also has a<br />

Normal distribution with corresponding rows of µ and rows<br />

and columns of Σ.<br />

For example<br />

⎛ ⎞ ⎛⎛<br />

ˆβ1<br />

⎝ ˆβ2<br />

⎠ ∼ N ⎝⎝<br />

ˆβ3<br />

<br />

ˆβ1<br />

⇒ ∼ N<br />

ˆβ3<br />

β1<br />

β2<br />

β3<br />

β1<br />

β3<br />

⎞<br />

⎛<br />

⎠ , ⎝<br />

<br />

,<br />

σ11 σ12 σ13<br />

σ21 σ22 σ23<br />

σ31 σ32 σ33<br />

<br />

σ11 σ13<br />

σ31 σ33<br />

<br />

⎞⎞<br />

⎠⎠<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Properties of Cov<br />

Q: what is V(X + Y )?<br />

A: V(X + Y ) = V(X ) + V(Y ) if X & Y independent<br />

A: V(X + Y ) = V(X ) + V(Y ) + 2C(X , Y )<br />

Q: what is V(X − Y )?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Properties of Cov<br />

Q: what is V(X + Y )?<br />

A: V(X + Y ) = V(X ) + V(Y ) if X & Y independent<br />

A: V(X + Y ) = V(X ) + V(Y ) + 2C(X , Y )<br />

Q: what is V(X − Y )?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Properties of Cov<br />

Q: what is V(X + Y )?<br />

A: V(X + Y ) = V(X ) + V(Y ) if X & Y independent<br />

A: V(X + Y ) = V(X ) + V(Y ) + 2C(X , Y )<br />

Q: what is V(X − Y )?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Properties of Cov<br />

Q: what is V(X + Y )?<br />

A: V(X + Y ) = V(X ) + V(Y ) if X & Y independent<br />

A: V(X + Y ) = V(X ) + V(Y ) + 2C(X , Y )<br />

Q: what is V(X − Y )?<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Properties of Cov<br />

Properties of the covariance<br />

C(X , Y ) = C(Y , X )<br />

C(X , X ) = V(X )<br />

C(aX + b, cY + d) = acC(X , Y )<br />

Q: what is V(X − Y )?<br />

A:<br />

V(X − Y ) = V(X ) + V(−Y ) + 2C(X , −Y )<br />

= V(X ) + V(Y ) − 2C(X , Y )<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Properties of Cov<br />

Properties of the covariance<br />

C(X , Y ) = C(Y , X )<br />

C(X , X ) = V(X )<br />

C(aX + b, cY + d) = acC(X , Y )<br />

Q: what is V(X − Y )?<br />

A:<br />

V(X − Y ) = V(X ) + V(−Y ) + 2C(X , −Y )<br />

= V(X ) + V(Y ) − 2C(X , Y )<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Properties of Cov<br />

Properties of the covariance<br />

C(X , Y ) = C(Y , X )<br />

C(X , X ) = V(X )<br />

C(aX + b, cY + d) = acC(X , Y )<br />

Q: what is V(X − Y )?<br />

A:<br />

V(X − Y ) = V(X ) + V(−Y ) + 2C(X , −Y )<br />

= V(X ) + V(Y ) − 2C(X , Y )<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Properties of Cov<br />

Properties of the covariance<br />

C(X , Y ) = C(Y , X )<br />

C(X , X ) = V(X )<br />

C(aX + b, cY + d) = acC(X , Y )<br />

Q: what is V(X − Y )?<br />

A:<br />

V(X − Y ) = V(X ) + V(−Y ) + 2C(X , −Y )<br />

= V(X ) + V(Y ) − 2C(X , Y )<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Properties of Cov<br />

Properties of the covariance<br />

C(X , Y ) = C(Y , X )<br />

C(X , X ) = V(X )<br />

C(aX + b, cY + d) = acC(X , Y )<br />

Q: what is V(X − Y )?<br />

A:<br />

V(X − Y ) = V(X ) + V(−Y ) + 2C(X , −Y )<br />

= V(X ) + V(Y ) − 2C(X , Y )<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Properties of Cov<br />

Properties of the covariance<br />

C(X , Y ) = C(Y , X )<br />

C(X , X ) = V(X )<br />

C(aX + b, cY + d) = acC(X , Y )<br />

Q: what is V( ˆ βi − ˆ βj)?<br />

A:<br />

V( ˆ βi − ˆ βj) = V( ˆ βi) + V(− ˆ βj) + 2C( ˆ βi, − ˆ βj)<br />

= V( ˆ βi) + V( ˆ βj) − 2C( ˆ βi, ˆ βj)<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for βi − βj<br />

A 95% CI for βi − βj is<br />

ˆβi − ˆ βj ± 1.96 σii + σjj − 2σij<br />

R does it for us!<br />

The coxph functions silently outputs var, the<br />

variance–covariance matrix<br />

phm.cell=coxph(Surv(t,delta)∼factor(Cell))<br />

phm.cellvar<br />

phm.cellcoefficients<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for βi − βj<br />

A 95% CI for βi − βj is<br />

ˆβi − ˆ βj ± 1.96 σii + σjj − 2σij<br />

R does it for us!<br />

The coxph functions silently outputs var, the<br />

variance–covariance matrix<br />

phm.cell=coxph(Surv(t,delta)∼factor(Cell))<br />

phm.cellvar<br />

phm.cellcoefficients<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Example<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Example<br />

95%CI for βsq − βla is<br />

−0.77 − 1.00 ± 1.96 √ 0.0642 + 0.0638 − 2 × 0.0256<br />

i.e. (−0.31, 0.77)<br />

A 95% CI for the hazard ratio comparing squamous to large<br />

cells is<br />

(e −0.31 , e 0.77 ) = (0.73, 2.17)<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for β, hazard ratios<br />

We want more!<br />

CIs for β<br />

CIs for hazard ratio between two categories<br />

CIS for hazard ratio between two individuals<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for hazard ratios<br />

Suppose we want a hazard ratio comparing individuals with x a<br />

and x b<br />

squamous cell, performance of 60, aged 70, with no prior<br />

therapy<br />

large cell, performance of 20, aged 50, with no prior<br />

therapy<br />

Same approach<br />

obtain ˆ β and covariance matrix via coxph<br />

evaluate ˆ β T<br />

xa and ˆ β T<br />

xb evaluate V( ˆ β T<br />

x a − ˆ β T<br />

x b )<br />

95% CI is ˆβ T<br />

x a − ˆβ T<br />

x b ±<br />

<br />

V(ˆβ T<br />

x a − ˆβ T<br />

x b )<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for hazard ratios<br />

Suppose we want a hazard ratio comparing individuals with x a<br />

and x b<br />

squamous cell, performance of 60, aged 70, with no prior<br />

therapy<br />

large cell, performance of 20, aged 50, with no prior<br />

therapy<br />

Same approach<br />

obtain ˆ β and covariance matrix via coxph<br />

evaluate ˆ β T<br />

xa and ˆ β T<br />

xb evaluate V( ˆ β T<br />

x a − ˆ β T<br />

x b )<br />

95% CI is ˆβ T<br />

x a − ˆβ T<br />

x b ±<br />

<br />

V(ˆβ T<br />

x a − ˆβ T<br />

x b )<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for hazard ratios<br />

Suppose we want a hazard ratio comparing individuals with x a<br />

and x b<br />

squamous cell, performance of 60, aged 70, with no prior<br />

therapy<br />

large cell, performance of 20, aged 50, with no prior<br />

therapy<br />

Same approach<br />

obtain ˆ β and covariance matrix via coxph<br />

evaluate ˆ β T<br />

xa and ˆ β T<br />

xb evaluate V( ˆ β T<br />

x a − ˆ β T<br />

x b )<br />

95% CI is ˆβ T<br />

x a − ˆβ T<br />

x b ±<br />

<br />

V(ˆβ T<br />

x a − ˆβ T<br />

x b )<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for hazard ratios<br />

Suppose we want a hazard ratio comparing individuals with x a<br />

and x b<br />

squamous cell, performance of 60, aged 70, with no prior<br />

therapy<br />

large cell, performance of 20, aged 50, with no prior<br />

therapy<br />

Same approach<br />

obtain ˆ β and covariance matrix via coxph<br />

evaluate ˆ β T<br />

xa and ˆ β T<br />

xb evaluate V( ˆ β T<br />

x a − ˆ β T<br />

x b )<br />

95% CI is ˆβ T<br />

x a − ˆβ T<br />

x b ±<br />

<br />

V(ˆβ T<br />

x a − ˆβ T<br />

x b )<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for hazard ratios<br />

Suppose we want a hazard ratio comparing individuals with x a<br />

and x b<br />

squamous cell, performance of 60, aged 70, with no prior<br />

therapy<br />

large cell, performance of 20, aged 50, with no prior<br />

therapy<br />

Same approach<br />

obtain ˆ β and covariance matrix via coxph<br />

evaluate ˆ β T<br />

xa and ˆ β T<br />

xb evaluate V( ˆ β T<br />

x a − ˆ β T<br />

x b )<br />

95% CI is ˆβ T<br />

x a − ˆβ T<br />

x b ±<br />

<br />

V(ˆβ T<br />

x a − ˆβ T<br />

x b )<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

CIs for hazard ratios<br />

Suppose we want a hazard ratio comparing individuals with x a<br />

and x b<br />

squamous cell, performance of 60, aged 70, with no prior<br />

therapy<br />

large cell, performance of 20, aged 50, with no prior<br />

therapy<br />

Same approach<br />

obtain ˆ β and covariance matrix via coxph<br />

evaluate ˆ β T<br />

xa and ˆ β T<br />

xb evaluate V( ˆ β T<br />

x a − ˆ β T<br />

x b )<br />

95% CI is ˆβ T<br />

x a − ˆβ T<br />

x b ±<br />

<br />

V(ˆβ T<br />

x a − ˆβ T<br />

x b )<br />

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


Soya beans Test Confidence intervals CI for β MVNs, Var, Cov<br />

Example<br />

x a = (x a 1 , x a 2 ) and x b = (x b 1 , x b 2 ) Variance of ˆ βx a − ˆ βx b is<br />

V( ˆ βx a − ˆ βx b ) = V{ ˆ β1(x a 1 − x b 1 ) + ˆ β2(x a 2 − x b 2 )}<br />

= (x a 1 − x b 1 ) 2 V( ˆ β1) + (x a 2 − x b 2 ) 2 V( ˆ β2)<br />

+2C{ ˆ β1(x a 1 − x b 1 ), ˆ β2(x a 2 − x b 2 )}<br />

= (x a 1 − x b 1 ) 2 V( ˆ β1) + (x a 2 − x b 2 ) 2 V( ˆ β2)<br />

+2(x a 1 − x b 1 )(x a 2 − x b 2 )C{ ˆβ1, ˆβ2}<br />

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

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

Saved successfully!

Ooh no, something went wrong!