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.
Hello,
Then replace
plot=cumhaz
by
plot=hazard
and you get that, no?
Koen
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.
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
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.
Hello,
Then replace
plot=cumhaz
by
plot=hazard
and you get that, no?
Koen
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!
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.
Ready to level-up your skills? Choose your own adventure.