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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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