BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Dylan1
Calcite | Level 5

I ran a cox model with the proc phreg command in SAS. After adding the assess statement to assess the model specification. There are some variables included in the final model which are failing the non proportionality assumption. They have a p value which is significant for a supremum test for the proportional hazard assumption. How do I correct for the non proportionality in a proc phreg command or any other way to address the issue.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Season
Barite | Level 11

Broadly speaking, in the Cox model context, there are two solutions: (1) incorporate time-varying effects in the model; (2) stratify the entire follow-up period and build Cox proportional hazards (PH) models in each of the strata where the PH assumption is tenable separately. Of course, a third way to deal with this problem is to completely abandon the Cox model approach and adopt other survival modeling strategies such as quantile regression and accelerated failure time model.

View solution in original post

3 REPLIES 3
Season
Barite | Level 11

Broadly speaking, in the Cox model context, there are two solutions: (1) incorporate time-varying effects in the model; (2) stratify the entire follow-up period and build Cox proportional hazards (PH) models in each of the strata where the PH assumption is tenable separately. Of course, a third way to deal with this problem is to completely abandon the Cox model approach and adopt other survival modeling strategies such as quantile regression and accelerated failure time model.

Ksharp
Super User

Check this seminar:

https://stats.oarc.ucla.edu/sas/seminars/sas-survival/

And I quoted:

7.4. Dealing with nonproportionality
If nonproportional hazards are detected, the researcher has many options with how to address the violation (Therneau & Grambsch, 2000):

Ignore the nonproportionality if it appears the changes in the coefficient over time are very small or if it appears the outliers are driving the changes in the coefficient. In large datasets, very small departures from proportional hazards can be detected. If, say, a regression coefficient changes only by 1% over time, it is unlikely that any overarching conclusions of the study would be affected. Additionally, a few heavily influential points may be causing nonproportional hazards to be detected, so it is important to use graphical methods to ensure this is not the case.
Stratify the model by the nonproportional covariate. Stratification allows each stratum to have its own baseline hazard, which solves the problem of nonproportionality. However, one cannot test whether the stratifying variable itself affects the hazard rate significantly. Additionally, although stratifying by a categorical covariate works naturally, it is often difficult to know how to best discretize a continuous covariate. This can be easily accomplished in proc phreh with the strata statement.
Run Cox models on intervals of follow up time rather than on its entirety. Proportional hazards may hold for shorter intervals of time within the entirety of follow up time. Some data management will be required to ensure that everyone is properly censored in each interval.
Include covariate interactions with time as predictors in the Cox model. This can be accomplished through programming statements in proc phreg, as these interactions are time-varying covariates themselves. Indeed, including such an interaction has been used as a test of proportional hazards — a significant interaction indicates violation of the assumption. Below, we provide code that shows how to include a covariate interaction with time in the model. We create the interaction variable hrtime by multiplying hr by lenfol. The interaction variable is of course included on the model statement as well. The output indicates that this interaction is non-significant, which is not surprising given that hr has not shown evidence of nonproportionality.
 


proc phreg data=whas500;
class gender;
model lenfol*fstat(0) = gender|age bmi|bmi hr hrtime;
hrtime = hr*lenfol;
run;
Season
Barite | Level 11

Thanks for sharing. One thing I would like to further comment on is the functional form of the time-dependent variables. As has been shown in the preceding SAS code, the time-dependent variable is assumed to be linear. However, it should be noted that in theory, nonlinear versions of time-dependent variables are also permitted in Cox models. See, for instance Using fractional polynomials and restricted cubic splines to model non‐proportional hazards or time‐... for more on the theoretical intricacies and SAS codes of nonlinear time-dependent variables. Still, the linear time-dependent variable is the most widely used functional form in practice.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 329 views
  • 2 likes
  • 3 in conversation