Skip to main content
1 of 2

Proportionality Assumption Test (SAS) for categorical predictors

For Cox regression with all categorical predictors, I want to model time-dependent covariates (time*cov in Proc PHREG) to account for PH assumption violations. I am using the codes below with dummies for categorical predictors with >2 levels.

Proc phreg data=tem1s (where=(clinM ne '1')); model timeevent(0)= dps40 dps41 dps100 drcb drco dag55 dag65 dag75 dag85 dps40t dps41t dps100t dag55t dag65t dag75t dag85t /NODUMMYPRINT ties=Efron RL;
dps40t=dps40
time; dps41t=dps41time; dps100t=dps100time; dgs44t=dgs44time; dgs45t=dgs45time; dgs53t=dgs53time; dgs54t=dgs54time;
hazardratio 'h11' dps40t ; hazardratio 'h12' dps41t ; hazardratio 'h13' dps100t; hazardratio 'h71' dag55t; hazardratio 'h72' dag65t; hazardratio 'h73' dag75t; hazardratio 'h74' dag85t; prop_test: test dag55t, dag65t, dag75t, dag85t; run;

Here are issues: I get normal/small parameter estimates for some of main effects but high estimates for interactions for all time-dep cov. (e.g., dag55=0.09 and dag55t=-1174). I get very absurdly high SE of dummies for main effects and interactions for time-dep variables (e.g., SE of dag55 and dag55t are 326.442 and 326442, respectively - SE of time-dep. variables are multiplied by 1000 for all). Some of HR are suspect or are not computed. All terms in the model have 1 DF. Estimates for other variables look normal and chi sq for global test of PH is very small. Log looks normal with no errors.

When I use log(time) instead of time to create time-dep var, I get 0 DF for time interaction covriates. Log reads: "ERROR: An illegal argument is used in the function call in statement number 1 at line 2566 column 1. The statement was: 1 (2566:1) dag55t = (dag55=0) * LOG( time=0 )." The error goes away if I force time>0 in the where statement (I have time>0 for all observations) but 0 DF and no estimates for time interactions. Interestingly, SE and parameters for main effect terms for time dep variables are normal (e.g., dag55 -0.02663 and 0.10444 (SE)) but a little different than when time is used while estimates for other cov don't change. Also, in I use time gt 0 in the where statement together with time for computing interaction, DF for interactions become 0 as with log(time).

Please help as to how I can include time-dep interactions in the model.