Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Re: Hazard plot adjusted for covariates

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

☑ This topic is **solved**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 01-01-2022 06:50 AM
(434 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

Then replace

plot=cumhaz

by**plot=hazard**

and you get that, no?

Koen

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

Then replace

plot=cumhaz

by**plot=hazard**

and you get that, no?

Koen

**Don't miss out on SAS Innovate - Register now for the FREE Livestream!**

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

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.