Customizing Survival Curves

Similar documents
PharmaSUG 2013 PO05. ADaM Datasets for Graphs Kevin Lee, Cytel, Inc., Chesterbrook, PA Chris Holland, Amgen, Rockville, MD

Stylish Waterfall Graphs using SAS 9.3 and 9.4 Graph Template Language

SAS/STAT 14.1 User s Guide. Customizing the Kaplan-Meier Survival Plot

SAS Graph a Million with the SGPLOT Procedure. Prashant Hebbar, Sanjay Matange

Annotating Graphs from Analytical Procedures

Customizing a Multi-Cell Graph Created with SAS ODS Graphics Designer Yanhong Liu, Cincinnati Children s Hospital Medical Center, Cincinnati, OH

Macros for creating a custom report of figures

Introduction to Statistical Graphics Procedures

Creating Graph Collections with Consistent Colours using ODS Graphics. Philip R Holland, Holland Numerics Ltd

Key Features in ODS Graphics for Efficient Clinical Graphing Yuxin (Ellen) Jiang, Biogen, Cambridge, MA

ABSTRACT INTRODUCTION

Advanced Graphs using Axis Tables

Behind the Scenes: from Data to Customized Swimmer Plots Using SAS Graph Template Language (GTL)

Great Time to Learn GTL

Enhanced Swimmer Plots: Tell More Sophisticated Graphic Stories in Oncology Studies

separate representations of data.

Plotting LSMEANS and Differences in Generalized Linear Models with GTL Robin High, University of Nebraska Medical Center, Omaha, NE

ODS GRAPHICS DESIGNER (Creating Templates for Batchable Graphs)

What could ODS graphics do about Box Plot?

Stat 302 Statistical Software and Its Applications SAS: Distributions

SAS GTL: Improving Patients Safety and Study Efficiency Masaki Mihaila, Medivation, Inc, San Francisco, CA

Stylizing your SAS graph A needs-based approach

From Getting Started with the Graph Template Language in SAS. Full book available for purchase here.

Up Your Game with Graph Template Language Layouts

The Art of Overlaying Graphs for Creating Advanced Visualizations

Using the SG Procedures to create and enhance scatter plots Peter L. Flom, Peter Flom Consulting, New York, NY

What HIGHLOW Can Do for You Kristen Much, Rho, Inc., Chapel Hill, NC Kaitlyn Steinmiller, Rho, Inc., Chapel Hill, NC

Creating and Customizing Graphics using Graph Template Language

From Clicking to Coding: Using ODS Graphics Designer as a Tool to Learn Graph Template Language

Building a Template from the Ground Up with GTL

Kaplan-Meier Survival Plotting Macro %NEWSURV Jeffrey Meyers, Mayo Clinic, Rochester, Minnesota

Annotating the ODS Graphics Way!

Introducing Statistical Graphics (SG): Victoria UG May 2018 Mary Harding SAS Canada

ABSTRACT KEY WORDS INTRODUCTION

Introduction to SAS/GRAPH Statistical Graphics Procedures

Nesting Multiple Box Plots and BLOCKPLOTS using GTL and Lattice Overlay SAS

Nesting Multiple Box Plots and BLOCKPLOTS using GTL and Lattice Overlay

The Power of the Graphics Template Language Jeff Cartier, SAS Institute Inc., Cary, NC

PharmaSUG 2012 Paper DG12

Need a Scientific Journal Ready Graphic? No Problem!

%EventChart: A Macro to Visualize Data with Multiple Timed Events

Creating Graphs Using SAS ODS Graphics Designer

Interactive Programming Using Task in SAS Studio

SAS/STAT 13.1 User s Guide. ODS Graphics Template Modification

Getting Started with ODS Statistical Graphics in SAS 9.2 Revised 2009 Robert N. Rodriguez, SAS Institute Inc., Cary, NC

Paper Some Tricks in Graph Template Language Amos Shu, AstraZeneca Pharmaceuticals, LP

