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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 2387 views
  • 0 likes
  • 2 in conversation