Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- Graphics
- /
- Re: Is it possible to add ATRISK data to a survival plot generated usi...

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 07-02-2016 01:23 PM
(3119 views)

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):

- This reference seems to indicate that PHREG is capable of generating the ATRISK data. However, I can't figure out how to incorporate it in the plot. Furthermore, I'm not sure how to output these data in the dataset generated by my BASELINE statement. However, I assume I can figure out how to join the ATRISK table with my survival table. But this still doesn't solve the problem of how to get it into the plot.

http://blogs.sas.com/content/graphicallyspeaking/2014/02/09/survival-plot/

- This reference seems to indicate that SAS 9.4 incorporates is capable of doing what I want (i.e. plot ATRISK values using SGPLOT's XAXISTABLE statmenet. However, as far as I can tell, this reference only describes how SAS 9.3 can plot the ATRISK values using PROC LIFETEST.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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...

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

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.

Ready to level-up your skills? Choose your own adventure.