Skip to main content
added tag; formatted; edited
Source Link
gung - Reinstate Monica
  • 147.5k
  • 89
  • 406
  • 717

Proportionality Assumption Testassumption test (SAS) for categorical predictors

For Cox regression with all categorical predictors, I want to model time-dependent covariates (time*covtime*cov in Proc PHREGProc PHREG) to account for PHproportional hazard 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;

Proc phreg data=tem1s (where=(clinM ne '1')); 
  model time*event(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=dps41*time; dps100t=dps100*time; 
  dgs44t=dgs44*time; dgs45t=dgs45*time; dgs53t=dgs53*time; dgs54t=dgs54*time;  
  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 small parameter estimates for some of main effects but high estimates for interactions for all time-dep cov.dependent covariates (e.g., dag55=0.09dag55=0.09 and dag55t=-1174dag55t=-1174). I get very absurdly high SE of dummies for main effects and interactions for time-depdependent variables (e.g., SE of dag55dag55 and dag55tdag55t are 326.442326.442 and 326442326442, respectively - SE of time-dep.dependent variables are multiplied by 10001000 for all). Some of HRthe hazard ratios are suspect or are not computed. All terms in the model have 1 DF. Estimates for other variables look normal and chi sq-squared for the global test of PHproportional hazards is very small. Log looks normal with no errors.

When I use log(time)log(time) instead of time to create time-dep vardependent variables, I get 0 DF for time interaction covriatescovariates. LogThe log reads: "ERROR: An illegal argument is used in the function call in statement number 1 at line 2566 column 1.

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 )."

1  (2566:1)  dag55t = (dag55=0) * LOG( time=0 ).  

The error goes away if I force time>0time>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 depdependent variables are normal (e.g., dag55 -0.02663dag55 -0.02663 and 0.104440.10444 (SE)) but a little different than when time is used while estimates for other covcovariates don't change. Also, in I use time gt 0time gt 0 in the wherewhere statement together with time for computing interaction, DF for interactions become 0 as with log(time)log(time).

Please help as to howHow I can include time-depdependent interactions in the model.?

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.

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 proportional hazard 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 time*event(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=dps41*time; dps100t=dps100*time; 
  dgs44t=dgs44*time; dgs45t=dgs45*time; dgs53t=dgs53*time; dgs54t=dgs54*time;  
  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-dependent covariates (e.g., dag55=0.09 and dag55t=-1174). I get very absurdly high SE of dummies for main effects and interactions for time-dependent variables (e.g., SE of dag55 and dag55t are 326.442 and 326442, respectively SE of time-dependent variables are multiplied by 1000 for all). Some of the hazard ratios are suspect or are not computed. All terms in the model have 1 DF. Estimates for other variables look normal and chi-squared for the global test of proportional hazards is very small. Log looks normal with no errors.

When I use log(time) instead of time to create time-dependent variables, I get 0 DF for time interaction covariates. The 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 dependent 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 covariates 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).

How I can include time-dependent interactions in the model?

Source Link

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.