Clinical Graphs using SAS

THE NATURE OF SGPLOT (HOW ARE LINE ATTRIBUTES ASSIGNED?)

SAS Instructions Entering the data and plotting survival curves

A Programmer s Introduction to the Graphics Template Language Jeff Cartier, SAS Institute Inc., Cary, NC

Fancy Data Visualisations Without Additional Toolkits

Prescription for Visualization: Take One SAS Graph Template Language Graph before Seeing the Patient

Something for Nothing! Converting Plots from SAS/GRAPH to ODS Graphics

An Introduction to ODS for Statistical Graphics in SAS 9.1 Robert N. Rodriguez SAS Institute Inc., Cary, North Carolina, USA

WORKING IN SGPLOT. Understanding the General Logic of Attributes

WORKING IN SGPLOT. Understanding the General Logic of Attributes

CONSORT Diagrams with SG Procedures

How to improve your figure An overview of annotation techniques in Graph Template Language

Developing Graphical Standards: A Collaborative, Cross-Functional Approach Mayur Uttarwar, Seattle Genetics, Inc., Bothell, WA

Dynamic Dashboards Using Base-SAS Software

Putting on the Ritz: New Ways to Style Your ODS Graphics to the Max

Introduction to the Graph Template Language Sanjay Matange, SAS Institute, Cary, NC

Scalable Vector Graphics (SVG) using SAS Yang Wang, Seattle Genetics, Inc., Bothell, WA Vinodita Bongarala, Seattle Genetics, Inc.

Combining TLFs into a Single File Deliverable William Coar, Axio Research, Seattle, WA

A Practical Example of SGPLOT Using Logistic Regression

Highly Customized Graphs Using ODS Graphics

Clinical Graphs Using SAS Sanjay Matange, SAS Institute Inc.

Getting Started with the SGPLOT Procedure

Using SAS ODS Graphics Chuck Kincaid, Experis, Portage, MI

The Generated Draw Statements. Plots with Groups Attribute Maps

CREATING STATISTICAL GRAPHICS IN SAS

How to improve your figure An overview of annotation techniques in Graph Template Language

Generating Color Scales in SAS : 256 Shades of RGB

Patient Profile Graphs using SAS. Sanjay Matange, SAS Institute, Inc.

Reporting from Base SAS Tips & Tricks. Fareeza Khurshed BC Cancer Agency

PDF Accessibility: How SAS 9.4M5 Enables Automatic Production of Accessible PDF Files

Building a Better Dashboard Using Base SAS Software

A Visual Revolution Statistical Graphics in SAS 9.2 Bob Newman, Amadeus Software Limited

When Simpler is Better Visualizing Laboratory Data Using SG Procedures Wei Cheng, Isis Pharmaceuticals, Inc., Carlsbad, CA

1 Introduction to Using Excel Spreadsheets

Getting Your Hands on Reproducible Graphs

Graded Assignment 2 Maple plots

Paper S Data Presentation 101: An Analyst s Perspective

Data Annotations in Clinical Trial Graphs Sudhir Singh, i3 Statprobe, Cary, NC

Solution to Tumor growth in mice

Paper AD12 Using the ODS EXCEL Destination with SAS University Edition to Send Graphs to Excel

Graphing Made Easy with ODS Graphics Procedures

Using The System For Medical Data Processing And Event Analysis: An Overview

Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9

Multivariate probability distributions

Controlling the Drawing Space in ODS Graphics by Example

Applied Regression Modeling: A Business Approach

UCB CALSTAPH EXCEL AND EPIDEMIOLOGY

SAS/GRAPH Introduction. Winfried Jakob, SAS Administrator Canadian Institute for Health Information

Sankey Diagram with Incomplete Data From a Medical Research Perspective

Professional outputs with ODS LATEX

SAS macro package to automate coding graphs with ClinXport.

Introduction to creating and working with graphs

Individual Plot Overlay

