AA-08: Kaplan-Meier Survival Plotting Macro %NEWSURV

Slides:



Advertisements
Similar presentations
Working with Tables for Page Design – Lesson 41 Working with Tables for Page Design Lesson 4.
Advertisements

KompoZer. This is what KompoZer will look like with a blank document open. As you can see, there are a lot of icons for beginning users. But don't be.
Excel Tutorial 2: Formatting Workbook Text and Data
HSRP 734: Advanced Statistical Methods July 24, 2008.
® Microsoft Office 2010 Excel Tutorial 2: Formatting a Workbook.
April 25 Exam April 27 (bring calculator with exp) Cox-Regression
Chapter 11 Survival Analysis Part 3. 2 Considering Interactions Adapted from "Anderson" leukemia data as presented in Survival Analysis: A Self-Learning.
Developing Effective Reports
1 Chapter 3: Getting Started with Tasks 3.1 Introduction to Tasks and Wizards 3.2 Creating a Frequency Report 3.3 Generating HTML, PDF, and RTF Output.
XP New Perspectives on Microsoft Access 2002 Tutorial 71 Microsoft Access 2002 Tutorial 7 – Integrating Access With the Web and With Other Programs.
11 Chapter 3: Getting Started with Tasks 3.1 Introduction to Tasks and Wizards 3.2 Creating a Frequency Report 3.3 Generating HTML, PDF, and RTF Output.
September 5, 2015 Office Setup. Lesson Overview: Office Setup  In this lesson we will cover:  Adding new offices to COM  Individual office setup 
Unit J: Creating a Database Microsoft Office Illustrated Fundamentals.
Bay Area SUG June SAS ® 9.2 Implications for Biotech SAS ® 9.2 Implications for Biotech Bay Area SAS User’s Group June 7 th 2010 Sarmad Pirzada,
Data Analysis Using SPSS
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
The switch from Microsoft Office 2003 to 2007 Microsoft Word Microsoft Excel Microsoft PowerPoint.
01/20151 EPI 5344: Survival Analysis in Epidemiology SAS code and output February 24, 2015 Dr. N. Birkett, School of Epidemiology, Public Health & Preventive.
INTRODUCTION TO SURVIVAL ANALYSIS
Introduction to SAS/Graph 9.2 Ken Barz Colorado Prevention Center 22Oct2009 Ken Barz Colorado Prevention Center.
Page 1 Non-Payroll Cost Transfer Enhancements Last update January 24, 2008 What are the some of the new enhancements of the Non-Payroll Cost Transfer?
McGraw-Hill Career Education© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved. Office Word 2007 Lab 3 Creating Reports and Tables.
Microsoft ® Office Excel 2003 Training Using XML in Excel SynAppSys Educational Services presents:
Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl.
SAS ® is a very powerful tool when producing Graphics. A single graphical data step can easily create a Kaplan Meier Plot, but there is no single graphical.
Kaplan-Meier Survival Plotting Macro %NEWSURV Jeffrey Meyers Mayo Clinic, Rochester, Minnesota 1 BB-13.
Kaplan-Meier Survival Plotting Macro %NEWSURV Jeffrey Meyers Mayo Clinic, Rochester, MN.
Forest Plotting Analysis Macro %FORESTPLOT (Paper 3419)
Lesson 4: Working with Charts and Tables
Chapter 3: Getting Started with Tasks
An Introduction to Epi Info 6/7
A step-by-Step Guide For labels or merges
Microsoft Word Objectives: Word processing using Microsoft Word
Microsoft PowerPoint Illustrated
Standard Operating Procedure
Introduction to OBIEE:
Microsoft Excel.
Microsoft Office 2007-Illustrated
April 18 Intro to survival analysis Le 11.1 – 11.2
Using ODS Excel Migrating from DDE to ODS
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Tutorial 2: Formatting a Workbook
Microsoft Outlook By: Phuong Nguyen.
Lesson 3: Customizing Document Elements
Introduction Previous lessons have demonstrated that the normal distribution provides a useful model for many situations in business and industry, as.
Creating Accessible PDFs from Word Docs
Word Processing.
Cartography and Labeling
Using Excel with Google Maps
Introduction to Gateway to Data (G2D)
2008 Physiological Measurements
ECONOMETRICS ii – spring 2018
Increased Efficiency and Effectiveness
Case Study Creating a Database
Creating and Modifying Queries
Tutorial 3 – Creating a Multiple-Page Report
Using Charts in a Presentation
Microsoft PowerPoint 2007 – Unit 2
Introduction to PowerPoint
Introduction Previous lessons have demonstrated that the normal distribution provides a useful model for many situations in business and industry, as.
Tutorial 7 – Integrating Access With the Web and With Other Programs
Welcome 1 This is a document to explains the chosen concept to the animator. This will take you through a 5 section process to provide the necessary details.
HIBBs is a program of the Global Health Informatics Partnership Learning the Basics of Microsoft Word 2019 and Microsoft office support TFN
Chapter 8 Using Document Collaboration and Integration Tools
Unit J: Creating a Database
Lesson 13 Working with Tables
Welcome To Microsoft Word 2016
Excel for Educators Class Notes
Microsoft Excel 2007 – Level 2
Presentation transcript:

AA-08: Kaplan-Meier Survival Plotting Macro %NEWSURV Jeffrey Meyers Mayo Clinic, Rochester, Minnesota The pharmaceutical and clinical oncology research fields rely heavily on time-to-event endpoints to assess the efficacy of treatments. One of the best graphical displays of time-to-event analysis is the Kaplan-Meier curve, which is simple to make but difficult to customize within SAS. My office has relied upon other software such as Microsoft Excel in order to make their customized Kaplan-Meier curves. This is incredibly inefficient as it required running the analysis in one program, exporting to another program, and manually making the graph, often with the need to create text boxes on top of the graph to show statistics. If the data was updated then the process would need to be repeated almost in its entirety. This has changed with the advent of the SAS SG graphics engine and the Graph Template Language which has improved the appearance and customizability of SAS graphics. The macro NEWSURV takes advantage of the Graph Template language to list the analyzed statistics directly into a Kaplan-Meier plot programmatically, eliminating the need for backend effort. This presentation is an overview of the features of the macro NEWSURV and a walkthrough of the main points of how the macro creates the Kaplan-Meier curves. Give introduction here: Pharmaceutical and clinical trial research heavily dependent on time-to-event endpoints A need to consolidate tables and figures for journal publications and posters. Need for efficiency Relying on other programs tedious Graph Template Language (GTL) adds customizability Exploring led to the ability to add statistics into plots programmatically Repeated programming and positive feedback led to the urge to build a macro

Contents Macro Overview What the macro does How the macro does it Computed Statistics Designing the Plot Designing the Lattice Statistical Report Table Conclusion The first section of the presentation will cover a quick overview of what the output from the macro looks like. I will then lead you through the main features of the macro to give a taste of what it is capable of creating. The description of how the macro works will focus on three key areas: How the statistics are computed and saved, how the template for the graph is designed, and how the graph creates a lattice of plots. Then I will briefly touch on a separate statistical report table that can be generated from the macro outside of the plot.

Macro Overview (Plot) Simple to customize. Can be customized as much as user wants Calculated statistics Patients-at-risk numbers Output formats Scalable vector graphics Lattice

Macro Overview (Statistical Report) General Statistical Report Table Example Event/Total Median (95% CI)† Hazard Ratio (95% CI)‡ Survival Estimates (95% CI)† P-value SASHELP.BMT Data set with no Class Variable All Patients 83/137 1.3 (1.0-2.9) 1 Years: 58.3 (50.6-67.2) 2 Years: 42.0 (34.5-51.2) This is the footnote for this model SASHELP.BMT Data set with Class Variable Group 0.0010$ ALL 24/38 1.1 (0.5-NE) Ref 1 Years: 54.9 (41.1-73.4) 2 Years: 35.3 (22.7-54.8) AML-High Risk 34/45 0.5 (0.3-1.2) 1.47 (0.87-2.48) 1 Years: 37.8 (26.0-55.0) 2 Years: 24.4 (14.6-40.9) AML-Low Risk 25/54 6.0 (1.9-NE) 0.56 (0.32-0.99) 1 Years: 77.8 (67.4-89.7) 2 Years: 61.1 (49.4-75.6) †Kaplan-Meier method; ‡Cox model; $Score test; This also allows an overall footnote Outputs into RTF, HTML or PDF Customizable columns, text, footnotes, and titles Automatically generated with plot

