An Efficient Method to Create Titles for Multiple Clinical Reports Using Proc Format within A Do Loop Youying Yu, PharmaNet/i3, West Chester, Ohio

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

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

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

Quick and Efficient Way to Check the Transferred Data Divyaja Padamati, Eliassen Group Inc., North Carolina.

PharmaSUG Paper PO10

Sorting big datasets. Do we really need it? Daniil Shliakhov, Experis Clinical, Kharkiv, Ukraine

Run your reports through that last loop to standardize the presentation attributes

Basic SAS Hash Programming Techniques Applied in Our Daily Work in Clinical Trials Data Analysis

Create a Format from a SAS Data Set Ruth Marisol Rivera, i3 Statprobe, Mexico City, Mexico

Creating output datasets using SQL (Structured Query Language) only Andrii Stakhniv, Experis Clinical, Ukraine

PharmaSUG China. model to include all potential prognostic factors and exploratory variables, 2) select covariates which are significant at

Quick Data Definitions Using SQL, REPORT and PRINT Procedures Bradford J. Danner, PharmaNet/i3, Tennessee

Paper An Automated Reporting Macro to Create Cell Index An Enhanced Revisit. Shi-Tao Yeh, GlaxoSmithKline, King of Prussia, PA

Data Quality Review for Missing Values and Outliers

A Few Quick and Efficient Ways to Compare Data

A Practical and Efficient Approach in Generating AE (Adverse Events) Tables within a Clinical Study Environment

The Power of Combining Data with the PROC SQL

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

A SAS Macro for Generating Informative Cumulative/Point-wise Bar Charts

A Breeze through SAS options to Enter a Zero-filled row Kajal Tahiliani, ICON Clinical Research, Warrington, PA

Clinical Data Visualization using TIBCO Spotfire and SAS

PharmaSUG Paper TT11

SAS Macros for Grouping Count and Its Application to Enhance Your Reports

Give me EVERYTHING! A macro to combine the CONTENTS procedure output and formats. Lynn Mullins, PPD, Cincinnati, Ohio

PharmaSUG Paper AD06

PharmaSUG China Paper 70

Data Edit-checks Integration using ODS Tagset Niraj J. Pandya, Element Technologies Inc., NJ Vinodh Paida, Impressive Systems Inc.

Developing Data-Driven SAS Programs Using Proc Contents

PharmaSUG China

PharmaSUG Paper PO12

Get into the Groove with %SYSFUNC: Generalizing SAS Macros with Conditionally Executed Code

%ANYTL: A Versatile Table/Listing Macro

There s No Such Thing as Normal Clinical Trials Data, or Is There? Daphne Ewing, Octagon Research Solutions, Inc., Wayne, PA

Paper CT-16 Manage Hierarchical or Associated Data with the RETAIN Statement Alan R. Mann, Independent Consultant, Harpers Ferry, WV

PharmaSUG Paper CC02

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility

A SAS Solution to Create a Weekly Format Susan Bakken, Aimia, Plymouth, MN

Files Arriving at an Inconvenient Time? Let SAS Process Your Files with FILEEXIST While You Sleep

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

PharmaSUG China. Systematically Reordering Axis Major Tick Values in SAS Graph Brian Shen, PPDI, ShangHai

One Project, Two Teams: The Unblind Leading the Blind

EXAMPLES OF DATA LISTINGS AND CLINICAL SUMMARY TABLES USING PROC REPORT'S BATCH LANGUAGE

Advanced Visualization using TIBCO Spotfire and SAS

Creating an ADaM Data Set for Correlation Analyses

An Alternate Way to Create the Standard SDTM Domains

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

STEP 1 - /*******************************/ /* Manipulate the data files */ /*******************************/ <<SAS DATA statements>>

Macros for Two-Sample Hypothesis Tests Jinson J. Erinjeri, D.K. Shifflet and Associates Ltd., McLean, VA

Summary Table for Displaying Results of a Logistic Regression Analysis

Reducing SAS Dataset Merges with Data Driven Formats

What Do You Mean My CSV Doesn t Match My SAS Dataset?