New SAS/GRAPH Procedures for Creating Statistical Graphics in Data Analysis Dan Heath, SAS Institute Inc., Cary, NC

Transcription:

Customizing Survival Curves Jeremy Hamm Cancer Surveillance & Outcomes (CSO) Population Oncology BC Cancer Agency

Outline Survival Curve Basics Using Proc Template Using Proc SGPlot 2

Analysis Using dataset Valung from proc lifetest help menu Run basic kaplan-meier proc lifetest data=valung plots=(s); time SurvTime*Censor(1); id Therapy; strata Cell; run; 3

Default Kaplan-Meier Graph 4

Want to Modify Some Basics 5

Want to Modify Some Basics Title 6

Want to Modify Some Basics Change Axis to % 7

Want to Modify Some Basics Change Line Type and Colour 8

SAS Graph Templates Graphs can be modified using templates. Part of the graphing template language (GTL) How does one know which template to use? How does one go about changing the template? 9

Helpful SAS code Using a combination of ODS trace and ODS graphics, one can figure out the template of the graph being produced ods trace on; ods graphics on; SAS Program ods graphics off; ods trace off; 10

Log File The log file displays: Data used to generate graph Template used Output Added: ------------- Name: SurvivalPlot Label: Survival Curves Template: Stat.Lifetest.Graphics.ProductLimitSurvival Path: Lifetest.SurvivalPlot ------------- 11

Survivalplotdata Output data requested through ODS 12

Template Code Obtaining the Template code: Code will show up in the log proc template; source Stat.Lifetest.Graphics.ProductLimitSurvival; run; Can modify and run the code which will then change the template being used Code is too long to display 13

De-coding Template Code Familiarize yourself with plot options Template lists all plot options Many if statements based on confidence intervals requested, at risk patients, number of strata Need to figure out which pieces are relevant to what needs modification 14

Example of Ignorable Code Within the Proc Template code structure, will see the following: /*4*/ if (PLOTHW=1 AND PLOTEP=0) bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=time / modelname="survival" fillattrs=graphconfidence name="hw" legendlabel=labelhw; /*4*/ endif; Where PlotHW and PlotEP refer to types of confidence bands 15

Example of Important Code proc template; define statgraph new_graph_template; begingraph; entrytitle "Plotted with SGrender"; layout overlay / xaxisopts=(label="time" shortlabel="time" offsetmin=.05 linearopts=(viewmax=600)) yaxisopts=(label="survival Probability" shortlabel="survival" linearopts=(viewmin=0 viewmax=1 tickvaluelist=(0.2.4.6.8 1.0))); stepplot y=survival x=time / group=stratum index=stratumnum name="survival" rolename=(_tip1=atrisk _tip2=event) tip=(y x Time _tip1 _tip2) ; DiscreteLegend "Survival" / title="cell" location=outside; scatterplot y=censored x=time / group=stratum index=stratumnum markerattrs=(symbol=plus); layout gridded / rows=1 autoalign=(topright BOTTOMLEFT TOP BOTTOM) border=true BackgroundColor=GraphWalls:Color Opaque=true; entry "+ Censored"; endlayout; endlayout; endgraph; end; run; 16

Example of Important Code proc template; define statgraph new_graph_template; begingraph; entrytitle "Plotted with SGrender"; Title layout overlay / xaxisopts=(label="time" shortlabel="time" offsetmin=.05 linearopts=(viewmax=600)) yaxisopts=(label="survival Probability" shortlabel="survival" linearopts=(viewmin=0 viewmax=1 tickvaluelist=(0.2.4.6.8 1.0))); stepplot y=survival x=time / group=stratum index=stratumnum name="survival" rolename=(_tip1=atrisk _tip2=event) tip=(y x Time _tip1 _tip2) ; DiscreteLegend "Survival" / title="cell" location=outside; scatterplot y=censored x=time / group=stratum index=stratumnum markerattrs=(symbol=plus); layout gridded / rows=1 autoalign=(topright BOTTOMLEFT TOP BOTTOM) border=true BackgroundColor=GraphWalls:Color Opaque=true; entry "+ Censored"; endlayout; endlayout; endgraph; end; run; 17

