Lapis Lazuli | Level 10

## Hazard plot adjusted for covariates

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
SAS Super FREQ

## Re: Hazard plot adjusted for covariates

Hello,

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

Koen

3 REPLIES 3
SAS Super FREQ

## Re: Hazard plot adjusted for covariates

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

Lapis Lazuli | Level 10

## Re: Hazard plot adjusted for covariates

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.

SAS Super FREQ

## Re: Hazard plot adjusted for covariates

Hello,

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

Koen

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