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

Similar documents
Introduction to SAS/GRAPH Statistical Graphics Procedures

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

Effective Graphics Made Simple Using SAS/GRAPH SG Procedures Dan Heath, SAS Institute Inc., Cary, NC

Multiple Graphical and Tabular Reports on One Page, Multiple Ways to Do It Niraj J Pandya, CT, USA

Introduction to Statistical Graphics Procedures

PharmaSUG China

Graphing Made Easy with ODS Graphics Procedures

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

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

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

Introduction to ODS Graphics for the Non-Statistician

Graphing Made Easy with SGPLOT and SGPANEL Procedures

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

Fancy Data Visualisations Without Additional Toolkits

Converting Annotate to ODS Graphics. Is It Possible?

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

SAS Cloud Analytic Services 3.1: Graphing Your Output

SGPANEL: Telling the Story Better Chuck Kincaid, COMSYS, Portage, MI

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

Displaying Multiple Graphs to Quickly Assess Patient Data Trends

Programming Gems that are worth learning SQL for! Pamela L. Reading, Rho, Inc., Chapel Hill, NC

ABSTRACT INTRODUCTION THE ODS TAGSET FACILITY

SAS macro package to automate coding graphs with ClinXport.

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

Paper S Data Presentation 101: An Analyst s Perspective

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility

Stylish Waterfall Graphs using SAS 9.3 and 9.4 Graph Template Language

Introduction to ODS Statistical Graphics

Lab #3. Viewing Data in SAS. Tables in SAS. 171:161: Introduction to Biostatistics Breheny

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

Using PROC SGPLOT for Quick High-Quality Graphs

Need a Scientific Journal Ready Graphic? No Problem!

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

Statistics and Data Analysis. Common Pitfalls in SAS Statistical Analysis Macros in a Mass Production Environment

SUGI 29 Posters. Paper A Group Scatter Plot with Clustering Xiaoli Hu, Wyeth Consumer Healthcare., Madison, NJ

Great Time to Learn GTL

Using PROC SQL to Generate Shift Tables More Efficiently

Creating Graphs Using SAS ODS Graphics Designer

SAS Visual Analytics 8.2: Getting Started with Reports

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

Interactive Visualization of Clinical Laboratory Parameters with SAS Stored Processes and jquery AJAX

Maintaining a 'Look and Feel' throughout a Reporting Package Created with Diverse SAS Products Barbara B Okerson, Anthem, Inc.

The Power of Combining Data with the PROC SQL

186 Statistics, Data Analysis and Modeling. Proceedings of MWSUG '95

CONSORT Diagrams with SG Procedures

Advanced Graphs using Axis Tables

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

What could ODS graphics do about Box Plot?

Paper CC01 Sort Your SAS Graphs and Create a Bookmarked PDF Document Using ODS PDF ABSTRACT INTRODUCTION

A Practical Example of SGPLOT Using Logistic Regression

PharmaSUG Paper SP09

Standard Safety Visualization Set-up Using Spotfire

A Picture is worth 3000 words!! 3D Visualization using SAS Suhas R. Sanjee, Novartis Institutes for Biomedical Research, INC.

Indenting with Style

Getting Started with the SGPLOT Procedure

Controlling the Drawing Space in ODS Graphics by Example

PharmaSUG Paper TT10 Creating a Customized Graph for Adverse Event Incidence and Duration Sanjiv Ramalingam, Octagon Research Solutions Inc.

A Combined AE + CM Graph using SAS

SAS (Statistical Analysis Software/System)

Quick Results with the Output Delivery System

Tips and Tricks in Creating Graphs Using PROC GPLOT

The GTESTIT Procedure

A SAS Macro to Generate Caterpillar Plots. Guochen Song, i3 Statprobe, Cary, NC

Introduction to Statistical Analyses in SAS

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

Easing into Data Exploration, Reporting, and Analytics Using SAS Enterprise Guide

A Juxtaposition of Tables and Graphs Using SAS /GRAPH Procedures

Enterprise Miner Software: Changes and Enhancements, Release 4.1

Exposure-Response Plots Using SAS Janette Garner, Gilead Sciences, Inc., Foster City, CA

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

PharmaSUG Paper SP04

Get SAS sy with PROC SQL Amie Bissonett, Pharmanet/i3, Minneapolis, MN

A Strip Plot Gets Jittered into a Beeswarm

Figure 1. Table shell

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

SAS CLINICAL SYLLABUS. DURATION: - 60 Hours

SAS Studio 4.4: User s Guide

separate representations of data.

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

Clip Extreme Values for a More Readable Box Plot Mary Rose Sibayan, PPD, Manila, Philippines Thea Arianna Valerio, PPD, Manila, Philippines

TS11 Clinical Trial Reporting with SAS ODS Graphics

SAS (Statistical Analysis Software/System)

SAS (Statistical Analysis Software/System)

Preparing the Office of Scientific Investigations (OSI) Requests for Submissions to FDA

