A Plot & a Table per Page Times Hundreds in a Single PDF file

Similar documents
Innovative Graph for Comparing Central Tendencies and Spread at a Glance

Generating Participant Specific Figures Using SAS Graphic Procedures Carry Croghan and Marsha Morgan, EPA, Research Triangle Park, NC

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

A Juxtaposition of Tables and Graphs Using SAS /GRAPH Procedures

ODS LAYOUT is Like an Onion

Presentation Quality Graphics with SAS/GRAPH

Top Award and First Place Best Presentation of Data Lan Tran-La. Scios Nova, Inc. BLOOD PRESSURE AND HEART RATE vs TIME

Using MACRO and SAS/GRAPH to Efficiently Assess Distributions. Paul Walker, Capital One

Graphically Enhancing the Visual Presentation and Analysis of Univariate Data Using SAS Software

USING SAS PROC GREPLAY WITH ANNOTATE DATA SETS FOR EFFECTIVE MULTI-PANEL GRAPHICS Walter T. Morgan, R. J. Reynolds Tobacco Company ABSTRACT

PharmaSUG 2015 Paper PO03

MANAGING SAS/GRAPH DISPLAYS WITH THE GREPLAY PROCEDURE. Perry Watts IMS Health

The GSLIDE Procedure. Overview. About Text Slides CHAPTER 27

Developing a Dashboard to Aid in Effective Project Management

Displaying Multiple Graphs to Quickly Assess Patient Data Trends

Coders' Corner. Paper ABSTRACT GLOBAL STATEMENTS INTRODUCTION

Tips to Customize SAS/GRAPH... for Reluctant Beginners et al. Claudine Lougee, Dualenic, LLC, Glen Allen, VA

IMPROVING A GRAPH USING PROC GPLOT AND THE GOPTIONS STATEMENT

PharmaSUG 2012 Paper CC13

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

Effective Forecast Visualization With SAS/GRAPH Samuel T. Croker, Lexington, SC

INTRODUCTION TO THE SAS ANNOTATE FACILITY

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

How to annotate graphics

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

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

Focusing healthcare quality improvement dollars: Using SAS

UTILIZING SAS TO CREATE A PATIENT'S LIVER ENZYME PROFILE. Erik S. Larsen, Price Waterhouse LLP

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

PROC CATALOG, the Wish Book SAS Procedure Louise Hadden, Abt Associates Inc., Cambridge, MA

PharmaSUG Paper DG07

Chapter 1 Introduction. Chapter Contents

The GANNO Procedure. Overview CHAPTER 12

Week 05 Class Activities

Creating Maps in SAS/GRAPH

Figure 1. Paper Ring Charts. David Corliss, Marketing Associates, Bloomfield Hills, MI

SAS/GRAPH : Using the Annotate Facility

THE IMPACT OF DATA VISUALIZATION IN A STUDY OF CHRONIC DISEASE

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility

SAS Graphs in Small Multiples Andrea Wainwright-Zimmerman, Capital One, Richmond, VA

The GTESTIT Procedure

Changing Titles on Graphs With Minimal Processing

SparkLines Using SAS and JMP

Making Presentations More Fun with DATA Step Graphics Interface (DSGI) Hui-Ping Chen, Eli Lilly and Company, Indianapolis, Indiana

Using ANNOTATE MACROS as Shortcuts

Coders' Corner. Scaling Mount GCHART: Using a MACRO to Dynamically Reset the Scale Nina L. Werner, Dean Health Plan, Inc., Madison, WI.

Paper SIB-096. Richard A. DeVenezia, Independent Consultant, Remsen, NY

Modifying Graphics in SAS

The GIMPORT Procedure

Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS software. Lex Jansen NV Organon Oss, The Netherlands

PharmaSUG 2013 CC26 Automating the Labeling of X- Axis Sanjiv Ramalingam, Vertex Pharmaceuticals, Inc., Cambridge, MA

It s Not All Relative: SAS/Graph Annotate Coordinate Systems

Paper S Data Presentation 101: An Analyst s Perspective

Using SAS/GRAPH Software to Create Graphs on the Web Himesh Patel, SAS Institute Inc., Cary, NC Revised by David Caira, SAS Institute Inc.

TS-659: Exporting SAS/GRAPH Output to PDF Files from Release 8.2 and higher

Internet, Intranets, and The Web

SAS Graph: Introduction to the World of Boxplots Brian Spruell, Constella Group LLC, Durham, NC

ODS AND STATISTICAL GRAPHICS

Using Annotate Datasets to Enhance Charts of Data with Confidence Intervals: Data-Driven Graphical Presentation