Example of Important Code proc template; define statgraph new_graph_template; begingraph; Axis Options entrytitle "Plotted with SGrender"; layout overlay / xaxisopts=(label="time" shortlabel="time" offsetmin=.05 linearopts=(viewmax=600)) yaxisopts=(label="survival Probability" shortlabel="survival" linearopts=(viewmin=0 viewmax=1 tickvaluelist=(0.2.4.6.8 1.0))); stepplot y=survival x=time / group=stratum index=stratumnum name="survival" rolename=(_tip1=atrisk _tip2=event) tip=(y x Time _tip1 _tip2) ; DiscreteLegend "Survival" / title="cell" location=outside; scatterplot y=censored x=time / group=stratum index=stratumnum markerattrs=(symbol=plus); layout gridded / rows=1 autoalign=(topright BOTTOMLEFT TOP BOTTOM) border=true BackgroundColor=GraphWalls:Color Opaque=true; entry "+ Censored"; endlayout; endlayout; endgraph; end; run; 18

Example of Important Code proc template; define statgraph new_graph_template; begingraph; entrytitle "Plotted with SGrender"; layout overlay / xaxisopts=(label="time" shortlabel="time" offsetmin=.05 linearopts=(viewmax=600)) yaxisopts=(label="survival Probability" shortlabel="survival" linearopts=(viewmin=0 viewmax=1 tickvaluelist=(0.2.4.6.8 1.0))); stepplot y=survival x=time / group=stratum index=stratumnum name="survival" rolename=(_tip1=atrisk _tip2=event) tip=(y x Time _tip1 _tip2) ; DiscreteLegend "Survival" / title="cell" location=outside; scatterplot y=censored x=time / group=stratum index=stratumnum markerattrs=(symbol=plus); layout gridded / rows=1 autoalign=(topright BOTTOMLEFT TOP BOTTOM) border=true BackgroundColor=GraphWalls:Color Opaque=true; entry "+ Censored"; endlayout; endlayout; endgraph; end; run; Stuff that isn t changing 19

Producing the New Graph Good idea to rename the new templates and use Proc SGrender to run proc sgrender data=survivalplotdata template=new_graph_template; run; This prevents default templates from being permanently changed by mistake Difficult to return to original settings for me, anyways Recall this dataset is found in the log (add data suffix) 20

Result Title Change 21

Proc SGplot For those that do not feel comfortable with templates Templates can be confusing and can wreck SAS if you don t know how to get the default back (yikes!) Difficult to use your own line colours Can output data and graph with SGplot Commands more similar to basic SAS graphing 22

Proc SGplot example proc sgplot data=survivalplotdata_sgplot; title f="blackadder ITC/Italic/Bold" h=24pt "Much Better Looking Graph" ; step x=time y=survival1/lineattrs=(pattern=1 color=blue thickness=3) Legendlabel="Adeno"; step x=time y=survival2/lineattrs=(pattern=2 color=cxffcc00 thickness=3) Legendlabel="Large"; keylegend/across=1 down=2 location=inside position=topright valueattrs=( size=12pt); xaxis label= 'Years' LABELattrs=( size=12pt weight=bold color=red style=italic); yaxis label="survival (%)" min=0 max=100 LABELattrs=( size=12pt weight=bold); inset "Logrank P=<0.0001"/border position=right TEXTattrs=( size=12pt); run;quit; 23

Result 24

Pros and Cons Proc Template is easy to adjust the default template to make small changes Difficult to change line colours when using the group option Proc SGplot can be used on the output dataset and can be graphed however you wish Difficult to include list of at risk patients 25

Conclusion Proc Template and Proc SGrender can both modify graphs Proc SGplot can be used without having to deal with templates 26

Questions? 27