Sample Dataset SASHELP.BMT GROUP – categorical Acute Lymphoblastic Leukemia (ALL) Acute Myeloid Leukemia (AML) High Risk and Low Risk T – time from transplant STATUS – survival status 0=Alive 1=Dead Three Class levels with group variable acute lymphocytic leukemia acute myeloid leukemia high risk acute myeloid leukemia low risk Time variable Status variable Only available in SAS9.3 or later

Key Features/Parameters Line and Axes Transformations Plot Summary Table Options Dataset Transformations Only Required Variables YTYPE, YMIN, YMAX & YINCREMENT %NEWSURV(…, CLASSORDER=3 1 2, CLASSREF=AML-Low Risk, CLASSVALALIGN=left, DISPLAY=legend total event hr pval timelist, PLOTPVAL=logrank, TIMELIST=0.5 1, TIMEDX=Years); LANDMARK CLASSREF TIMELIST & TIMEDX %NEWSURV(…, PATTERN=2 3 4, COLOR=blue red green, LINESIZE=3pt, SYMBOLSIZE=10pt, YTYPE=ppt, YMIN=0.25,YMAX=1,YINCREMENT=0.05, XMIN=0,XMAX=7.5,XINCREMENT=0.5, YLABEL=Proportion Alive, XLABEL=Disease-Free Survival Time (Years)); CLASSORDER CLASSVALALIGN COLOR & PATTERN CLASS & WHERE DISPLAY %NEWSURV( DATA=sashelp.bmt, TIME=T, CENS=status, CEN_VL=0); %NEWSURV(…, CLASS=group, WHERE=group in('ALL' 'AML-High Risk'), XDIVISOR=30.44, LANDMARK=3.0); PLOTPVAL Walk through each category of options Make sure to describe what landmark analyses are Pause briefly on each macro call example XDIVISOR XMIN, XMAX, &XINCREMENT DATA, TIME, CENS, CEN_VL

Patients-at-Risk Table Variations %newsurv(…, RISKLABELLOCATION=left, RISKLOCATION=bottom, RISKLIST=0 to 7.5 by 0.5, RISKCOLOR=1, PARHEADER=Patients-at-Risk); Show the different variations of the patients-at-risk table Mention label locations Mention coloring the numbers Mention header Show macro call example RISKLABELLOCATION RISKLOCATION RISKCOLOR PARHEADER

Lattice of Plots %NEWSURV(TIME=T, CENS=status,CEN_VL=0, SREVERSE=1|0, NMODELS=2,ROWS=1,COLUMNS=2, ORDER=rowmajor, TITLE=%str(A%))|%str(B%)), FOOTNOTE=Footnote1|Footnote2, OVTITLE=Title for entire image, OVFOOTNOTE=Footnote for entire image,…); TITLE OVTITLE SREVERSE Walk through the examples of different options available in a lattice of plots. Take longer on this macro call than the others as it is more complicated FOOTNOTE OVFOOTNOTE

Output Methods RTF, PDF, HTML, Listing Various file types (PNG, JPEG, TIFF, EMF, …) DPI settings Scalable vector graphics (9.3 and later) From macro vs. within ODS tags Quick overview of different output methods available to the macro.

Error Checking Macro checks most parameter input Custom error messages: ERROR: (Model 1: DISPLAY): TOTL is not in the list of valid values ERROR: (Model 1: DISPLAY): Possible values are LEGEND|HR|MEDIAN|TOTAL|EVENT|TIMELIST| PVAL|TABLECOMMENTS ERROR: 1 pre-run errors listed ERROR: Macro NEWSURV will cease

Computed Statistics 1 LIFETEST procedures, up to 2 PHREG procedures N patients, N events Median time-to-event Kaplan-Meier event-free rate Cox proportional hazards ratio Univariate and adjusted P-value Patients-at-risk numbers This section will describe the statistics that are computed within the macro, where they come from, and how they are saved into datasets Explain why there are two LIFETEST procedures Explain that the following slides will show a data set by data set walkthrough, but they are not all unique procedure calls.