Chapter 13 Introduction to Graphics Using SAS/GRAPH (Self-Study)

Create Flowcharts Using Annotate Facility. Priya Saradha & Gurubaran Veeravel

The Plot Thickens from PLOT to GPLOT

Converting Annotate to ODS Graphics. Is It Possible?

PharmaSUG Paper TT11

Move =(+0,+5): Making SAS/GRAPH Work For You

Presented by: Steve First 2997 Yarmouth Greenway Drive, Madison, WI Phone: (608) Web:

Picturing Statistics Diana Suhr, University of Northern Colorado

ABC s of Graphs in Version 8 Caroline Bahler, Meridian Software, Inc.

Using SAS Macro to Include Statistics Output in Clinical Trial Summary Table

ABSTRACT. The SAS/Graph Scatterplot Object. Introduction

INTRODUCTION TO SAS/GRAPH

Dynamic Macro Invocation Utility Paul D Sherman, San Jose, CA

A Generalized Procedure to Create SAS /Graph Error Bar Plots

Multiple Forest Plots and the SAS System

Creating Population Tree Charts (Using SAS/GRAPH Software) Robert E. Allison, Jr. and Dr. Moon W. Suh College of Textiles, N. C.

Paper Abstract. Introduction. SAS Version 7/8 Web Tools. Using ODS to Create HTML Formatted Output. Background

Paper CC16. William E Benjamin Jr, Owl Computer Consultancy LLC, Phoenix, AZ

Data Driven Annotations: An Introduction to SAS/GRAPH s Annotate Facility

Taming the Box Plot. Sanjiv Ramalingam, Octagon Research Solutions, Inc., Wayne, PA

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

Building an Automated Data Management, Analysis and Reporting Tool That Runs Against Pre-Processed Web Server Access Log File Data.

* builds the RGB color string from the color. * reads the red, green; and blue values for. * constructs an ANNOTATE dataset by

CHAPTER 1 Introduction to SAS/GRAPH Software

ABC Macro and Performance Chart with Benchmarks Annotation

An Introduction to PROC GREPLAY

Tips and Tricks in Creating Graphs Using PROC GPLOT

GENERATING SAS HARD COpy OUTPUT UNDER THE VMS N VAX ENVIRONMENT

Compute; Your Future with Proc Report

Usinq the VBAR and BBAR statements and the TEMPLATE Facility to Create side-by-side, Horizontal Bar Charts with Shared Vertical Axes Labels

A Stand-Alone SAS Annotate System for Figure Generation Brian Fairfield-Carter, PRA International, Victoria, BC

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

A Macro To Generate a Study Report Hany Aboutaleb, Biogen Idec, Cambridge, MA

Producing Publication Quality Business Graphs with SASIGRAPH Software

How to Make an Impressive Map of the United States with SAS/Graph for Beginners Sharon Avrunin-Becker, Westat, Rockville, MD

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

ABSTRACT INTRODUCTION SESUG RV

Essential ODS Techniques for Creating Reports in PDF Patrick Thornton, SRI International, Menlo Park, CA

Using Macros to Construct Overlaid Contour Plots For Response Surface Optimization

Custom Map Displays Created with SAS/GRAPH Procedures and the Annotate Facility Debra Miller, National Park Service, Denver, CO

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

Transcription:

A Plot & a Table per Page Times Hundreds in a Single PDF file Daniel Leprince DIEM Computing Services, Inc. Elizabeth Li DIEM Computing Services, Inc. SAS is a registered trademark or trademark of SAS Institute Inc. in the USA and other countries. indicates USA registration. Other brand and product names are registered trademarks or Trademarks of their respective companies.

Overview Present the code to produce a postscript (.pdf) file containing multiple pages of a plot and a table per page.

Introduction Exploration: In Windows environment, a figure and a table per spreadsheet page. Production: In SAS environment, a figure and a table per page times hundred pages in a file.

OTHER HORMONES MONITORED BESIDES SERUM TOTAL TESTOSTERONE (T) Subject: 1, Period: DAY 32 STime DTime (2) BT DHT DHTT E2 E2T FSH LH SHBG (HH)(1) (HH:%%) (3) (4) (5) (6) (7) (8) (9) (10) ------------------------------------------------------------------ 0 0.00 150 51 0.2056 2.3 0.0093 0.44 0.16 20 2 2.08 950 120 0.0986 3.1 0.0025 22 4 4.08 1376 244 0.1431 6.9 0.0040 21 6 6.08 723 144 0.1522 4.8 0.0051 20 24 24.12 217 98 0.2952 2.8 0.0084 21 (1) STime=> Scheduled time (2) DTime=> Postdose Draw Time (3) BT => Bioavailable T (ng/dl) (4) DHT => Dihydrotestosterone (DHT), Serum (ng/dl) (5) DHTT => DHT/T (6) E2 => Estradiol, Serum (ng/dl) (7) E2T => E2/T (8) FSH => Follicle Stimulating Hormone (FSH-ICMA) (miu/ml) (9) LH => Luteinizing Hormone (LH-ICMA) (miu/ml) (10) SHBG => Sex Hormone Binding Globulin (nmol/l)

