BookmarkSubscribeRSS Feed
LD4224
Calcite | Level 5

Hello - I'm using PHREG to estimate survival functions for 2 groups.  I have clustered observations (2 hips per person) so cannot use LIFETEST.  I've generated the plot but would like to add additional information, especially the confidence bands.  Options like NOCENSOR and ATRISK would be helpful, too.

 

This is my code:

PROC PHREG DATA=WORK.DDH2340            PLOTS(OVERLAY=ROW)=S            COVS(AGGREGATE);

MODEL NEWSURV_YR*CENSOR(1)=COHORT/ TIES=BRESLOW;

STRATA COHORT;

ID ID;

BASELINE OUT=A SURVIVAL=S LOWER=LCL UPPER=UCL;

run;

 

Ideas?

Thanks

 

1 REPLY 1
Rick_SAS
SAS Super FREQ

It sounds like you are trying to output the information to a SAS data set and then use PROC SGPLOT to create the graph. If so, you can use the BAND statement to create prediction intervals.

 

data Have;
do Group = 1, 2;
   do t = 0 to 10;
      Prob = exp(-Group*t/10);
      Lower = max(0, Prob - 0.05*Group);
      Upper = min(1, Prob + 0.05*Group);
      output;
   end;
end;
run;

proc sgplot data=Have;
band x=t lower=Lower upper=Upper / group=Group transparency=0.5;
series x=t y=Prob / group=Group;
run;

Regarding the counts (AtRsik, etc), you can use a XAXISTABLE statement to create a table of numbers inside the plot, See these examples:

https://blogs.sas.com/content/graphicallyspeaking/2018/02/19/survival-plot-twist-using-sgplot-proced...

https://blogs.sas.com/content/graphicallyspeaking/2014/02/09/survival-plot/https://blogs.sas.com/content/graphicallyspeaking/2016/07/17/graph-table-with-class/

 

sas-innovate-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 703 views
  • 1 like
  • 2 in conversation