Get Started Writing SAS Macros Luisa Hartman, Jane Liao, Merck Sharp & Dohme Corp.

A Format to Make the _TYPE_ Field of PROC MEANS Easier to Interpret Matt Pettis, Thomson West, Eagan, MN

An Efficient Tool for Clinical Data Check

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

Using GSUBMIT command to customize the interface in SAS Xin Wang, Fountain Medical Technology Co., ltd, Nanjing, China

Want to Do a Better Job? - Select Appropriate Statistical Analysis in Healthcare Research

Making a List, Checking it Twice (Part 1): Techniques for Specifying and Validating Analysis Datasets

Submitting SAS Code On The Side

PharmaSUG Paper SP04

Regaining Some Control Over ODS RTF Pagination When Using Proc Report Gary E. Moore, Moore Computing Services, Inc., Little Rock, Arkansas

Quality Control of Clinical Data Listings with Proc Compare

Planting Your Rows: Using SAS Formats to Make the Generation of Zero- Filled Rows in Tables Less Thorny

Real Time Clinical Trial Oversight with SAS

PharmaSUG Paper CC11

A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY

PharmaSUG China 2018 Paper AD-62

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

Paper PO06. Building Dynamic Informats and Formats

Displaying Multiple Graphs to Quickly Assess Patient Data Trends

Summarizing Impossibly Large SAS Data Sets For the Data Warehouse Server Using Horizontal Summarization

PDF Multi-Level Bookmarks via SAS

PhUse Practical Uses of the DOW Loop in Pharmaceutical Programming Richard Read Allen, Peak Statistical Services, Evergreen, CO, USA

Keeping Track of Database Changes During Database Lock

A Tool to Compare Different Data Transfers Jun Wang, FMD K&L, Inc., Nanjing, China

PharmaSUG China Paper 059

Are Your SAS Programs Running You? Marje Fecht, Prowerk Consulting, Cape Coral, FL Larry Stewart, SAS Institute Inc., Cary, NC

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

Using PROC SQL to Generate Shift Tables More Efficiently

Not Just Merge - Complex Derivation Made Easy by Hash Object

PROC REPORT AN INTRODUCTION

PharmaSUG 2012 Paper CC13

Cover the Basics, Tool for structuring data checking with SAS Ole Zester, Novo Nordisk, Denmark

A Generalized Procedure to Create SAS /Graph Error Bar Plots

One-Step Change from Baseline Calculations

Compute; Your Future with Proc Report

Let SAS Write and Execute Your Data-Driven SAS Code

A Macro to Manage Table Templates Mark Mihalyo, Community Care Behavioral Health Organization, Pittsburgh, PA

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

Checking for Duplicates Wendi L. Wright

Simplifying Your %DO Loop with CALL EXECUTE Arthur Li, City of Hope National Medical Center, Duarte, CA

Using SAS Macros to Extract P-values from PROC FREQ

PROC FORMAT: USE OF THE CNTLIN OPTION FOR EFFICIENT PROGRAMMING

PharmaSUG Paper IB11

Internal Consistency and the Repeat-TFL Paradigm: When, Why and How to Generate Repeat Tables/Figures/Listings from Single Programs

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

Journey to the center of the earth Deep understanding of SAS language processing mechanism Di Chen, SAS Beijing R&D, Beijing, China

Practical Uses of the DOW Loop Richard Read Allen, Peak Statistical Services, Evergreen, CO

Reverse-engineer a Reference Curve: Capturing Tabular Data from Graphical Output Brian Fairfield-Carter, ICON Clinical Research, Redwood City, CA

A Macro to Create Program Inventory for Analysis Data Reviewer s Guide Xianhua (Allen) Zeng, PAREXEL International, Shanghai, China

Transcription:

PharmaSUG 2012 - Paper CC12 An Efficient Method to Create Titles for Multiple Clinical Reports Using Proc Format within A Do Loop Youying Yu, PharmaNet/i3, West Chester, Ohio ABSTRACT Do you know how to create titles for multiple clinical reports directly from data using SAS PROC FORMAT within a Do loop? When we work with clinical efficacy data, we often have the total score and sub item score. Sometimes, the efficacy data contains up to 50+ sub items. Each item and total score will go through the same analysis and get outputs from the statistical models. Then, tables are put into one file with one item per page. Traditionally, we create macro using hard coding via macro parameter for the title of the parameter description in each table. However, there is a more efficient way to do this. We can use proc format from the data to create the title of the parameter description for each item table automatically within a Do loop. Using this method, we can avoid hard coding or possible typos in the titles. This paper introduces how to utilize this tip and trick. INTRODUCTION Why do we need to avoid hard coding to create titles for multiple reports? When we create only one report or graph, it is easy for us to just type the title before PROC REPORT or PROC GPLOTS statement. But in the NDA submission, we often are asked to create multiple reports repeatedly for different parameters that go through the same statistical analysis. In those situations, we need to create a title for every parameter in each table or graph. We can accomplish this by typing the title for each table, but this takes a lot of time to complete. Additionally, the potential for typos is higher because there are many titles to type. PARAMETER_CD PARAMETER_Details STAT TRT1 TRT2 VAR_ORD ITEM1 AAAAAA n 102 102 1 ITEM1 AAAAAA lsm 0.23 0.40 2 ITEM1 AAAAAA ci (0.15, 0.31) (0.32,0.48) 4 ITEM1 AAAAAA se 0.05 0.05 5 ITEM2 BBBBBB n 102 102 1 ITEM2 BBBBBB lsm 0.23 0.40 2 ITEM2 BBBBBB ci (0.15, 0.31) (0.32, 0.48) 4 ITEM2 BBBBBB se 0.05 0.05 5. ITEM9 FFFFFFF n xxx xxx 1 ITEM9 FFFFFFF lsm x.xx x.xx 2 ITEM9 FFFFFFF ci (x.xx-x.xx) (x.xx-x.xx) 4 ITEM9 FFFFFFF se xx.x xx.x 5 Table1. Example data FINAL 1