Topics A Plot with Annotated Numbers and Statistics (gplot) A Table Reprinted as a Plot (gprint) Titles & Footnotes (gslide) A Page at a Time (greplay) Cleaning-Up (greplay) Creating the pdf file (Acrobat Distiller) Hardware Versus Software Fonts

Creating Do loop; proc sort data=pk out=doloop(keep=subjid period f_dose) nodupkey; by subjid period; run; data _null_; set doloop end=last; comb=trim(left(period)) subjid trim(left(f_dose)); call symput('combo' left(_n_),trim(comb)); if last then call symput('ncombo',left(_n_)); run; %macro doit; %do i=1 %to &ncombo; %if &i=1 %then %do; %let mode=replace; %end; %else %do; %let mode=append; %end; *** Extract Patient Identification Number ***; %let subjid=%substr(&&combo&i,2,7);

Creating the plot Plotting the 24 hours PK figure. In order to prevent the vertically compressed appearance, there is a need to define the vertical spread of the figure to 5 inches. goptions vsize=5.0 in; proc gplot data=pk; where subjid="&subjid" & period=. plot valuen*act_tim / vaxis=axis1 haxis=axis2 vref=(0) lvref=3 frame; format valuen 5.; run; quit;

X AXIS X axis and Symbol axis2 label=(justify=center f='helvetica' h=2.5pct "TIME ELAPSED IN HOURS") width=12 order=(0 to 32 by 4) major=(width=12 height=1.5) minor=(number=1 width=12) value=(height=2.5pct) offset=(3pct) length=80pct; Use a dot symbol and connect the points with a dotted line. symbol1 color=black interpol=join value=dot height=2 pct line=2 width=16;

Creating the annotated dataset: data anno; length text $5 style $12; retain function 'label' style "'Helvetica'" xsys ysys '2' hsys '1' size 3.9; set pk(keep=subjid period act_tim valuen smplhour); where subjid="&subjid" & period=. if smplhour~=0.5 then position='2'; else position='8'; x=act_tim; y=valuen; text=trim(left(put(valuen,5.))); output; run;

Creating the plot: Annotate in gplot proc gplot data=pk; where subjid="&subjid" & period=. plot valuen*act_tim / vaxis=axis1 haxis=axis2 vref=(0) vref=3 anno=anno frame; format valuen 5.; run; quit;

Calculating Statistics proc means data=pk noprint; where subjid="&subjid" & period=. var valuen; output out=stats min=min max=max median=median; run; data _null_; set stats; call symput('cmin',trim(left(put(min,8.)))); call symput('cmax',trim(left(put(max,8.)))); call symput('median',trim(left(put(median,8.)))); run;

Creating the plot: Adding Notes proc gplot data=pk; where subjid="&subjid" & period=. plot valuen*act_tim / vaxis=axis1 haxis=axis2 vref=(0) lvref=3 anno=anno frame; note move=(80.5,81) h=2.5pct "Cmin =&cmin"; note move=(80.5,77) h=2.5pct "Cmax=&cmax"; note move=(80.5,73) h=2.5pct "Cmedian=&median"; format valuen 5.; run; quit;

Adding a Table OTHER HORMONES MONITORED BESIDES SERUM TOTAL TESTOSTERONE (T) Subject: 1, Period: DAY 32 STime DTime (2) BT DHT DHTT E2 E2T FSH LH SHBG (HH)(1) (HH:%%) (3) (4) (5) (6) (7) (8) (9) (10) ------------------------------------------------------------------ 0 0.00 150 51 0.2056 2.3 0.0093 0.44 0.16 20 2 2.08 950 120 0.0986 3.1 0.0025 22 4 4.08 1376 244 0.1431 6.9 0.0040 21 6 6.08 723 144 0.1522 4.8 0.0051 20 24 24.12 217 98 0.2952 2.8 0.0084 21 (1) STime=> Scheduled time (2) DTime=> Postdose Draw Time (3) BT => Bioavailable T (ng/dl) (4) DHT => Dihydrotestosterone (DHT), Serum (ng/dl) (5) DHTT => DHT/T (6) E2 => Estradiol, Serum (ng/dl) (7) E2T => E2/T (8) FSH => Follicle Stimulating Hormone (FSH-ICMA) (miu/ml) (9) LH => Luteinizing Hormone (LH-ICMA) (miu/ml) (10) SHBG => Sex Hormone Binding Globulin (nmol/l)