Paper: PO19 ARROW Statistical Graphic System ABSTRACT INTRODUCTION pagesize=, layout=, textsize=, lines=, symbols=, outcolor=, outfile=,

PharmaSUG 2015 Paper PO03

New for SAS 9.4: A Technique for Including Text and Graphics in Your Microsoft Excel Workbooks, Part 1

Pooling Clinical Data: Key points and Pitfalls. October 16, 2012 Phuse 2012 conference, Budapest Florence Buchheit

Recording Vital Signs and Test Results in Med-Center

FILLPATTERNS in SGPLOT Graphs Pankhil Shah, PPD, Morrisville, NC

Chapter 27 Saving and Printing Graphics

Applications Development. Paper 24-27

JMP Clinical. Release Notes. Version 5.0

Exporting Variable Labels as Column Headers in Excel using SAS Chaitanya Chowdagam, MaxisIT Inc., Metuchen, NJ

Customized Flowcharts Using SAS Annotation Abhinav Srivastva, PaxVax Inc., Redwood City, CA

CREATING THE DISTRIBUTION ANALYSIS

Data Standardisation, Clinical Data Warehouse and SAS Standard Programs

Output Delivery System: The Basics and Beyond Lauren E. Haworth Cynthia L. Zender Michele M. Burlew

SAS Studio: A New Way to Program in SAS

Square Peg, Square Hole Getting Tables to Fit on Slides in the ODS Destination for PowerPoint

Transcription:

When Simpler is Better Visualizing Laboratory Data Using SG Procedures Wei Cheng, Isis Pharmaceuticals, Inc., Carlsbad, CA ABSTRACT In SAS 9.2, SAS/GRAPH introduces a family of new procedures to create stand-alone graphs that use the ODS Statistical Graphics infrastructure and are designed to use ODS styles. These new SG procedures include SGPLOT, SGPANEL, and SGSCATTER. With a simple and clear syntax, procedure-quality plots can be generated to assist your data exploration and presentation. This paper provides examples that illustrate how you can use these new procedures to examine and visualize laboratory data. INTRODUCTION One of the most important component s of clinical research data is laboratory data, because the results of laboratory tests contain indicators of drug safety or efficacy. Clinicians and statisticians closely monitor the laboratory data during the course of clinical trial to find the best diagnosis and treatment. Graphical representation of laboratory data is often used to provide visual information on the trend or comparison of laboratory tests among different treatment groups of subjects, as well as presenting the treatment safety or efficacy observed in a study. Prior to the introduction of SG procedures in SAS 9.2, we had to generate statistics data from statistical procedures; configure the appropriate fonts and image types by GOPTION; use the traditional SAS/GRAPH procedures, statements, and annotation to generate the plots; and combine the plots into a panel by PROC GREPLAY. By using the features of the new procedures SGPLOT, SGPANEL, and SGSCATTER, the process of generating graphs to visualize laboratory data has been greatly simplified. I will use laboratory data from a clinical study to generate commonly used statistical graphs which can assist clinicians to understand the data. There are sixteen subjects in the study, results from four laboratory tests creatinine, platelet, red blood cell count, and white blood cell count were collected for analysis. The same code can be applied to bigger clinical trials which contain more subjects and more laboratory tests. By using the new SG procedures, just a few lines of code can generate much better plots than plots generated by traditional SAS/GRAPH language with hundreds of lines of code. EXAMPLE 1: SPAGHETTI PLOTS Spaghetti plots are several line graphs that have been overlaid in a single graph. Sometimes it is helpful to plot each subject s raw data at each time point to assess the trends or patterns. If the individual lines are not all in the same direction, then subjects are showing different responses to the treatment, which will lead to further examination. options nobyline; PROGRAM 1 title "Spaghetti Plots by #byvar1 - #byval1"; proc sgplot data = labdata; by labtest; series x = visit y = result / group = subjid; xaxis values = (-6 to 105 by 7); Figure 1 displays four spaghetti plots for four laboratory tests generated from the proceeding program: 1

FIGURE 1 EXAMPLE 2: A PANEL OF LINE PLOTS FOR ONE LABORATORY TEST If you feel the spaghetti plots are too crowded, you can separate them to a panel of individual line plots. Program 2 will generate a panel of plots for creatinine, as shown in Figure 2. The plots for all the subjects are sharing a same axis scale for comparison. title "Creatinine"; PROGRAM 2 proc sgpanel data = labdata (where = (labtest = "Creatinine")); panelby subjid / rows=4 columns=4; series x = visit y = result; colaxis values = (-6 to 105 by 7); 2

FIGURE 2 EXAMPLE 3: A PANEL OF LINE PLOTS FOR ONE SUBJECT On the other hand, if you want to examine all the laboratory test results together for one subject, you can use Program 3 to generate a panel of plots for each subject. Figure 3 shows one of the sixteen panels generated by Program 3. The plots for all the test results are sharing a same x-axis scale as study day from first treatment dose. PROGRAM 3 options nobyline; title "A Panel of Plots for #byvar1 - #byval1"; proc sgpanel data = labdata; 3