LIFETEST – ODS Output SURVIVALPLOT #1 ODS GRAPHICS ON; PROC LIFETEST DATA=sashelp.bmt PLOT=(SURVIVAL(CL)); STRATA group; TIME t*status(0); ODS OUTPUT SURVIVALPLOT=os1; RUN; This is where the values for the Kaplan-Meier curves come from

LIFETEST – ODS Output SURVIVALPLOT #2 ODS GRAPHICS ON; PROC LIFETEST DATA=sashelp.bmt PLOT=(SURVIVAL(ATRISK=1000,2000)); STRATA group; TIME t*status(0); ODS OUTPUT SURVIVALPLOT=splot (KEEP=time tatrisk stratumnum atrisk WHERE=(tatrisk ^=.)); RUN; This is where the values for the patients-at-risk numbers come from

LIFETEST – OUTSURV Option w/REDUCEOUT OPTION PROC LIFETEST DATA=sashelp.bmt OUTSURV=os2 REDUCEOUT TIMELIST=500 1000; STRATA group; TIME t*status(0); RUN; This is where the event-free rate estimates come from The REDUCEOUT option is the reason why there are two LIFETEST procedures

LIFETEST – ODS Output CENSOREDSUMMARY PROC LIFETEST DATA=sashelp.bmt; STRATA group; TIME t*status(0); ODS OUTPUT CENSOREDSUMMARY=summary; RUN; This is where the number of patients and number of events come from

LIFETEST – ODS Output QUARTILES PROC LIFETEST DATA=sashelp.bmt; STRATA group; TIME t*status(0); ODS OUTPUT QUARTILES=quartiles; RUN; This is where the median time-to-event estimates come from

LIFETEST – ODS Output HOMTESTS PROC LIFETEST DATA=sashelp.bmt; STRATA group / logrank wilcoxon; TIME t*status(0); ODS OUTPUT HOMTESTS=pval1; RUN; This is where the logrank and Wilcoxon p-values come from

PHREG #1 – ODS Output PARAMETERESTIMATES PROC PHREG DATA=sashelp.bmt; CLASS group; MODEL t*status(0) = group / RISKLIMITS; ODS OUTPUT PARAMETERESTIMATES=hazards (keep=classval0 hazardratio hrlowercl hruppercl); RUN; This is where the hazard ratios and 95% CI come from Mention that the macro can also do adjusted hazard ratios

PHREG #1 – ODS Output TYPE3 PROC PHREG DATA=sashelp.bmt; CLASS group; MODEL t*status(0) = group / TYPE3(score lr wald); ODS OUTPUT TYPE3=pval2 (keep=effect problrchisq probscorechisq probchisq); RUN; This is where the likelihood-ratio and score type 3 p-values come from

PHREG #2 – Adjusted Models A second PHREG is run if adjusting covariates are added to the model Outputs statistics with same method as PHREG #1 Output datasets limited down to CLASS variable only This is where the likelihood-ratio and score type 3 p-values come from

Statistics Saved as Macro Variables SQL Procedure SUMMARY OS2 QUARTILES HAZARDS PVAL1 PVAL2 N patients/events Event-free rates Median time-to-event Hazard ratios Logrank/Wilcoxon Score/Likelihood-ratio/Wald PROC SQL pulls macro variables with INTO statements

Plot Data Set Only variables used in plot statements Step plots Censor scatterplots Patients-at-risk block plots Only variables that are used in the Template procedure are included in the data set. Plot data set Plotting Kaplan-Meier curves Plotting censor indicators Plotting patients-at-risk numbers Setting up the plot window Summary statistics table Be ready to explain the arrows

Plot Data Set – Step Plot and Censor Scatterplot Columns Variables Cl#_#: CLASS level T#_#: time C#_#: Survival function estimate when censor S#_#: Survival function estimate #_#: First #: CLASS level number Second #: model number These set of columns for each Kaplan-Meier Curve Explain the numbering Explain what is meant by models Explain what is meant by class level

