BookmarkSubscribeRSS Feed

Custom Task Tuesday: Survival Plot Task 2 Different Ways

Started ‎06-11-2019 by
Modified ‎03-09-2020 by
Views 1,380

 

medium.jpgThis post is part of a mini-series leading up to PharmaSUG 2019 where I will be leading a hands-on training titled: Developing Custom SAS Studio Tasks for Clinical Graphs. For those who can't attend in person, I'll be posting about all of the tasks here on SAS Communities. Each task allows users to customize a different clinical graph from Sanjay Matange’s posts on Graphically Speaking.

 

This week on Custom Task Tuesday we will look at a task for creating and customizing this survival analysis plot (from this post of @Jay54's on the Graphically Speaking blog):

 

plot 4.png

This post is going to go through two different ways to task-ify this survival analysis plot:

  • creating a survival plot task from scratch
  • adding in plot customization to the built-in survival analysis task (new in SAS Studio 3.8!)

Creating a Survival Plot Task from Scratch

To use this made-from-scratch task, you would first run PROC LIFETEST (using code or the built-in task) to generate the necessary dataset for the graph, and then run the task to create the plot. Here's what the first tab (DATA) of the survival analysis task looks like:

1tabt1.png

It allows the user to specify whether they want to use the standard variable names (that come from the output of the LIFETEST procedure) or whether they need to specify their own. This can save the user some time because if they are using the standard names they will not have to do any variable selection.

And here's the second tab (APPEARANCE):1tab2.png

It allows the user to specify new plot titles, a new scatter symbol (instead of plus for censored observations, they could use a filled circle), as well as a new color scheme. 

 

Adding in Plot Customization to Built-In Survival Analysis Task

2tabs.png

Above is the new built-in Nonparametric Survival Analysis task with the added APPEARANCE tab to change the look of the survival plot. The built-in task runs PROC LIFETEST with the users selected options. There are standard plots that come with the output of PROC LIFETEST, but there is no way within the LIFETEST procedure to change colors, titles, etc. The APPEARANCE tab I added allows the task user to customize the plot that will be created with PROC SGPLOT.  This added feature will allow the user to run the survival analysis and create the customize plot all in one step.

 

The Result: A Customized Survival Plot

Customized Survival Plot.PNG

 

Check out the Task Tuesday GitHub

Download the both of these survival analysis plot tasks on the Task Tuesday GitHub to view the code and try them out for yourself!

Take Me to GitHub!

Join the Conversation on Twitter

Twitter_bird_logo_2012.svg.pngUse the hashtag #CustomTaskTuesday and tweet @OliviaJWright with your Custom Task comments and questions!

Version history
Last update:
‎03-09-2020 03:01 PM
Updated by:
Contributors

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Labels
Article Tags