Solved
Contributor
Posts: 39

# Re: How to overlay 2 survival plots with adjustment of confounders

Sanjay,

Thank you for trying to help!

The SAS I'm using is in version 9.4.

Regarding to the data, it's a traditional survival data which contains

#2 follow-up time: followtime

#3 main independent variable: NewSurgeIndex: 1, 2, and 3 represent 3 different groups

#4 other confounders: sex age bmi_1 smoke alcohol ldl_c meansbp nightdaysbpratio

Again, what I'm trying to do is to estimate survival probability for NewSurgeIndex with adjusting for confounders.

Moreover, in order to make these three groups comparable, so I need to draw these three survival curves on the same graph.

Actually, I've came out one way to achieve this:

``````ODS GRAPHICS ON;
PROC PHREG DATA=one PLOTS(OVERLAY)=SURVIVAL;
CLASS NewSurgeIndex;
MODEL followtime*allcause(0)= sex age bmi_1 smoke alcohol ldl_c
meansbp nightdaysbpratio NewSurgeIndex;
BASELINE COVARIATES=one OUT=Pred1 SURVIVAL=_ALL_/ DIRADJ GROUP=NewSurgeIndex;
ODS GRAPHICS OFF;``````

However, very welcome if you have any better idea!

Accepted Solutions
Solution
‎06-06-2017 10:24 PM
SAS Super FREQ
Posts: 3,556

## Re: How to overlay 2 survival plots with adjustment of confounders

Using a categorical variable in the CLASS statement is the usual way to compare groups. As you've seen, this also overlays the various groups on the ODS graphics that the procedure creates.

All Replies
Solution
‎06-06-2017 10:24 PM
SAS Super FREQ
Posts: 3,556

## Re: How to overlay 2 survival plots with adjustment of confounders

Using a categorical variable in the CLASS statement is the usual way to compare groups. As you've seen, this also overlays the various groups on the ODS graphics that the procedure creates.

Contributor
Posts: 39

## Re: How to overlay 2 survival plots with adjustment of confounders

Thank you Rick!
Now I can use it more confidently.
☑ This topic is solved.