STAT 405 - BIOSTATISTICS Handout 24 – Extended Cox Model (Time Dependent Covariates) Example 1: Stanford Heart Translant Study Survival – time from program enrollment until death or censoring Dead – indicator of death (1) or censoring (0) Transpl – whether patient ever had a transplant (1 = yes, 2 = no) Surgery – previous heart surgery prior to program Age – age at acceptance into the program Wait – time from acceptance into program until transplant surgery (= NA for those without a transplant) Initially we might fit a Cox PH model for predicting survival time using ℎ(𝑡) = ℎ𝑜 (𝑡)exp(𝜂1 𝑇𝑟𝑎𝑛𝑠𝑝𝑙 + 𝜂2 𝑆𝑢𝑟𝑔𝑒𝑟𝑦 + 𝜂3 𝐴𝑔𝑒) However, this model could give misleading results, since patients who died more quickly had less time available to get transplants. This could make transplantation look excessively superior in terms of increasing a patient’s survival. A model with a time dependent indicator of whether a patient had a transplant at each point in time might be more appropriate: ℎ(𝑡) = ℎ𝑜 (𝑡)exp(𝜂1 𝑇𝑟𝑎𝑛𝑠𝑡𝑖𝑚𝑒 + 𝜂2 𝑆𝑢𝑟𝑔𝑒𝑟𝑦 + 𝜂3 𝐴𝑔𝑒 where Transtime = 1 if Transpl = 1 and Wait > t. Thus the value of Transtime depends on time (t) and is therefore referred to as a time-dependent covariate. We could write Transtime(t) to denote the dependence on time t. If we add time-dependent covariates or interactions with time to the Cox PH model, then it is not “proportional hazards” any longer. Thus we refer to this model as the extended Cox model. Here is a comparison of the two models above: A standard Cox PH model would compare the survival distributions between those without transplant (ever) to those with a transplant. A subject’s transplant status at the end of the study would be used to determine with category they were put into for the entire study follow-up. An extended Cox model would compare the risk of an event between transplant and non-transplant at each event time, but would re-evaluate which risk group each person belonged in based on whether they’d had a transplant by that time. 38 Example 2: Recidivism* Study (* re-arrest after being released from prison) 432 male inmates were followed for one year after release from prison, to evaluate risk of re-arrest as a function of financial aid (FIN), age at release (AGE), race (RACE), full-time work experience prior to first arrest (WEXP), marital status (MAR), parole status (PARO = 1 if released with parole, 0 otherwise), and number of prior convictions (PRIO). Data were collected on employment status over time during the year. Time-independent model (Cox PH): A time independent model might include the employment status of the individual at the beginning of the study (1 if employed, 0 if unemployed), or perhaps at any single point during this year. Time-dependent model (extended Cox): However, employment status changes over time, and it may be the more recent employment status that would affect the hazard for re-arrest. For example, if a person lost their job they might revert to crime. In order to account for time, we might want to define a time-dependent covariate for each month of the study that indicates whether the individual was employed during the past month. This indicator therefore could potentially change throughout the follow-up study. In general there are two kinds of time-varying covariates: Internal covariates: Variables that relate to the individuals, and can only be measured when an individual is alive, e.g. white blood cell count, CD4 count. External covariates: - Variable which changes in known way, e.g. age, dose of a drug. - Variable that exists totally independently of all individuals, e.g. air temperature. 39 Examples of when Time-dependent covariates/extended Cox models are used The extended Cox model is used when… I. When important covariates change during a study Ex 1: Framingham Heart study 5209 subjects followed since 1948 to examine relationship between risk factors and cardiovascular disease. A particular example from this study: Outcome: time to congestive heart failure. Predictors: age, systolic blood pressure, # of cigarettes per day Ex 2: Liver Cirrhosis Clinical trial comparing treatment to placebo for cirrhosis. The outcome of interest is time to death. Patients were seen at the clinic 3, 6, and 12 months, then yearly. Fixed Covariates: treatment, gender, age (at diagnosis) Time-varying covariates: alcohol consumption, nutritional status, bleeding, albumin, bilirubin, alkaline phosphatase, and prothrombin. Ex 3: Recidivism Study II. For cross-over studies, to indicate change in treatment Ex 1: Stanford heart study Between 1967 and 1980, 249 patients entered a program at Stanford University where they were registered to receive a heart transplant. Of these, 184 received transplants, 57 died while waiting, and 8 dropped out of the program for other reasons. Does getting a heart transplant improve survival? Naïve approach: Compare the total survival time of transplanted and non-transplanted. Problem: Length bias! 40 III. For Competing Risks Analysis For example, in cancer clinical trials, “tumor response” (or shrinking of the tumor) is used as an outcome. However, clinicians want to know whether tumor response correlates with survival. For this purpose we can fit an extended Cox model for time to death, with tumor response as a time dependent covariate. IV. For testing the PH assumption For example, we can fit these two models: (1) Time independent covariate u1 ℎ(𝑡) = ho (𝑡)exp(𝜂1 𝑢1 ) The hazard ratio for 𝑢1 is exp(𝜂1 ). (2) Time dependent covariate 𝑢1 : ℎ(𝑡) = ℎ𝑜 (𝑡) exp(𝜂1 𝑢1 + 𝜂2 ∙ 𝑢1 ∙ 𝑡) The hazard ratio 𝑢1 is exp(𝜂1 + 𝜂2 𝑡). A test of the parameter 𝜂2 is a test of the PH assumption. 41 Standard Cox Proportional Hazards Model Under a proportional hazards model, the hazard function h(t) is modeled as ℎ(𝑡) = ℎ𝑜 (𝑡)exp(𝜂1 𝑢1 + 𝜂2 𝑢2 + ⋯ + 𝜂𝑘 𝑢𝑘 ) or 𝑘 ℎ(𝑡) = ℎ𝑜 (𝑡)exp(∑ 𝜂𝑖 𝑢𝑖 ) 𝑖=1 Extended Cox Model Adds terms of the form 𝑢𝑖 × 𝑔𝑖 (𝑡) to the model above, thus we have: 𝑘 𝑘 ℎ(𝑡) = ℎ𝑜 (𝑡)exp(∑ 𝜂𝑖 𝑢𝑖 + ∑ 𝛿𝑖 𝑢𝑖 𝑔𝑖 (𝑡)) 𝑖=1 𝑖=1 The dependence of the covariates on time (t) means the proportional hazards assumption is not satisfied. We need not add time dependency on all k covariates as the model above does. If 𝑔𝑖 (𝑡) = 0 for all 𝑖 this model reduces to the Cox PH model. There are generally three functional forms used for 𝑔𝑖 (𝑡) functions. - 𝑔𝑖 (𝑡) = 𝑡 these may be used for only one term or any number of them! - 𝑔𝑖 (𝑡) = 𝑙𝑛𝑡 1𝑖𝑓𝑡 ≥ 𝑡𝑜 - 𝑔𝑖 (𝑡) = { this is called a Heaviside function 0𝑖𝑓𝑡 < 𝑡𝑜 - Note: these may be used for only one term or any number of them! Example 1: Heroin Study > Heroin$Clinic = as.factor(Clinic) > Heroin$Prison = as.factor(Prison) > summary(sfit.1) Call: coxph(formula = Surv(Time, Status) ~ Prison + Dose + Clinic, data = Heroin) n= 238, number of events= 150 coef exp(coef) se(coef) z Pr(>|z|) Prison1 0.326555 1.386184 0.167225 1.953 0.0508 . Dose -0.035369 0.965249 0.006379 -5.545 2.94e-08 *** Clinic2 -1.009896 0.364257 0.214889 -4.700 2.61e-06 *** --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 42 Prison1 Dose Clinic2 exp(coef) exp(-coef) lower .95 upper .95 1.3862 0.7214 0.9988 1.9238 0.9652 1.0360 0.9533 0.9774 0.3643 2.7453 0.2391 0.5550 Concordance= 0.665 (se = 0.026 ) Rsquare= 0.238 (max possible= 0.997 ) Likelihood ratio test= 64.56 on 3 df, Wald test = 54.12 on 3 df, Score (logrank) test = 56.32 on 3 df, p=6.228e-14 p=1.056e-11 p=3.598e-12 > Heroin$Clinic1 = (Heroin$Clinic==1)+0 Recode so Clinic 2 is the reference group > summary(sfit.1) Call: coxph(formula = Surv(Time, Status) ~ Prison + Dose + Clinic2, data = Heroin) n= 238, number of events= 150 coef exp(coef) se(coef) z Pr(>|z|) Prison1 0.326555 1.386184 0.167225 1.953 0.0508 . Dose -0.035369 0.965249 0.006379 -5.545 2.94e-08 *** Clinic1 1.009896 2.745315 0.214889 4.700 2.61e-06 *** --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Prison1 Dose Clinic1 exp(coef) exp(-coef) lower .95 upper .95 1.3862 0.7214 0.9988 1.9238 0.9652 1.0360 0.9533 0.9774 2.7453 0.3643 1.8017 4.1832 Concordance= 0.665 (se = 0.026 ) Rsquare= 0.238 (max possible= 0.997 ) Likelihood ratio test= 64.56 on 3 df, Wald test = 54.12 on 3 df, Score (logrank) test = 56.32 on 3 df, p=6.228e-14 p=1.056e-11 p=3.598e-12 > test = cox.zph(sfit.1) > test rho chisq p Prison1 -0.0382 0.22 0.639369 Dose 0.0724 0.70 0.402749 Clinic1 -0.2578 11.19 0.000824 GLOBAL NA 12.62 0.005546 > par(mfrow=c(2,2)) > plot(test) 43 Stratifying on Clinic > sfit.2 = coxph(Surv(Time,Status)~Prison+Dose+strata(Clinic)) > summary(sfit.2) Call: coxph(formula = Surv(Time, Status) ~ Prison + Dose + strata(Clinic)) n= 238, number of events= 150 coef exp(coef) se(coef) z Pr(>|z|) Prison 0.389605 1.476397 0.168930 2.306 0.0211 * Dose -0.035115 0.965495 0.006465 -5.432 5.59e-08 *** --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Prison Dose exp(coef) exp(-coef) lower .95 upper .95 1.4764 0.6773 1.0603 2.0559 0.9655 1.0357 0.9533 0.9778 Concordance= 0.651 (se = 0.034 ) Rsquare= 0.133 (max possible= 0.994 ) Likelihood ratio test= 33.91 on 2 df, Wald test = 32.66 on 2 df, Score (logrank) test = 33.33 on 2 df, p=4.322e-08 p=8.076e-08 p=5.774e-08 > poo = survfit(sfit.2) > plot(poo,lty=1:2,col=c("red","blue")) > legend(locator(),legend=c("Clinic 1","Clinic 2"),lty=1:2,col=c("red","blue")) This approach probably adequately models these data and addresses the lack of proportional hazards for clinic, however we cannot estimate a hazard ratio associated with clinic using this model. We can only obtain such an expression for the effect of clinic if it is in the model. It is apparent however that patients in Clinic 1 do not have the same “survival” experience as patients in Clinic 2. The curve for Clinic 2 consistently lies above the curve for Clinic 1, indicating that Clinic 2 does betters than Clinic 1 in retaining its patients in methadone treatment. Further; because the two curves diverge after about a year (365 44 days); it appears that Clinic 2 is vastly superior to Clinic 1 after one year but only slightly better than Clinic 1 prior to one year. We can obtain a hazard ratio using the extended Cox model that contains a Heaviside function g(t). Based on the graphical results above, a logical choice for the cutpoint (𝑡𝑜 ) of the Heaviside function is one year (365 days). The model will then provide two hazard ratios: one that is constant above 365 days and the other that is constant below 365 days. To implement this model in R is a bit complicated. First we need to “split” the data into observations with Time < 365 and those that have Time > 365. For those individuals with Time > 365 we add rows to our data set to represent their additional time participating in the methadone program beyond 365 days. In our original data there are 238 patients; of these patients there a 122 individuals with Time > 365 days, thus our new data set will have 360 rows. > dim(Heroin) [1] 238 9 > table(Heroin$Time>=365) FALSE TRUE 116 122 > Heroin2 = survSplit(Heroin,cut=365,end="Time",event="Status",start="start") > dim(Heroin2) [1] 360 8 > Heroin2$Clinic1 = (Heroin2$Clinic==1)+0 recode Clinic for “new” dataset > Heroin2$gt = (Heroin2$start==365)+0 create Heaviside function > sfit.3 = coxph(Surv(start,Time,Status)~Prison+Dose+Clinic1+Clinic1:gt,data=Heroin2) > summary(sfit.3) Call: coxph(formula = Surv(start, Time, Status) ~ Prison + Dose + Clinic1 + Clinic1:gt, data = Heroin2) n= 360, number of events= 150 coef exp(coef) se(coef) z Pr(>|z|) Prison1 0.377951 1.459291 0.168415 2.244 0.02482 Dose -0.035480 0.965142 0.006435 -5.514 3.52e-08 Clinic1 0.459373 1.583081 0.255290 1.799 0.07195 Clinic1:gt 1.371144 3.939856 0.461403 2.972 0.00296 --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 Prison1 Dose Clinic1 Clinic1:gt * *** . ** ‘ ’ 1 exp(coef) exp(-coef) lower .95 upper .95 1.4593 0.6853 1.0490 2.0300 0.9651 1.0361 0.9530 0.9774 1.5831 0.6317 0.9598 2.6110 3.9399 0.2538 1.5949 9.7326 45 Concordance= 0.68 (se = 0.026 ) Rsquare= 0.186 (max possible= 0.98 ) Likelihood ratio test= 74.25 on 4 df, Wald test = 57.48 on 4 df, Score (logrank) test = 64.22 on 4 df, p=2.887e-15 p=9.816e-12 p=3.76e-13 An equivalent model is to use Heaviside functions, one indicating Time < 365 days and one indicating Time > 365. The interaction between clinic and each of these indicators will produce coefficients that can then be used to estimate the hazard ratios associated with clinic prior to one year and after one year. > Heroin2$gt1 = (Heroin2$start==0)+0 > Heroin2$gt2 = (Heroin2$start==365)+0 > sfit.4 = coxph(Surv(start,Time,Status)~Prison+Dose+Clinic1:gt1 + Clinic1:gt2,data=Heroin2) > summary(sfit.4) Call: coxph(formula = Surv(start, Time, Status) ~ Prison + Dose + Clinic1:gt1 + Clinic1:gt2, data = Heroin2) n= 360, number of events= 150 coef exp(coef) se(coef) z Prison1 0.377951 1.459291 0.168415 2.244 Dose -0.035480 0.965142 0.006435 -5.514 Clinic1:gt1 0.459373 1.583081 0.255290 1.799 Clinic1:gt2 1.830517 6.237113 0.385954 4.743 --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 Prison1 Dose Clinic1:gt1 Clinic1:gt2 Pr(>|z|) 0.0248 3.52e-08 0.0720 2.11e-06 * *** . *** ‘.’ 0.1 ‘ ’ 1 exp(coef) exp(-coef) lower .95 upper .95 1.4593 0.6853 1.0490 2.0300 0.9651 1.0361 0.9530 0.9774 1.5831 0.6317 0.9598 2.6110 6.2371 0.1603 2.9272 13.2895 Concordance= 0.68 (se = 0.026 ) Rsquare= 0.186 (max possible= 0.98 ) Likelihood ratio test= 74.25 on 4 df, Wald test = 57.48 on 4 df, Score (logrank) test = 64.22 on 4 df, p=2.887e-15 p=9.816e-12 p=3.76e-13 46 This example illustrates the difficult in data preparation that comes with the inclusion of time-dependent terms in the model. In R, there is no easy way to categorically accomplish this, although there are few libraries in CRAN that contain functions incorporating time-dependent effects in survival modeling. Most of these functions take care of the pre-processing of the original data necessary to include these effects. The PHREG procedure in SAS also allows for time-dependent effects however, the data still needs to be pre-processed to allow for the inclusion of the time-dependent effects. The SAS documentation below illustrates the use of time-dependent covariates in the analysis of the Stanford Heart Transplant data discussed above. Extended Cox Model Using Time-Dependent Explanatory Variables Time-dependent variables can be used to model the effects of subjects transferring from one treatment group to another. One example of the need for such strategies is the Stanford heart transplant program. Patients are accepted if physicians judge them suitable for heart transplant. Then, when a donor becomes available, physicians choose transplant recipients according to various medical criteria. A patient’s status can be changed during the study from waiting for a transplant to being a transplant recipient. Transplant status can be defined by the time-dependent covariate function as The Stanford heart transplant data that appear in Crowley and Hu (1977) consist of 103 patients, 69 of whom received transplants. The data are saved in a SAS data set called Heart in the following DATA step. For each patient in the program, there is a birth date (Bir_Date), a date of acceptance (Acc_Date), and a date last seen (Ter_Date). The survival time (Time) in days is defined as Time Ter_Date Acc_Date. The survival time is said to be uncensored (Status=1) or censored (Status=0), depending on whether Ter_Date is the date of death or the closing date of the study. The age, in years, at acceptance into the program is Acc_Age (Acc_Date Bir_Date) 365. Previous open-heart surgery for each patient is indicated by the variable PrevSurg. For each transplant recipient, there is a date of transplant (Xpl_Date) and three measures (NMismatch, Antigen, Mismatch) of tissue-type mismatching. The waiting period (WaitTime) in days for a transplant recipient is calculated as WaitTime and the age (in years) at transplant is Xpl_Age (Xpl_Date Bir_Date) Xpl_Date Acc_Date, 365. For those who do not receive heart transplants, the WaitTime, Xpl_Age, NMismatch, Antigen, and Mismatch variables contain missing values. The input data contain dates that have a two-digit year representation. The SAS option YEARCUTOFF=1900 is specified to ensure that a two-digit year xx is year 19xx. options yearcutoff=1900; data Heart; input ID 47 @5 Bir_Date mmddyy8. @14 Acc_Date mmddyy8. @23 Xpl_Date mmddyy8. @32 Ter_Date mmddyy8. @41 Status 1. @43 PrevSurg 1. @45 NMismatch 1. @47 Antigen 1. @49 Mismatch 4. @54 Reject 1. @56 NotTyped $1.; label Bir_Date ='Date of birth' Acc_Date ='Date of acceptance' Xpl_Date ='Date of transplant' Ter_Date ='Date last seen' Status = 'Dead=1 Alive=0' PrevSurg ='Previous surgery' NMismatch= 'No of mismatches' Antigen = 'HLA-A2 antigen' Mismatch ='Mismatch score' NotTyped = 'y=not tissue-typed'; Time= Ter_Date - Acc_Date; Acc_Age=int( (Acc_Date - Bir_Date)/365 ); if ( Xpl_Date ne .) then do; WaitTime= Xpl_Date - Acc_Date; Xpl_Age= int( (Xpl_Date - Bir_Date)/365 ); end; datalines; 1 01 10 37 11 15 67 01 03 68 1 0 2 03 02 16 01 02 68 01 07 68 1 0 3 09 19 13 01 06 68 01 06 68 01 21 68 1 0 2 0 1.11 0 4 12 23 27 03 28 68 05 02 68 05 05 68 1 0 3 0 1.66 0 5 07 28 47 05 10 68 05 27 68 1 0 6 11 08 13 06 13 68 06 15 68 1 0 7 08 29 17 07 12 68 08 31 68 05 17 70 1 0 4 0 1.32 1 8 03 27 23 08 01 68 09 09 68 1 0 9 06 11 21 08 09 68 11 01 68 1 0 10 02 09 26 08 11 68 08 22 68 10 07 68 1 0 2 0 0.61 1 11 08 22 20 08 15 68 09 09 68 01 14 69 1 0 1 0 0.36 0 12 07 09 15 09 17 68 09 24 68 1 0 13 02 22 14 09 19 68 10 05 68 12 08 68 1 0 3 0 1.89 1 14 09 16 14 09 20 68 10 26 68 07 07 72 1 0 1 0 0.87 1 15 12 04 14 09 27 68 09 27 68 1 1 48 16 05 16 19 10 26 68 11 22 68 08 29 69 1 0 2 0 1.12 1 17 06 29 48 10 28 68 12 02 68 1 0 18 12 27 11 11 01 68 11 20 68 12 13 68 1 0 3 0 2.05 0 19 10 04 09 11 18 68 12 24 68 1 0 20 10 19 13 01 29 69 02 15 69 02 25 69 1 0 3 1 2.76 1 21 09 29 25 02 01 69 02 08 69 11 29 71 1 0 2 0 1.13 1 22 06 05 26 03 18 69 03 29 69 05 07 69 1 0 3 0 1.38 1 23 12 02 10 04 11 69 04 13 69 04 13 71 1 0 3 0 0.96 1 24 07 07 17 04 25 69 07 16 69 11 29 69 1 0 3 1 1.62 1 25 02 06 36 04 28 69 05 22 69 04 01 74 0 0 2 0 1.06 0 26 10 18 38 05 01 69 03 01 73 0 0 27 07 21 60 05 04 69 01 21 70 1 0 28 05 30 15 06 07 69 08 16 69 08 17 69 1 0 2 0 0.47 0 29 02 06 19 07 14 69 08 17 69 1 0 30 09 20 24 08 19 69 09 03 69 12 18 71 1 0 4 0 1.58 1 31 10 04 14 08 23 69 09 07 69 1 0 32 04 02 05 08 29 69 09 14 69 11 13 69 1 0 4 0 0.69 1 33 01 01 21 11 27 69 01 16 70 04 01 74 0 0 3 0 0.91 0 34 05 24 29 12 12 69 01 03 70 04 01 74 0 0 2 0 0.38 0 35 08 04 26 01 21 70 02 01 70 1 0 36 05 01 21 04 04 70 05 19 70 07 12 70 1 0 2 0 2.09 1 37 10 24 08 04 25 70 05 13 70 06 29 70 1 0 3 1 0.87 1 38 11 14 28 05 05 70 05 09 70 05 09 70 1 0 3 0 0.87 0 39 11 12 19 05 20 70 05 21 70 07 11 70 1 0 y 40 11 30 21 05 25 70 07 04 70 04 01 74 0 1 4 0 0.75 0 41 04 30 25 08 19 70 10 15 70 04 01 74 0 1 2 0 0.98 0 42 03 13 34 08 21 70 08 23 70 1 0 43 06 01 27 10 22 70 10 23 70 1 1 44 05 02 28 11 30 70 01 08 71 1 1 45 10 30 34 01 05 71 01 05 71 02 18 71 1 0 1 0 0.0 0 46 06 01 22 01 10 71 01 11 71 10 01 73 1 1 2 0 0.81 1 47 12 28 23 02 02 71 02 22 71 04 14 71 1 0 3 0 1.38 1 48 01 23 15 02 05 71 02 13 71 1 0 49 06 21 34 02 15 71 03 22 71 04 01 74 0 1 4 0 1.35 0 50 03 28 25 02 15 71 05 08 71 10 21 73 1 1 y 51 06 29 22 03 24 71 04 24 71 01 02 72 1 0 4 1 1.08 1 52 01 24 30 04 25 71 08 04 71 1 0 53 02 27 24 07 02 71 08 11 71 01 05 72 1 0 54 09 16 23 07 02 71 y 07 04 71 1 0 55 02 24 19 08 09 71 08 18 71 10 08 71 1 0 2 0 1.51 1 56 12 05 32 09 03 71 11 08 71 04 01 74 0 0 4 0 0.98 0 57 06 08 30 09 13 71 02 08 72 1 0 58 09 17 23 09 23 71 10 13 71 08 30 72 1 1 2 1 1.82 1 49 59 05 12 30 09 29 71 12 15 71 04 01 74 0 1 2 0 0.19 0 60 10 29 22 11 18 71 11 20 71 01 24 72 1 0 3 0 0.66 1 61 05 12 19 12 04 71 12 05 71 1 0 62 08 01 32 12 09 71 02 15 72 1 0 63 04 15 39 12 12 71 01 07 72 04 01 74 0 0 3 1 1.93 0 64 04 09 23 02 01 72 03 04 72 09 06 73 1 1 1 0 0.12 0 65 11 19 20 03 06 72 03 17 72 05 22 72 1 0 2 0 1.12 1 66 01 02 19 03 20 72 04 20 72 1 0 67 09 03 52 03 23 72 05 18 72 01 01 73 1 0 3 0 1.02 0 68 01 10 27 04 07 72 04 09 72 06 13 72 1 0 3 1 1.68 1 69 06 05 24 06 01 72 06 10 72 04 01 74 0 0 2 0 1.20 0 70 06 17 19 06 17 72 06 21 72 07 16 72 1 0 3 1 1.68 1 71 02 22 25 07 21 72 08 20 72 04 01 74 0 0 3 0 0.97 0 72 11 22 45 08 14 72 08 17 72 04 01 74 0 0 3 1 1.46 0 73 05 13 16 09 11 72 10 07 72 12 09 72 1 0 3 1 2.16 1 74 07 20 43 09 18 72 09 22 72 10 04 72 1 0 1 0 0.61 0 75 07 25 20 09 29 72 09 30 72 1 0 76 09 03 20 10 04 72 11 18 72 04 01 74 0 1 3 1 1.70 0 77 08 27 31 10 06 72 10 26 72 1 0 78 02 20 24 11 03 72 05 31 73 04 01 74 0 0 3 0 0.81 0 79 02 18 19 11 30 72 02 04 73 03 05 73 1 0 2 0 1.08 1 80 06 27 26 12 06 72 12 31 72 04 01 74 0 1 3 0 1.41 0 81 02 21 20 01 12 73 01 17 73 04 01 74 0 0 4 1 1.94 0 82 08 19 42 11 01 71 01 01 73 0 0 83 10 04 19 01 24 73 02 24 73 04 13 73 1 0 4 0 3.05 0 84 05 13 30 01 30 73 03 07 73 12 29 73 1 0 4 0 0.60 1 85 02 13 25 02 06 73 02 10 73 1 0 86 03 30 24 03 01 73 03 08 73 04 01 74 0 0 3 1 1.44 0 87 12 19 26 03 21 73 05 19 73 07 08 73 1 0 2 0 2.25 1 88 11 16 18 03 28 73 04 27 73 04 01 74 0 0 3 0 0.68 0 89 03 19 22 04 05 73 08 21 73 10 28 73 1 0 4 1 1.33 1 90 03 25 21 04 06 73 09 12 73 10 08 73 1 1 3 1 0.82 0 91 09 08 25 04 13 73 03 18 74 1 0 92 05 03 28 04 27 73 03 02 74 04 01 74 0 0 1 0 0.16 0 93 10 10 25 07 11 73 08 07 73 04 01 74 0 0 2 0 0.33 0 94 11 11 29 09 14 73 09 17 73 02 25 74 1 1 3 0 1.20 1 95 06 11 33 09 22 73 09 23 73 10 07 73 1 0 y 96 02 09 47 10 04 73 10 16 73 04 01 74 0 0 2 0 0.46 0 97 04 11 50 11 22 73 12 12 73 04 01 74 0 0 3 1 1.78 0 98 04 28 45 12 14 73 03 19 74 04 01 74 0 0 4 1 0.77 0 99 02 24 24 12 25 73 01 14 74 1 0 100 01 31 39 02 22 74 03 31 74 04 01 74 0 1 3 0 0.67 0 101 08 25 24 03 02 74 04 01 74 0 0 50 102 10 30 33 03 22 74 04 01 74 0 0 103 05 20 28 09 13 67 09 18 67 1 0 ; Crowley and Hu (1977) have presented a number of analyses to assess the effects of various explanatory variables on the survival of patients. This example fits two of the models that they have considered. The first model consists of two explanatory variables—the transplant status and the age at acceptance. The transplant status (XStatus) is a time-dependent variable defined by the programming statements between the MODEL statement and the RUN statement. The XStatus variable takes the value 1 or 0 at time (measured from the date of acceptance), depending on whether or not the patient has received a transplant at that time. Note that the value of XStatus changes for subjects in each risk set (subjects still alive just before each distinct event time); therefore, the variable cannot be created in the DATA step. The variable Acc_Age, which is not time dependent, accounts for the possibility that pretransplant risks vary with age. The following statements fit this model: proc phreg data= Heart; model Time*Status(0)= XStatus Acc_Age; if (WaitTime = . or Time < WaitTime) then XStatus=0.; else XStatus= 1.0; run; Results of this analysis are shown in Output 64.6.1. Transplantation appears to be associated with a slight decrease in risk, although the effect is not significant ( acceptance as a pre-transplant risk factor adds significantly to the model ( ). The age at ). The risk increases significantly with age at acceptance. Output 64.6.1 Heart Transplant Study Analysis I The PHREG Procedure Model Information Data Set WORK.HEART Dependent VariableTime Censoring Variable Status Dead=1 Alive=0 Censoring Value(s) 0 Ties Handling BRESLOW Number of Observations Read103 Number of Observations Used103 Summary of the Number of Event and Censored Values 51 Percent Total Event 103 Censored 75 Censored 28 27.18 Convergence Status Convergence criterion (GCONV=1E-8) satisfied. Model Fit Statistics Without With Criterion CovariatesCovariates -2 LOG L 596.651 591.292 AIC 596.651 595.292 SBC 596.651 599.927 Testing Global Null Hypothesis: BETA=0 Test Chi-SquareDFPr > ChiSq Likelihood Ratio 5.3593 2 0.0686 Score 4.8093 2 0.0903 Wald 4.7999 2 0.0907 Analysis of Maximum Likelihood Estimates ParameterStandard ParameterDFEstimate Error Hazard Chi-SquarePr > ChiSqRatio XStatus 1 -0.06720 0.30594 0.0482 0.8261 0.935 Acc_Age 1 4.7711 0.0289 1.032 0.03158 0.01446 The second model consists of three explanatory variables—the transplant status, the transplant age, and the mismatch score. Four transplant recipients who were not typed have no Mismatch values; they are excluded from the analysis by the use of a WHERE clause. The transplant age (XAge) and the mismatch score (XScore) are also time dependent and are defined in a fashion similar to that of XStatus. While the patient is waiting for a transplant, XAge and XScore have a value of 0. After the patient has migrated to the recipient population, XAge takes on the value of Xpl_Age (transplant age for the recipient), and XScore takes on the value of Mismatch (a measure of the degree of dissimilarity between donor and recipient). The following statements fit this model: proc phreg data= Heart; model Time*Status(0)= XStatus XAge XScore; where NotTyped ^= 'y'; 52 if (WaitTime = . or Time < WaitTime) then do; XStatus=0.; XAge=0.; XScore= 0.; end; else do; XStatus= 1.0; XAge= Xpl_Age; XScore= Mismatch; end; run; Results of the analysis are shown in Output 64.6.2. Note that only 99 patients are included in this analysis, instead of 103 patients as in the previous analysis, since four transplant recipients who were not typed are excluded. The variable XAge is statistically significant ( ), with a hazard ratio exceeding 1. Therefore, patients who had a transplant at younger ages lived longer than those who received a transplant later in their lives. The variable XScore has only minimal effect on the survival ( ). Output 64.6.2 Heart Transplant Study Analysis II The PHREG Procedure Model Information Data Set WORK.HEART Dependent VariableTime Censoring Variable Status Dead=1 Alive=0 Censoring Value(s) 0 Ties Handling BRESLOW Number of Observations Read99 Number of Observations Used99 Summary of the Number of Event and Censored Values Percent Total Event 99 Censored 71 Censored 28 28.28 Convergence Status Convergence criterion (GCONV=1E-8) satisfied. 53 Model Fit Statistics Without With Criterion CovariatesCovariates -2 LOG L 561.680 551.874 AIC 561.680 557.874 SBC 561.680 564.662 Testing Global Null Hypothesis: BETA=0 Test Chi-SquareDFPr > ChiSq Likelihood Ratio 9.8059 3 0.0203 Score 9.0521 3 0.0286 Wald 9.0554 3 0.0286 Analysis of Maximum Likelihood Estimates ParameterStandard ParameterDFEstimate Error Hazard Chi-SquarePr > ChiSqRatio XStatus 1 -3.19837 1.18746 7.2547 0.0071 0.041 XAge 1 0.05544 0.02263 6.0019 0.0143 1.057 XScore 1 0.44490 0.28001 2.5245 0.1121 1.560 54