Plot Data Set – Step Plot and Censor Scatterplot Columns This is a sample of the columns produced by the macro to make the Kaplan-Meier curves One set of four columns for each line

Multiple Plots in One Window One STEPPLOT statement Multiple STEPPLOT statement STEPPLOT X=t Y=survival / GROUP=group NAME=‘stepplot’ LINEATTRS=(THICKNESS=4pt); DISCRETELEGEND ‘stepplot’ / …; STEPPLOT X=t3 Y=survival3 / LEGENDLABEL=“AML-Low Risk” NAME=‘stepplot3’ LINEATTRS=(THICKNESS=4pt COLOR=cx01665E PATTERN=8); DISCRETELEGEND ‘stepplot1’ ‘stepplot2’ ‘stepplot3’/ …; STEPPLOT X=t1 Y=survival1 /…; STEPPLOT X=t1 Y=survival1 / LEGENDLABEL=“ALL” NAME=‘stepplot1’ LINEATTRS=(THICKNESS=4pt COLOR=blue PATTERN=1); STEPPLOT X=t2 Y=survival2 / LEGENDLABEL=“AML-High Risk” NAME=‘stepplot2’ LINEATTRS=(THICKNESS=4pt COLOR=cxB2182B PATTERN=4); STEPPLOT X=t2 Y=survival2 /…; Why are each of the lines plotted individually? How are they? Show there is no difference in appearance between using a group option vs. plotting each line separately. Easier to customize when dealing with the separate stepplot statements than with a group option.

Turn Data by Categorical Variable into Multiple Variables DATA _plot; MERGE os1 (WHERE=(group=“ALL”) RENAME=(t=t1 survival=survival1) KEEP=t1 survival1) os1 (WHERE=(group=“AML-High Risk”) RENAME=(t=t2 survival=survival2) KEEP=t2 survival2) (WHERE=(group=“AML-Low Risk”) RENAME=(t=t3 survival=survival3) KEEP=t3 survival3); RUN; Same data set merging with itself Keeps each class level Renames variables

Plot Data Set – Patients-at-risk Block Plot Variables Time#_#: time-point values Atrisk#_#: Number of patients-at-risk partitle_#: Header text string #_#: First #: CLASS level number Second #: model number _#: model number Same naming scheme Three columns for each of the scatterplots Explain the EVAL Function briefly

How Block Plots Can Make Tables 1 38 20 12 11 4 1 MARKERCHARACTER option allows a column of values to become the symbols in the scatterplot 1 2 3 4 5 6 BLOCKPLOT X=time1_1 BLOCK=atrisk1_1 / … VALUEHALIGN=START DISPLAY=(VALUES LABEL); BLOCKPLOT X=time1_1 BLOCK=atrisk1_1 / … VALUEHALIGN=START DISPLAY=(OUTLINE VALUES LABEL); BLOCKPLOT X=time1_1 BLOCK=atrisk1_1 / … VALUEHALIGN=LEFT DISPLAY=(OUTLINE VALUES LABEL);

Plot Data Set – Patients-at-risk Block Plot Variables Set of columns for each class level

Plot Layout Plot Window Model Title Model Footnote Plot Window X - Label Y L a b e l 5 10 15 20 25 30 I N E R M A G B o c k Model Title Model Footnote Plot Window X - Label Y L a b e l Class Level 1 2 3 5 10 15 20 25 30 Model Title Model Footnote Plot Window X-Label Y-Label 5 10 15 20 25 30 Patients - at Risk Header 50 45 30 22 6 3 60 52 37 26 18 7 4 34 20 12 9 2 Class Level 1 Patients - at Risk Header 50 45 30 22 6 3 60 52 37 26 18 7 4 34 20 12 9 2 First image: Explain what layout lattice is. Explain that layout lattice opens up more text field options Layout lattice can be used with only one cell if only to use these other spaces for text statements Second image: Show how the window for each plot makes use of its own lattice layout Titles and footnotes in sidebar blocks patients-at-risk when set to below x-axis Image taken from SAS 9.3 Graph Template Language Reference

