Thanks in advance for your time and I apologize for how naieve my question might be! I am just looking for big-picture input - not expecting code or any specific solution. For the record I am using SAS 9.3 and do not currently have access to SAS 9.4.
I am generating a survival plot using PHREG. I have generated survival plots using two different methods: 1) plots generated within PHREG using the PLOTS = option and 2) plots generated using SGPLOT and the dataset output by the PHREG BASELINE statement.
For either of these approaches, is it possible (in SAS 9.3) to generate a survival plot that contains the number of subjects at risk along the x-axis (time)? I know how to do this in PROC LIFETEST (i.e. by using PROC TEMPLATE); however I can't figure out how to do this in PROC PHREG. Can I use the same PROC TEMPLATE approach I use for PROC LIFETEST to revise the axis in SGPLOT?
I have reviewed the following resources (and drawn the corresponding conclusions):
http://blogs.sas.com/content/graphicallyspeaking/2014/02/09/survival-plot/
I am not very familiar with the details of LIFETEST or PHREG, but I have used LIFETEST to generate survival data along with the ATRISK table at intervals. This data can be saved to a data set using ODS OUTPUT statement. Then one can use SGPLOT to create the actual survival plot that includes the display of the at risk values. With SAS 9.4, you can ues XAXISTABLE that has been explicilty built for such use cases to display the at-risk data. With SAS 9.3, you can display the at-risk data using SGANNOTATE.
The paper "Clinical Graphs Using SAS" describes both methods.
Hi,
From my understanding, I thought that Proc Lifetest was for Kaplan-Meier Survival Curves, and Proc PHREG was for Hazard Ratio's, i.e. Forest Plots.
Someone else might know more though...
PHREG does have the ability to generate survival plots. In my experience it can be useful in case where you want to generate plots that are adjusted (or weighted) for other factors beyond the strata displayed in the plot (or weighted). However, perhaps it is limited in other ways (e.g. maybe it can't be used to display ATRISK data).
I am not very familiar with the details of LIFETEST or PHREG, but I have used LIFETEST to generate survival data along with the ATRISK table at intervals. This data can be saved to a data set using ODS OUTPUT statement. Then one can use SGPLOT to create the actual survival plot that includes the display of the at risk values. With SAS 9.4, you can ues XAXISTABLE that has been explicilty built for such use cases to display the at-risk data. With SAS 9.3, you can display the at-risk data using SGANNOTATE.
The paper "Clinical Graphs Using SAS" describes both methods.
I think you can use the method here. You'll need to generate your data and probably create a custom template using SGTEMPLATE, then use SGRENDER to create your plot.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.