BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Chung-Li
Quartz | Level 8

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

#1 event variable: allcause, 0 as not dead, 1 as dead

#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;

SurvivalPlot.png

 

However, very welcome if you have any better idea!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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.

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

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.

Chung-Li
Quartz | Level 8
Thank you Rick!
Now I can use it more confidently.

sas-innovate-2024.png

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.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1357 views
  • 0 likes
  • 2 in conversation