BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ammarhm
Lapis Lazuli | Level 10

Hi everyone, 

Continuing the theme of hazard plots, you can get an (unadjusted) hazard plot using the example below:

ods select HazardPlot;
ods graphics on;
proc lifetest data=sashelp.BMT plots=hazard;
   time T * Status(0);
run;
ods graphics off;

Say that the variable (Group) is an important factor when it comes to the risk of developing the outcome of interest and hence you would want to adjust for it, you can of course do that with Cox regression:

proc phreg data=sashelp.BMT ;
class group;
model  T * Status(0)=group;
run;

So, going back to the plot of hazards, how can I get a hazards plot adjusting for the variable group?

Thank you. 

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello,

 

Then replace
plot=cumhaz
by
plot=hazard
and you get that, no?

 

Koen

View solution in original post

3 REPLIES 3
sbxkoenk
SAS Super FREQ

Hello,

 

SAS 9.4 / Viya 3.5
SAS/STAT User's Guide
The ICPHREG Procedure
Example 69.2 Plotting Predicted Survival and Cumulative Hazard Functions

This example illustrates how to plot the predicted survival and cumulative hazard functions for specified covariate patterns.

https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_icphreg_examples02.htm?homeO...

 

PROC SQL noprint;
 create table cov as 
 select distinct group
 from sashelp.BMT ;
QUIT;
 
PROC ICPHREG data=sashelp.BMT plot=cumhaz /*plot=surv*/;
 class group / desc;
 model  T * Status(0)=group / basehaz=splines;
 baseline covariates=cov;
run;
/* end of program */

I could not find the immediate equivalent in PROC PHREG. (I just had a quick 30-seconds look though)

 

Koen

ammarhm
Lapis Lazuli | Level 10

Thank you Koen, 

The only issue is that this plots the cumulative hazard, which is not the same as the (instantaneous ) hazard rate that you get using proc lifetest with plots=hazard function. 

What I am trying to get is the adjusted hazard rate, and not the adjusted cumulative hazard plot.

Much appreciated. 

sbxkoenk
SAS Super FREQ

Hello,

 

Then replace
plot=cumhaz
by
plot=hazard
and you get that, no?

 

Koen

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 768 views
  • 1 like
  • 2 in conversation