Plot Layout Inner Margin Block This title is placed inside of a SIDEBAR block with ALIGN=TOP This footnote is placed inside of a SIDEBAR block with ALIGN=BOTTOM 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 Time (Years) 0.1 0.2 0.3 0.4 0.6 0.7 0.8 0.9 Proportion Alive and Disease-Free Censor 6.0 (1.9-NE) 25 54 AML-Low Risk 0.5 (0.3-1.2) 34 45 AML-High Risk 1.1 (0.5-NE) 24 38 ALL Median (95% CI) Event Total Disease Group Inner Margin Block This title is placed inside of a SIDEBAR block with ALIGN=TOP This footnote is placed inside of a SIDEBAR block with ALIGN=BOTTOM Patients-at-Risk 38 26 20 14 12 11 7 4 1 45 23 17 13 10 8 6 3 2 54 47 42 36 33 29 24 19 AML-Low Risk AML-High Risk ALL 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 Time (Years) 0.1 0.2 0.3 0.4 0.6 0.7 0.8 0.9 Proportion Alive and Disease-Free Censor 6.0 (1.9-NE) 25 0.5 (0.3-1.2) 34 1.1 (0.5-NE) Median (95% CI) Event Total Disease Group Show how the schematic layout lines up with an actual plot example

Lattice of Plots Any rectangular array Fully Customizable Each model’s option separated by | delimiter Number of plots is determined by number of time variables

Lattice Layout of Plots Process Flow Temporary data set w/transformations Begin template and define number of cells Analysis procedures Create cell axes Create plot and output data sets Error Checking Run plot statements Run output options Create macro variables for ENTRY statements Explain first, then run animation Shows the process flow of the macro when multiple models are run in one macro call SGRENDER procedure Delete temporary datasets REPORT procedure

Plot Summary Table Transition into the plot summary table

ENTRY Statements Create text Placed inside/outside plot LAYOUT GRIDDED / ROWS=2 HALIGN=right VALIGN=top BORDER=true; ENTRY HALIGN=left ‘Green Text’ / VALIGN=top TEXTATTRS= (COLOR=green SIZE=14pt); ENTRY HALIGN=left ‘Black Text’ (COLOR=black SIZE=14pt); ENDLAYOUT; Create text Placed inside/outside plot Anchored by combination of position terms Left/Center/Right Top/Center/Bottom Powerful w/LAYOUT GRIDDED Green Text Black Text Red Text Black Text Green Text ENTRY HALIGN=left ‘Green Text’ / VALIGN=top TEXTATTRS= (COLOR=green SIZE=14pt); ENTRY HALIGN=left ‘Black Text’ (COLOR=black SIZE=14pt); ENTRY HALIGN=center 'Red Text‘ / VALIGN=top TEXTATTRS= (COLOR=red SIZE=14pt); ENTRY HALIGN=left ‘Blue Text’ / VALIGN=bottom TEXTATTRS= (COLOR=blue SIZE=14pt); ENTRY HALIGN=right "X" {sup "2"} {unicode "2264"x} "64" / VALIGN=bottom TEXTATTRS=(COLOR=black SIZE=14pt); 1 X 2 <64 Blue Text 1 2 3 4 5 6 Walk through the different entry statements Give a description of layout gridded

LAYOUT GRIDDED Class N Median (95% CI) Time-Point KM Est ALL 38 1.1 (0.5-NE) 1 Year 0.55 2 Years 0.35 AML High-Risk 45 0.5 (0.3-1.2) 0.38 AML Low-Risk 54 6.0 (1.9-NE) 0.78 Makes a rectangular grid Each cell can contain ENTRY statements Plot statements Legend statements Automatically sized Can be nested within itself

Non-Visible Items Still Take up Space STEPPLOT X=t1 Y=survival1 / LINEATTRS=(color=white) NAME='white' LEGENDLABEL='White Line'; STEPPLOT X=t1 Y=survival1 / NAME=‘class1’ …; STEPPLOT X=t2 Y=survival2 / NAME=‘class2’ …; STEPPLOT X=t3 Y=survival3 / NAME=‘class3’ …; LAYOUT GRIDDED / COLUMNS=1 ROWS=2 …; DISCRETELEGEND ‘class1’ ‘class2’ ‘class3’ / …; DISCRETELEGEND 'white' / BACKGROUNDCOLOR=red OPAQUE=true …; ENDLAYOUT; 250 500 750 1000 1250 1500 1750 2000 2250 2500 2750 3000 Disease-Free Survival Time 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Survival Distribution Function Estimate White Line AML Low-Risk AML High-Risk ALL White Line AML Low-Risk AML High-Risk ALL Explain that the next two slides include tricks that are used in order to make the plot summary table This slide contains an example of an item that cannot be seen, but can still be made useful for plotting purposes. Focus on text by the arrow

