Cox models with shared frailty

Một phần của tài liệu An introduction to survival analysis using stata (Trang 185 - 193)

The term shared frailty is used in survival analysis to describe regression models with random effects. A frailty is a latent random effect that enters multiplicatively on the hazard function. For a Cox model, the data are organized as i = 1, ... , n groups with j = 1, ... , ni subjects in group i. For the jth subject in the ith group, then, the hazard is

where ai is the group-level frailty. The frailties are unobservable positive quantities and are assumed to have mean 1 and variance e, to be estimated from data.

For vi = log ai, the hazard can also be expressed as

and thus the log frailties, vi, are analogous to random effects in standard linear models.

A more detailed discussion of frailty models is given in section 15.3 in the context of parametric models. Frailty is best first understood in parametric models, because these models posit parametric forms of the baseline hazard function for which the effect of frailty can be easily described and displayed graphically. Shared frailty models are also best understood if compared and contrasted with unshared frailty models, which for reasons of identifiability do not exist with Cox regression. Therefore, for a more thorough discussion of frailty, we refer you to section 15.3.

For this discussion, a Cox model with shared frailty is simply a random-effects Cox model. Shared frailty models are used to model within-group correlation; observations within a group are correlated because they share the same frailty, and the extent of the correlation is measured by e. For example, we could have survival data on individuals within families, and we would expect (or at least be willing to allow) those subjects within each family to be correlated because some families would inherently be more frail than others. When e = 0, the Cox shared-frailty model simply reduces to the standard Cox model.

