BookmarkSubscribeRSS Feed
bollibompa
Quartz | Level 8

Hi,

 

I have a dataset with two groups (treatment=YES and treatment=NO) and time to failure

I am trying to create a cumhaz plot in PROC PHREG where treatment YES and NO are presented in two separate plots but in the same graph.

 

I have tried to use stratum/bystatum but I only get a compined hazard plot for both treatment groups.

Does anyone know what I am doing wrong? I post my code below

 

ODS graphics on;
proc phreg data = MY_DATA plots(overlay=stratum)=cumhaz;
model time*fail(0)=trt ps  /rl ;
strata=trt;
run;
ODS graphics off;

 

 

Thanks in advance!

Thomas

1 REPLY 1
Rick_SAS
SAS Super FREQ

I might be misunderstanding, but try OVERLAY=ROW:

proc phreg data=LBW plots(overlay=row)=cumhaz;
model Time*Low(0)= LWT Smoke HT UI / ties=discrete;
strata Age;
run;

The various options are documented in the PROC PHREG statement.

 

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
  • 1 reply
  • 1883 views
  • 0 likes
  • 2 in conversation