panelby labtest / columns = 1 rows = 4 uniscale = column novarname; series x = visit y = result; by subjid; colaxis values = (-6 to 105 by 7); FIGURE 3 EXAMPLE 4: A 2X2 PANEL OF LINE PLOTS FOR ONE SUBJECT Figure 3 shows a panel which contains one column and four rows, if you want to have a 2x2 panel which has two columns and two rows to show the four laboratory tests, you can combine PROC SGPLOT with TAGSET HTMLPANEL, so each laboratory test has their own Y-axis scale. The resulting plots, after submitting Program 4, are shown in Figure 4. PROGRAM 4 4

title "Subject 1001"; ods tagsets.htmlpanel nogtitle file = "plots_bysubject.html"; ods tagsets.htmlpanel event = panel(start) options(panelcolumns = "2" bylabels = "no"); proc sgplot data = labdata (where = (subjid = "1001")); by labtest; series x = visit y = result; ods tagsets.htmlpanel event = panel(finish); ods tagsets.htmlpanel close; FIGURE 4 EXAMPLE 5: A PANEL OF LINE PLOTS BY SUBJECT AND LABORATORY TEST By using the LATTICE layout, a panel of plots by subject and laboratory test can be generated by Program 5. The subject identifications are displayed above the columns, laboratory tests are displayed to the right side of the rows, as shown in Figure 5. PROGRAM 5 title "A Panel of Plots by Subject and Lab Test"; 5

proc sgpanel data = labdata; panelby subjid labtest / layout = lattice uniscale = column columns = 4 rows = 4 novarname; series x = visit y = result; colaxis values = (-6 to 105 by 7); FIGURE 5 EXAMPLE 6: TWO PLOTS OVERLAID IN A SINGLE GRAPH When line plots of two laboratory tests are overlaid in a single graph, it s easier to explore the relationship of changes over time. Each line plot is assigned to a different vertical axis, as shown in Figure 6. In Program 6, PROC TRANSPOSE was used to prepare the data set for PROC SGPLOT. 6

PROGRAM 6 proc sort data = labdata (keep = subjid labtest visit result); by visit; where subjid = "1001" and labtest in ("Creatinine" "Platelet"); proc transpose data = labdata out = lab4plot; by visit; var result; id labtest; title "Subject 1001"; proc sgplot data = lab4plot; series x = visit y = creatinine; series x = visit y = platelet / y2axis; FIGURE 6 EXAMPLE 7: GROUP MEAN OVER TIME Figure 7 shows mean laboratory test results of repeated measures over time. The band on the graphs shows the standard errors of the mean values. 7

PROGRAM 7 proc summary data = labdata; by labtest visit; var result; output out = means mean = mean stderr = stderr; data data4plot; set means; yerrorupper = mean + stderr; yerrorlower = mean - stderr; options nobyline; title "Mean Result Over Time by #byvar1 - #byval1"; proc sgplot data = data4plot; band x = visit lower = yerrorlower upper = yerrorupper / legendlabel = "+/- SEM" name = "band"; series x = visit y = mean / legendlabel = "Mean" name = "series"; keylegend "series" "band" / location = inside position = bottomleft; by labtest; xaxis values = (-6 to 105 by 7); FIGURE 7 8

EXAMPLE 8: BOX PLOTS Box and whisker plot will show central location and outliers of data, it s good for exploring the skewness of the data. Figure 8 shows the median, IQR, and range of laboratory test results of repeated measures over time. PROGRAM 8 options nobyline; title "Box Plots by #byvar1 - #byval1"; proc sgplot data = labdata; by labtest; vbox result / category = visit; FIGURE 8 EXAMPLE 9: SCATTER PLOTS A scatter plot can be used to display the relationship between two continuous variables. The relationship can be expressed with the use of regression line. As expected, Figure 9 shows a highly significant relationship between laboratory test results at baseline and study day 43 from baseline. PROGRAM 9 9

title "Relationship Between Baseline and Day 43"; proc sgscatter data = lab4plot; plot creatinine43*creatinine1 platelet43*platelet1 red_blood_cells43*red_blood_cells1 white_blood_cells43*white_blood_cells1/reg; FIGURE 9 CONCLUSION SAS/GRAPH SG procedures are exciting new functionalities provided by SAS 9.2. Simpler and minimal coding is required to generate high quality statistical graphs which are fully integrated with the Output Delivery System (ODS). By spending less time in coding to improve the visual appearance of graphs for laboratory data, we can focus more on the statistical analysis. REFERENCES SAS Institute, Inc. 2008. SAS/GRAPH 9.2: Statistical Graphics Procedures Guide. Cary, NC: SAS Institute, Inc. CONTACT INFORMATION I welcome and appreciate your comments and questions. Contact the author at: Wei Cheng, Isis Pharmaceuticals, Inc., 1896 Rutherford Rd., Carlsbad, CA 92008 (760) 603-3807 Email: wcheng@isisph.com SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. 10