This post was kindly contributed by SAS and R - go there to comment and to read the full post. |
In addition to the non-parametric tools discussed in recent entries, it’s common to use proportional hazards regression, (section 4.3.1) also called Cox regression, in evaluating survival data.
It’s important in such models to test the proportionality assumption. Below, we demonstrate doing this for a simple model from the HELP data, available at the book web site. Our results below draw on this web page, part of the excellent resources provided by the UCLA ATS site.
SAS
First, we run a proportional hazards regression to assess the effects of treatment on the time to linkage with primary care. (Data were read in and observations with missing values removed in example 7.40.) Only a portion of the results are shown.
proc phreg data=h2;
model dayslink*linkstatus(0)=treat;
output out= propcheck ressch = schres;
run;
Parameter Standard
Parameter DF Estimate Error Chi-Square Pr > ChiSq
treat 1 1.59103 0.19142 69.0837 <.0001
Being in the intervention group would appear to increase the probability of being linked to primary care. But do the model assumptions hold? The output statement above makes a new data set that contains the Schoenfeld residuals. (Schoenfeld D. Residuals for the proportional hazards regresssion model. Biometrika, 1982, 69(1):239-241.) One assessment of proportional hazards is based on these residuals, which ought to show no association with time if proportionality holds. We can plot them against the time to linkage using proc sgplot (section 5.1.1) and adding a loess curve to assess the relationship.
proc sgplot data=propcheck;
loess x = dayslink y = schres / clm;
run;
From the resulting plot, shown above, there is an indication of a possible problem. One way to assess this is to include a time-varying covariate, an interaction between the suspect predictor(s) and the event time. This can be done easily within proc phreg. If the interaction term is significant, the null hypothesis of proportionality has been rejected.
proc phreg data=h2;
model dayslink*linkstatus(0)=treat treat_time;
treat_time = treat*log(dayslink);
run;
Parameter Standard
Parameter DF Estimate Error Chi-Square Pr > ChiSq
treat 1 4.13105 0.97873 17.8153 <.0001
treat_time 1 -0.61846 0.22569 7.5093 0.0061
The proportional hazards assumption doesn’t hold in this case.
R
In R, the time-varying covariate approach is harder to implement. However, the survival library includes a formal test based on the Schoenfeld residuals. (See Therneau and Grambsch, 2000, pages 127-142.) This is accessed by applying the cox.zph() function to the output of the coxph() function. The smallds object used below was created in the previous example. (Some output omitted.)
> library(survival)
> propcheck = coxph(Surv(dayslink, linkstatus) ~ treat, method="breslow")
> summary(propcheck)
coef exp(coef) se(coef) z Pr(>|z|)
treat 1.5910 4.9088 0.1914 8.312 <2e-16 ***
> cox.zph(propcheck)
rho chisq p
treat -0.233 8.47 0.00361
This test agrees with the SAS approach that the assumptions that proportionality holds can be rejected. To understand why, you can plot() the test. The transform='identity" option is used to make results more similar to those obtained with SAS.
plot(cox.zph(propcheck, transform='identity'))
This post was kindly contributed by SAS and R - go there to comment and to read the full post. |