Rendering in Order 250 500 750 1000 1250 1500 1750 2000 2250 2500 Disease-Free Survival Time 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Survival Distribution Function Estimate ALL Black ALL AML-High Risk AML-Low Risk SCATTERPLOT X=t2 Y=survival2 / MARKERATTRS=(symbol=diamondfilled color=black) NAME='black' LEGENDLABEL='ALL Black'; SCATTERPLOT X=t Y=survival / MARKERATTRS=(symbol=diamondfilled) GROUP=group NAME='group'; DISCRETELEGEND 'black' 'group' / …; Explain how choosing a specific rendering order can lead to useful features Overwriting certain lines Using objects for legends, creating new looking graphics, etc.

Plot Summary Table Design + . 61 ( 49 - 76 ) Legend Class Value Total Events Time Point KM Estimate Score P value : 0010 Censor Table Comment 1 2 3 ALL AML High Risk Low Risk 38 45 54 24 34 25 Years 55 41 73 35 23 26 15 78 67 90 Walk through how to next layout gridded statements in order to create a formatted table Show where the previous tricks come into play Explain dynamic ability to change

Statistical Report Table General Statistical Report Table Example Event/Total Median (95% CI)† Hazard Ratio (95% CI)‡ Survival Estimates (95% CI)† P-value SASHELP.BMT Data set with no Class Variable All Patients 83/137 1.3 (1.0-2.9) 1 Years: 58.3 (50.6-67.2) 2 Years: 42.0 (34.5-51.2) This is the footnote for this model SASHELP.BMT Data set with Class Variable Group 0.0010$ ALL 24/38 1.1 (0.5-NE) Ref 1 Years: 54.9 (41.1-73.4) 2 Years: 35.3 (22.7-54.8) AML-High Risk 34/45 0.5 (0.3-1.2) 1.47 (0.87-2.48) 1 Years: 37.8 (26.0-55.0) 2 Years: 24.4 (14.6-40.9) AML-Low Risk 25/54 6.0 (1.9-NE) 0.56 (0.32-0.99) 1 Years: 77.8 (67.4-89.7) 2 Years: 61.1 (49.4-75.6) †Kaplan-Meier method; ‡Cox model; $Score test; This also allows an overall footnote Walk through highlighting the customizability of the table Imports the titles/footnotes from plots Automatically generated footnotes

Multiple Macro Calls Can be Output in the same Report   Event/Total Survival Estimates (95% CI)† All Patients, In Years, Survival at 1 Year, Using Proportions Disease Group ALL 24/38 1 Year: 0.55 (0.41-0.73) AML-High Risk 34/45 1 Year: 0.38 (0.26-0.55) AML-Low Risk 25/54 1 Year: 0.78 (0.67-0.90) This comes from the first macro call Time Landmarked at 500 Days, In Days, Subsequent Survival at 365 Days, Using Percentages 3/16 365 Days: 0.80 (0.63-1.00) 2/13 365 Days: 0.85 (0.67-1.00) 7/36 365 Days: 0.89 (0.79-1.00) This comes from the second macro call †Kaplan-Meier method; %NEWSURV(…, summary=0,out=table); %NEWSURV(…, summary=1,out=table, newtable=0); Ability to make multiple runs of the macro save to the dame dataset Ability to make the last macro call output the dataset with all of the analysis

Contact Information Name: Jeffrey Meyers Enterprise: Mayo Clinic Address: 200 1st St SW City, State ZIP: Rochester, MN 55905 Work Phone: 507-266-2711 E-mail: Meyers.Jeffrey@mayo.edu jpmeyers.spa@gmail.com Twitter: jmeyers_spa