THE TYPING METHOD FOR THE REPORT TITLES BY USING MACRO PARAMTERS ***********************************************; ** macro parameters: **; ** datain - Input data **; ** title - The title for the parameter **; ** item - Item code **; ***********************************************; %macro report(datain=, title=, item=); data report; set &datain; where PARAMETER_CD = &item ; title1 Summary of Mean Change from Baseline in Treatment Period ; title2 Efficacy parameter: &title ; PROC REPORT DATA=report HEADLINE HEADSKIP SPLIT = '#' ; COLUMNS ( '--' var_ord ("Actual treatment Period" "--" TRT1 TRT2) ); ; %mend report; %report(datain=final, title=aaaaaa, item=item1); %report(datain=final, title=bbbbbb, item=item2); ; ; %report(datain=final, title=fffffff, item=item9; AN EFFICIENT METHOD TO CREATE TITLES FOR MULTIPLE REPORTS OR GRAPHS When we work on multiple parameters with similar outputs, each parameter will be put in a table, and the parameter description should be created for each table at the title. This method of creating title for each report is more efficient, and also eliminates the potential for typos. This method includes four steps: STEP 1: CREATE DESCRIPTION OF PARAMETER USING PROC FREQ FROM DATA Most clinical trial data contains variable parameter code and details. Each parameter code has a descriptive variable to explain the content of parameter (e.g. efficacy item code with item content, or lab test code with lab test name, etc.) We use table 1 data as our example. There are variables PARAMETER_CD and PARAMETER_Details in the data. We can use PROC FREQ to create a dataset called PARA_DATA, and then create a numeric order variable for each parameter: Proc freq data=final noprint; Tables PARAMETER_CD*PARAMETER_Details /out=para_data(keep= PARAMETER_CD PARAMETER_Details); Proc sort data=para_data; by PARAMETER_CD PARAMETER_Details; 2

********************************************************; *** Create a numeric order variable for each parameter**; ********************************************************; Data para_data; PARAMETER_order=_n_; PARAMETER_CD PARAMETER_Details PARAMETER_order ITEM1 AAAAAA 1 ITEM2 BBBBBB 2 ITEM3 CCCCCC 3 ITEM4 DDDDDD 4 ITEM5 EEEEEE 5 ITEM6 FFFFFFF 6 ITEM7 GGGGG 7 ITEM8 HHHHHH 8 ITEM9 FFFFFFF 9 Table 2. Data PARA_DATA SETP 2: THE FORMAT DATA SHOULD CONTAIN VARIABLE START, LABEL, AND FMTNAME The data that is put into proc format should contain variable START, LABEL, and FMTNAME. The codes below create the FORMAT data from DATA PARA_DATA. data itemlnm; length label $50.; start=parameter_order; label=parameter_details; Fmtname='itemn'; keep start label fmtname; STEP 3: USE THE OPTION CNTLIN IN PROC FORMAT TO CREATE SAS FORMAT proc format cntlin=itemlnm library=work; STEP4: USING A DO LOOP TO CRATE MULTIPLE REPORTS a. Merge data PARA_DATA with data FINAL by PARAMETER_CD and PARAMETER_Details data final; merge final para_data; by PARAMETER_CD PARAMETER_Details; 3

b. Use the macro for the Do loop to create reports: %macro rpt; ****Create a macro variable for the maximum of item number*****; data _null_; call symput('parameternmax', trim(left(put(_n_, 6.0)))); %put &parameternmax; ***** a Do loop for the report where item from 1 to maximum ***; ***** number of items ***; %do item_order=1 %to &parameternmax; Data report&item_order; set final; Where PARAMETER_order=&item_order; ****Use SAS format, %SYSFUNC, and PUTN within a Do loop to ***; ****create a macro variable for each parameter description ***; ****at title for the reports ***; ****The format itemn is created from STEP 2 and 3 ***; %let itemname=%sysfunc(putn(&item_order, itemn.)); %put &itemname; TITLE1 "Summary of Mean Change from Baseline in Treatment Period"; TITLE2 "Patient Population"; PROC REPORT DATA=report&item_order HEADLINE HEADSKIP SPLIT = '#' ; COLUMNS (var_ord ("Actual Treatment Period" "--" TRT1 TRT2)); DEFINE var_ord/ DISPLAY WIDTH=25 ' ' left format=varord. flow; DEFINE trt1 / DISPLAY WIDTH=15 "Treatment1" left; DEFINE trt2 / DISPLAY WIDTH=15 "Treatment2" left; compute before _page_; line @2 130*'-'; line @2 "Efficacy Parameter: &itemname"; endcomp; %end; %mend rpt; *****************************; *** Invoke macro RPT ***; *****************************; %rpt; 4

Summary of Mean Change from Baseline in Treatment Period Patient Population ------------------------------------------------------------------------------------------------------------------------------------------------------------------- Efficacy Parameter: AAAAA Actual Treatment Period ------------------------------------------------------------------ Treatment1 Treatment2 ----------------------------------------------------------------------------------------------------------------------------------------------------------------- Sample Size 102 102 Least Squares Means 0.23 0.40 90% Confidence Interval (0.15, 0.31) (0.32, 0.48) Standard Error 0.05 0.05 Output1. Report for First Item from the Macro above CONCLUSION Compared with the traditional method of typing the title in each output, we can create titles more efficiently and accurately for reports using the method introduced in this paper. The main benefits of using this method are as follows: i. Saves time: The Do loop creates the report with the title automatically. ii. iii. Avoids typos and ensures accuracy: The title or descriptive label for the Item created from data directly. Versatile and useful in many situations: Since the title is created in a macro variable, it is easy to use this macro variable everywhere in tables, listings or graphs. REFERENCES SAS OnlineDoc 9.1 at http://support.sas.com/91doc/docmainpage.jsp: Base SAS Procedures Guide, SAS Macro Language: Reference, SAS Institute Inc. Cary, NC CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Name: Youying Yu Enterprise: PharmaNet/i3 Address: 9050 Centre Pointe Drive #400 City, State ZIP: West Chester, Ohio 45089 Work Phone: 513-603-6721 Fax: 513-603-6277 E-mail: yyu@pharmanet-i3.com Web: www.pharmanet-i3.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. Other brand and product names are trademarks of their respective companies. 5