GPRINT: Saving a Table as a Plot filename tabletmp "&rtfdir.temphorm.lst"; proc printto new file=tabletmp; run; Title1 ABC ; Footnote1 XYZ ; Proc report ; run; proc printto; run; Define 60 columns and 30 rows for the output to be incorporated into gprint goptions hpos=60 vpos=30 ftext='courier' htext=2.8; Prevent a repeat of titles & footnotes in the table. title; footnote; Incorporate the table into a figure. proc gprint fileref=tabletmp ctext=black; run; quit;

GSLIDE: Titles and Footnotes goptions rotate=portrait ftext='helvetica' htext=2.5 nodisplay device=ps1200 gunit=pct; proc gslide; title1 j=c h=1.60 f='helvetica' 'Serum '; title2 j=c h=1.60 f='helvetica' "Study &protocol. Subject &subject, Period=&tperiod, Final Dose: &f_dose unit"; Define program, location, running date and page X of Y values. footnote j=l h=1.0 f='courier' "%str(&pgmid..sas Date: &sysdate)" j=r "Page &i of &ncombo"; run; quit;

OUTPUT: Postscript file Create a single postscript file. Use a high resolution postscript device (ps1200). filename gsasfile "&rtfdir.&pgmid..ps"; goptions reset=all htext=3 rotate=portrait device=ps1200 ftext='helvetica' colors=(black) cback=white gunit=pct gsfmode=&mode gsfname=gsasfile vsize=9.25 in hsize=7.0 in horigin=.95 in vorigin=.78 in display;

GREPLAY: Replaying Titles, Figure & Table The greplay code define the size and location of each unit and their order of appearance in each page. proc greplay igout=gseg nofs tc=cat1x2; tdef lab1x2 1/ ulx=0 uly=100 urx=100 ury=100 llx=0 lly= 0 lrx=100 lry= 0 2/ ulx=0 uly=92 urx=100 ury=92 llx=0 lly=46 lrx=100 lry=46 3/ ulx=5 uly=44 urx=100 ury=44 llx=5 lly= 0 lrx=100 lry= 0; template lab1x2; treplay 1:gslide 2:gplot 3:gprint; run; quit;

GREPLAY: Cleaning Up If this program is run in interactive mode and hundreds of plots are created, it is recommended to clean up the catalog containing the figures after each iteration. proc greplay igout=gseg nofs; delete _all_; run; quit; %end; %mend doit; %doit; End the do loop.

Translating Postscript (PS) to PDF file Distill PS file to pdf file Adobe Acrobat Distiller. Set Settings/Job Options/General/Default Page Size/ Width=> 612.0 and Height to 792 points. Drop PS file on Adobe Acrobat Distiller Icon or Double click on your postscript file. A new file with pdf extension will be created. PDF files are less than ~40% size of postscript file.

Hardware fonts SAVE SPACE and RUNNING TIME: For a 700 pages output: PS => PDF 18X (94%) reduction in file size (92MB => 4.5MB) ALLOW SEARCH FUNCTION Allow Use of Search Function in Acrobat Reader To List Available Hardware Fonts for a Given SAS Provided Device: Proc gdevice c=sashelp.devices nofs; list DeviceDriverName; * ex. list ps1200; run; quit;

General Considerations Extensive Data Validation Graphic displays are data driven and unforgiving for outliers, missing values, and data entry errors. Add %Put statement to identify values of macro variables for debugging and identification of problem data. (Even if mprint mlogic symbolgen turned off, LOG still > 3MB!) Programming Standard: The SAS program contains one single standard to produce all outputs. (Important for validation purposes).

Conclusion SAS Graph possess all the procedures to produce a A Plot and a Table per Page Times Hundreds in a Single File. Adobe Acrobat Distiller allows to distill a postscript (ps) file into a pdf file. Hardware fonts save storage space, running time and allow the use of search functions in pdf format.

Acknowledgements SAS Institute Technical Support

About the Speaker Name Title Daniel Leprince President Location of company DIEM Computing Services, 38851 Litchfield Circle Fremont, CA 94536 Telephone Fax (510) 744-1304 (510) 744-1412 E-Mail dleprince@diemcomputing.com