I'm trying to check that the proportional hazards assumption is satisfied with all my variables in my Cox model.
I used 2 methods to do this, but they give different results.
First method:
Add time-dependent variable to the original model (in this case, a product of a variable of interest and logarithm of time variable was added for each covariate).
prog phreg data=data covsandwich;
class drinker meds;
model time*event(0)=drinker meds comorbs age avg_glucose avg_creatinine
t_drinker t_meds t_comorbs t_age t_avg_glucose t_avg_creatinine;
t_drinker=drinker*log(time);
t_meds=meds*log(time);
t_comorbs=comorbs*log(time);
t_age=age*log(time);
t_avg_glucose=avg_glucose*log(time);
t_avg_creatinine=avg_creatinine*log(time);
id pracid;
run;
This method showed that proportional hazards assumption was satisfied for all variables because none of these time-dependent variables were significant.
Second method:
for continuous variables - plots of Shoenfeld residuals against the time variable
for categorical variables - plots of log-minus-log of the survival function against the time variable, stratified by the category levels.
e.g.
proc lifetest data=data plots=(s, lls);
time time*event(0);
strata drinker;
run;
This method showed that all the continous variables satisfied the proportional hazards assumption (graghs showed straight line), whilst it did not for one of the categorical variable (drinker) as the lines of the survival function crossed.
The first method and second method showed slightly different results (all covariates satisfy the PHA in the first, whilst it doesn't for the second). Could this be because the second analysis is unadjusted? I wonder whether it's fair to conclude that the PH assumption is satisfied as indicated by the first method, or whether it isn't because of the second method.
Many thanks for your help in advance.
You have proportional hazards if the difference of Log(-Log(kaplanmeier)) between the two groups under consideration is constant.
Not crossing Kaplan Meier curves does not imply proportional hazard rates. This just imply that one group has a higher risk than the other.
In the first you're testing all assumptions at once. In the second you're testing each independently.
Unfortunately, it's not an exact science to determine if the PH assumption is violated. You have to make the call, especially knowing the KM curves cross for gender. One thing to consider is the p-value itself, if it's 0.0546, which is greater than 0.05 but close maybe it's still ok. It's a judgement call....
Another option is the ASSESS statement. I would suggest searching on Lexjansen.com to see how to use the ASSESS statement and then using that as another check.
You have proportional hazards if the difference of Log(-Log(kaplanmeier)) between the two groups under consideration is constant.
Not crossing Kaplan Meier curves does not imply proportional hazard rates. This just imply that one group has a higher risk than the other.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.