,;~4.1 Parameter estimation 157 [ Parameter estimation

fDonsider the data from a study of kidney dialysis patients, as described in McGilchrist

!J,Ild Aisbett (1991) and as described in more detail in section 15.3.2 on parametric

•ã ailty models. The study is concerned with the prevalence of infection at the catheter : sertion point. Two recurrence times (in days) are measured for each patient, and each ecorded time is the time from initial insertion (onset of risk) to infection or censoring .

. use http://www.stata-press.com/data/cggm3/kidney2, clear (Kidney data, McGilchrist and Aisbett, Biometrics, 1991) . list patient time fail age gender in 1/10, sepby(patient)

1.

2.

3.

4.

5.

6.

7.

8.

9.

10.

patient 1 1 2 2 3 3 4 4 5 5

time 16 8 13 23 22 28 318 447 30 12

fail age gender

1 28 0

1 28 0

0 48 1

1 48 1

1 32 0

1 32 0

1 31.5 1

1 31.5 1

1 10 0

1 10 0

Each patient (patient) has two recurrence times (time) recorded, with each catheter insertion resulting in either infection (fail==1) or right-censoring (fail==O). Among the covariates measured are age and gender (1 if female, 0 if male).

Note the use of the generic term "subjects": Here the subjects are taken to be the individual catheter insertions and not the patients themselves. This is a function of how the data were recorded-the onset of risk occurs at catheter insertion (of which there are two for each patient) and not, say, at the time the patient was admitted into the study. Thus we have two subjects (insertions) for each group (patient). Because each observation represents one subject, we are not required to stset an ID variable, although we would need to if we ever wished to st split the data later.

It is reasonable to assume independence of patients but unreasonable to assume that recurrence times within each patient are independent. One solution would be to fit a standard Cox model, adjusting the standard errors of the estimated parameters to account for the possible correlation. This is done by specifying option vee (cluster patient) to stcox. We do this below after first stsetting the data.

mode~~

.ã~

. stset time, failure(fail)

failure event: fail != 0 & fail < . obs. time interval: (0, time]

exit on or before: failure 76 total obs.

0 exclusions

76 obs. remaining, representing

58 failures in single record/single failure data

7424 total analysis time at risk, at risk from t 0 earliest observed entry t 0 last observed exit t 562 stcox age gender, nohr vce(cluster patient)

failure _d: fail analysis time _t: time

Iteration 0: log pseudolikelihood -188.44736 Iteration 1: log pseudolikelihood = -185.36881 Iteration 2: log pseudolikelihood = -185.11022 Iteration 3: log pseudolikelihood = -185.10993 Refining estimates:

Iteration 0: log pseudolikelihood = -185.10993 Cox regression -- Breslow method for ties No. of subjects

No. of failures Time at risk

76 58 7424

Number of obs

Wald chi2(2)

76

2.74 Log pseudolikelihood = -185.10993 Prob > chi2 0.2540

_t age gender

Coef.

.0022426 -.7986869

(Std. Err. adjusted for 38 clusters in patient) Robust

Std. Err.

.0078139 .487274

z P>lzl 0.29 0.774 -1.64 0.101

[95% Conf. Interval]

-.0130724 -1.753726

.0175575 .1563526

'•.~

. ã~

:!

When you specify vee (cluster patient), you obtain the robust estimate of vari- ance as described in the context of Cox regression by Lin and Wei (1989), with an added adjustment for clustering (see [u] 20.16 Obtaining robust variance estimates).

If there indeed exists within-patient correlation, the standard Cox model depicted above is misspecified. However, because we specified vee (cluster patient), the stan- dard errors of the estimated coefficients on age and gender are valid representations of the sample-to-sample variability of the obtained coefficients. We do not know exactly what the coefficients measure (for that we would need to know exactly how the correlaã

tion arises), but we can measure their variability, and often we may still be able to test the null hypothesis that a coefficient is zero. That is, in many instances, testing that a covariate effect is zero under our misspecified model is equivalent to testing that the effect is zero under several other models that allow for correlated observations.

,:'[).4.1 Parameter estimation 159 , One such model is the shared frailty model, and more specifically, the model where

~the shared frailty is gamma distributed (with mean 1 and variance B). We fit this model ,:in Stata by specifying option shared(patient) in place of vee (cluster patient).

stcox age gender, nohr shared(patient) failure _d: fail

analysis time _t: time Fitting comparison Cox model:

Estimating frailty variance:

Iteration 0: log profile likelihood -182.06713 Iteration 1: log profile likelihood = -181.9791 Iteration 2: log profile likelihood = -181.97453 Iteration 3: log profile likelihood = -181.97453 Fitting final Cox model:

Iteration 0: log likelihood = -199.05599 Iteration 1: log likelihood= -183.72296 Iteration 2: log likelihood = -181.99509 Iteration 3: log likelihood= -181.97455 Iteration 4: log likelihood= -181.97453 Refining estimates:

Iteration 0: log likelihood = -181.97453 Cox regression --

Breslow method for ties Gamma shared frailty Group variable: patient

Number Number

of obs 76

of groups 38

No. of subjects No. of failures Time at risk

76 58 7424

Obs per group: min = 2

Log likelihood t age gender theta

-181.97453 Coef.

.0061825 -1.575675 .4754497

Std. Err.

.012022 .4626528 .2673107

avg = 2

max 2

Wald chi2(2) 11.66

Prob >

z P>/z/

0.51 0.607 -3.41 0.001

chi2 0.0029

[95% Conf. Interval]

-.0173801 .0297451 -2.482458 -.6688924

Likelihood-ratio test of theta=O: chibar2(01) 6.27 Prob>=chibar2 = 0.006 Note: standard errors of regression parameters are conditional on theta.

Given the estimated frailty variance, B = 0.475, and the significance level of the likelihood-ratio test of H0 : e = 0, we conclude that under this model there is significant within-group correlation. To interpret the coefficients, let us begin by redisplaying them as hazard ratios.

(Continued on next page)

. stcox Cox regression

Number of cbs 76

Number of groups 38 :"(j Breslow method for ties

Gamma shared frailty Group variable: patient No. of subjects

No. of failures Time at risk

76 58 7424

Obs per group: min = 2 :1

avg = 2 ~ (~

Log likelihood -181.97453 _t Haz. Ratio Std. Err.

age gender theta

1.006202 .2068678 .4754497

.0120965 .095708 .2673107

Wald Prob z P>lzl 0.51 0.607 -3.41 0.001

max = 2

chi2(2) 11.66

> chi2 0.0029 [95% Conf. Interval]

.9827701 .0835376

1. 030192 .5122756

Likelihood-ratio test of theta=O: chibar2(01) 6.27 Prob>=chibar2 0.006 Note: standard errors of hazard ratios are conditional on theta.

ã:?

The interpretation of the hazard ratios is the same as before, except that they are conditional on the frailty. For example, we interpret the hazard ratio for gender as • indicating that, once we account for intragroup correlation via the shared frailty model, for a given level of frailty the hazard for females is about one-fifth that for males. Of course, a subject's frailty would have a lot to say about the hazard, and we can use predict after stcox to obtain the frailties (or more precisely, the log frailties vi) for us:

predict nu, effects sort nu

list patient nu in 1/2

patient nu

1. 21 -2.448707

2. 21 -2.448707

list patient nu in 75/L

patient nu

75. 7 .5187159

76. 7 .5187159

By specifying option effects, we tell predict to create a new variable nu containing the estimated random effects (the i/i)ã After sorting, we find that the least frail (or strongest) patient is patient 21 with i/21 = -2.45; the most frail patient is patient 7 with i/7 = 0.52.

Obtaining estimates of baseline functions 161

Estimation for the Cox shared frailty model consists of two layers. In the outer layer, optimization is for e only. For fixed e, the inner layer consists of fitting a standard model via penalized likelihood, with the Vi introduced as estimable coefficients of

-,J: .. ""'mv variables identifying the groups. The penalized likelihood is simply the standard likelihood with an added penalty that is a function of e. The final estimate of e

taken to be the one that maximizes the penalized log likelihood. Once the optimal is obtained, it is held fixed and a final penalized Cox model is fit. For this reason, standard errors of the main regression parameters (or hazard ratios, if displayed as are treated as conditional one fixed at its optimal value. That is, when performing

..,,Luv•V>"J- on these coefficients, it is with the caveat that you are treating e as known.

more details on estimation, see chapter 9 of Therneau and Grambsch (2000).

0 Obtaining estimates of baseline functions

Baseline estimates for the Cox shared frailty model are obtained in the usual way,

ãand the definition of baseline extends to include v = 0. For example, working with .ãour kidney data, we can obtain an estimate of the baseline survivor function via the ' basesurv option to predict, just as before. Before we do so, however, we first recenter

ã age so that baseline corresponds to something more meaningful.

(Continued on next page)

generate age40 = age - 40

stcox age40 gender, nohr shared(patient) failure d: fail

analysis time _t: time Fitting comparison Cox model:

Estimating frailty variance:

Iteration Iteration Iteration Iteration

0:

1:

2:

3:

log profile likelihood -182.06713 log profile likelihood -181.9791 log profile likelihood -181.97453 log profile likelihood = -181.97453 Fitting final Cox model:

Iteration 0: log likelihood -199.05599 Iteration 1: log likelihood -183.72296 Iteration 2: log likelihood -181.99509 Iteration 3: log likelihood -181.97455 Iteration 4: log likelihood -181.97453 Refining estimates:

Iteration 0: log likelihood -181.97453 Cox regression --

Number of cbs Breslow method for ties

Gamma shared frailty Group variable: patient

Number of groups No. of subjects

No. of failures Time at risk Log likelihood

76 58 7424 -181.97453

Obs per group: min avg = max Wald chi2(2) Prob > chi2

76 38 2 2 2 11.66 0.0029 _t Coef. Std. Err. z P>lzl [95% Conf. Interval]

age40 gender theta

.0061825 -1.575675 .4754497

.012022 .4626528 .2673108

0.51 -3.41

Likelihood-ratio test of theta=O: chibar2(01)

0.607 0.001

-.0173801 -2.482458

.0297451 -.6688924

6.27 Prob>=chibar2 = 0.006 Note: standard errors of regression parameters are conditional on theta . . predict SO, basesurv

Recentering age has no effect on the parameter estimates, but it does produce a' baseline survivor-function estimate (SO) that corresponds to a 40-year-old male patient!

with mean frailty, or equivalently, a log frailty of zero.

Because the estimation does not change, we know from the previous section that:

the estimated log frailties still range from -2.45 to 0.52. We can use this information;

to produce a graph comparing the survivor curves for 40-year-old males at the lowest;;

mean (baseline), and highest levels offrailty. '1

gen S_low = so-exp(-2.45) gen S_high = so-exp(0.52)

line S_low SO S_high _t i f _t<200, c(J J J) sort ytitle("Survivor function")

Obtaining estimates of baseline functions 163 produces figure 9.9. For these data, the least frail patients have survival experiences are far superior, even when compared with those with mean frailty. We have also the plot to range from time 0 to time 200, where most of the failures occur.

::l

~ :I .,

~ -ãã---,,-ã--ããã-ããã ã-ãã ã-ãã ... ãã--ã-ã-ã ----ãã---ã--ãã-ã-ãã--- ':'1

.. ,,

ãããã--ã-'f,ll_l

: l

' ' :, ..

-.. ã---~ã: :ã::-yã

: I

ã:.I

"'! ______ ., ________ i._~_l_ -- -ã---~---~-

ã:~ .... \\._..,

0 ~---~--~~ã~---.-_:ã.::::_::.:~:::.:.: .. ::.::.~::-... :.:,.=.::::.~--=~-=-=---

0 50 100

_t

150

I == ~=~;h - - - baseline survivor I

200

Figure 9.9. Comparison of survivor curves for various frailty values

Currently, stcurve has no facility for setting the frailty. Instead, all graphs produced stcurve are for v = 0. stcurve does, however, have an outfile() option for saving coordinates used to produce the graph, and these coordinates can be transformed that they correspond to other frailty values. For example, if we wanted smoothed

:.u<:t;:;;ta.two hazard plots for the same three frailty values used above, we could perform the

stcurve, hazard kernel(gaussian) outfile(basehaz) note: all plots evaluated at frailty equal to one

(graph omitted) . use basehaz, clear . describe

Contains data from basehaz.dta

cbs: 83

vars: 2

size: 996 (99.9% of memory free) storage display

variable name type format haz1

_t Sorted by:

float %9.0g float %9.0g

value label

15 Oct 2009 09:11

variable label

Smoothed hazard function _t

stcurve saved a dataset containing variable _t (time) and haz1, the estimated (afte~

smoothing) hazard function. We have loaded these data into memory, and so now all'

we have left to do is to generate the other two hazards and then graph all three against~

~- .

label variable haz1 "mean frailty hazard"

gen haz_low = hazi*exp(-2.45) gen haz_high = haz1*exp(0.52)

line haz_low haz1 haz_high _t if _t<200, yscale(log)

> ylabel(.005(.01).025) ylabel(.01, add) sort

> ytitle("Smoothed hazard estimate")

This produces figure 9.10. The comparison of hazards for the frailty extremes matche~ ã•

that for the survivor function; the least frail individuals are immune to infection.

---

--- ---- --- ---

---

50 100 150 200

_I

- - haz_low - - - mean frailty hazard

ããã haz_high

Figure 9.10. Comparison of hazards for various frailty values

Một phần của tài liệu An introduction to survival analysis using stata (Trang 185 - 193)

Tải bản đầy đủ (PDF)

(441 trang)