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
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/2014/02/09/survival-plot/https://blogs.sas.com/content/graphicallyspeaking/2016/07/17/graph-table-with-class/
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.