Using PROC REPORT to Cross-Tabulate Multiple Response Items Patrick Thornton, SRI International, Menlo Park, CA

Size: px
Start display at page:

Download "Using PROC REPORT to Cross-Tabulate Multiple Response Items Patrick Thornton, SRI International, Menlo Park, CA"

Transcription

1 Using PROC REPORT to Cross-Tabulate Multiple Response Items Patrick Thornton, SRI International, Menlo Park, CA ABSTRACT This paper describes for an intermediate SAS user the use of PROC REPORT to create a cross tabulation of a multiple response item. Surveys often contain multiple response items, such as services received where a respondent may have received more than one service. In this case, an indicator variable (1=Yes, 0=No) is created for each response category. This paper shows how to include all the indicator variables and a grouping variable in a PROC REPORT in order to calculate the number of responses per category overall and by group. It also demonstrates how PROC REPORT may be used to calculate the percent of responses out of the number of observations, rather than out of the total number of responses. A macro program is also included that makes easy the generation of PROC REPORT syntax for the purpose of reporting multiple response items. INTRODUCTION Multiple response items are common in survey research. Often called choose all or pick any items, the categories of the items are not mutually exclusive, so respondents may choose 1 to the number of item categories. The example item used in this paper will be services received, where a respondent may indicate Yes to more than one of 3 categories (Figure 1): Figure 1 Example Multiple Response Item 1. What services were provided to the child over the last 6-months (Circle Yes or No)? Yes No Child Health Insurance (CHI) Yes No Home Visitation (HV) Yes No Therapeutic Services (TS) When the responses to item 1 are stored as data, an indicator variable in is created for each category of service, where 1 = Yes and 0 = No (Figure 2). Figure 2 Example Data Set Child Referral CHI HV TS Figure 2 shows two common occurrences in this type of data: respondents may leave blank those service categories they did not receive and respondents may not provide a response to any of the service categories. In this example, it is reasonable to count the non-response for child number 2 on CHI as a No because there is at least one valid response (0 or 1) on one of the other service indicators. On the other hand, child number 5 should be excluded for non-response because it is not clear that the respondent considered the item. Figure 3 shows an example tabulation of the service item that excludes child number 5 and includes all 3 service indicators and the grouping variable REFERRAL: Figure 3 Service Item Cross Tabulation The table shows by REFERRAL (e.g. Referral One) the: Number of children receiving a service Number of children receiving each service (e.g. CHI) Percent of children receiving each service (e.g. HV) Number of services provided The table also shows the total count of: Children receiving at least one service Children receiving each service Services received This paper describes step by step the PROC REPORT syntax used to create a cross tabulation similar to Figure 3.

2 STEP BY STEP: CREATING A CROSS TABULATION FOR A MULTIPLE RESPONSE ITEM This section shows in 3 progressive phases the PROC REPORT syntax for creating a cross tabulation, similar to Figure 3: (a) phase 1 shows syntax to produce the first two columns in Figure 3, Referral and Children, (b) phase 2 calculates the total count of OBS and adds then Total label to the summary row, (c) phase 3 demonstrates how to get the count and percent of children receiving a service and then how to create the last column of total services. The description of each phase is on the left. The syntax and resulting output are shown in figures on the right. Phase 1: Description and syntax (Figure 4) to obtain the distinct values of referral and count of OBS (Figure 5) Description of Syntax NOWD prevents the interactive window and MISSING includes OBS that might be missing a value on REFERRAL COL determines the order of columns, REFERRAL and the key word N to obtain the count of OBS DEFINE is used to obtain the distinct values of REFERRAL by using the /GROUP option Figure 4. Phase 1 Syntax proc report data=work.multir nowd missing; col referral n; define referral /group center; define n / Children center; where chi ne. or hv ne. or ts ne. ; Figure 5. Phase 1 Output DEFINE N is used to label and center the column WHERE removes OBS missing on all multiple response item variables Phase 2: Description and syntax (Figure 6) to add the total OBS as shown in Figure 7 Description of Syntax Total OBS is added with the RBREAK AFTER statement using the option /SUMMARIZE Syntax to create Total label: Adds DUMROW, a computed variable not in the data set Hides the REFERRAL variable Defines DUMROW as COMPUTED Begins a compute block-- COMPUTE to ENDCOMP to define DUMROW as a 15 character variable Figure 6. Phase 2 Syntax proc report data=work.multir missing nowd; col referral dumrow n; define referral /group noprint; define n / Children center; define dumrow/computed "Referral"; compute dumrow /char length=15; if _BREAK_="_RBREAK_" then dumrow = 'Total'; else dumrow = put(referral,myrows.); rbreak after / summarize; where chi ne. or hv ne. or ts ne. ; Figure 7. Phase 2 Output Uses the special variable _BREAK_ to test for the last row created by the RBREAK statement and set DUMROW equal to Total, otherwise DUMROW is set to the formatted value of REFERRAL.

3 Phase 3: Description of Syntax (Figure 8) to obtain count of service (Figure 9) Figure 8. Phase 3 Syntax proc report data=work.multir missing nowd; col referral dumrow n chi p1 hv p2 ts p3 total; define referral /group noprint; define n / "Children" center; define dumrow /computed "Referral"; define chi / analysis "CHI" sum format=5.0 center; define p1 /computed "%" format=percent8.1 center ; define hv / analysis "HV" sum format=5.0 center; define p2 /computed "%" format=percent8.1 center ; define ts / analysis "TS" sum format=5.0 center; define p3 /computed "%" format=percent8.1 center ; define total/computed "Services" width=10 center; compute dumrow /char length=15; if _BREAK_="_RBREAK_" then dumrow = 'Total'; else dumrow = put(referral,myrows.); compute p1; p1 = chi.sum /n; compute p2; P2 = hv.sum /n; compute p3; p3 = ts.sum /n; compute total; total = sum(chi.sum,hv.sum,ts.sum); rbreak after / summarize; where chi ne. or hv ne. or ts ne. ; Figure 9. Phase 3 Output CHI is listed in the COL statement and defined as an ANALYSIS variable of type SUM. Since CHI is coded 1=Yes, 0=No, the sum of CHI is the count of Yes. P1 is listed in the COL statement and is defined as COMPUTED P1 is computed as the proportion of the sum of CHI and n The syntax shown in through was also added for each of the other two indicator variables, HV and TS. Total was added to the COL statement and computed as the sum of the sum of each indicator variable

4 MACRO FOR GENERATING PROC REPORT SYNTAX The macro CHOOSEALL is used to generated the PROC REPORT syntax to create a cross tabulation of a multiple response item. This macro is particularly helpful in cases where there are many categories of response and therefore many indicator variables. %macro chooseall(lib,d,row,rowlabel,rowformat,obslabel,totallabel,series,labels); %let vargroup =; %let define =; %let definep =; %let computedp =; %let total=; %let where=; %*Iterate through each variable in series; %let i = 1; %do %until(%scan(&series,&i)= &i > 50); %let var = %scan(&series,&i); %let label = %scan(&labels,&i,%str(^)); %*[1 COLUMN STATEMENT MULTIPLE RESPONSE VARIABLES AND PERCENTS]; %let vargroup = &vargroup &var p&i; %*[2 DEFINE EACH MULTIPLE RESPONSE VARIABLE ]; %let define =&define define &var / analysis sum "&label" format=5.0 center%str(;); %*[3 DEFINE EACH PERCENT]; %let definep = &definep define p&i /computed "%" format=percent8.1 center %str(;); %*[4 COMPUTE EACH PERCENT]; %let computedp = &computedp compute p&i%str(;) p&i %str(=) &var..sum /n%str(;)endcomp%str(;); %* [5 COMPUTE TOTAL]; %let total= &total &var..sum %str(,); %* [6 CREATE A WHERE STATEMENT]; %let where = &where &var ne %str(.) or; %let i = %eval(&i + 1); %end; %*Remove the comma and the OR at the end; %let total = %substr(&total,1,%eval(%length(&total) - 1)); %let where = %substr(&where,1,%eval(%length(&where) - 2)); proc report data=&lib..&d missing nowd; col &row newcol n &vargroup total; define &row /group left width=15 flow noprint; define newcol /computed "&rowlabel" id; define n/format=8.0 "&obslabel" center; &define &definep define total/computed "&totallabel" width=10 center; compute newcol /char length=15; IF _BREAK_='_RBREAK_' THEN newcol = 'Total'; else newcol = put(&row,&rowformat..); &computedp compute total; total = sum(&total); rbreak after /summarize; where &where ; %mend; options mprint; %chooseall(work,multir,referral,referral,myrows,children,services,chi HV TS,CHI^HV^TS);

5 CONCLUSION PROC REPORT is capable of creating a concise cross tabulation of a multiple response item. If each category of response on the item is stored as an indicator variable (1=Yes, 0=No), then the sum of each indicator variable will be the count of Yes s and these counts may be created by levels of a grouping variable and in total. Percent of Yes out of the possible Yes s (OBS) may be obtained through the use of a COMPUTE block. Observations appropriate as a denominator for the percents may be selected through the use of a WHERE statement. The PROC REPORT syntax is quite long, especially as the response categories increase, so a macro program is included which may be called to generate the syntax. RECOMMENDED READING Carpenter, A. (2007). Carpenter s Complete Guide to the SAS REPORT Procedure. Cary, NC: SAS Institute Inc. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: S. Patrick Thornton Ph.D., Sr. Scientific Programmer/Analyst SRI International, Center for Education and Human Services Phone: Fax: patrick.thornton@sri.com Web: 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.

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

Essential ODS Techniques for Creating Reports in PDF Patrick Thornton, SRI International, Menlo Park, CA Thornton, S. P. (2006). Essential ODS techniques for creating reports in PDF. Paper presented at the Fourteenth Annual Western Users of the SAS Software Conference, Irvine, CA. Essential ODS Techniques

More information

PROC REPORT Basics: Getting Started with the Primary Statements

PROC REPORT Basics: Getting Started with the Primary Statements Paper HOW07 PROC REPORT Basics: Getting Started with the Primary Statements Arthur L. Carpenter California Occidental Consultants, Oceanside, California ABSTRACT The presentation of data is an essential

More information

ABSTRACT INTRODUCTION PROBLEM: TOO MUCH INFORMATION? math nrt scr. ID School Grade Gender Ethnicity read nrt scr

ABSTRACT INTRODUCTION PROBLEM: TOO MUCH INFORMATION? math nrt scr. ID School Grade Gender Ethnicity read nrt scr ABSTRACT A strategy for understanding your data: Binary Flags and PROC MEANS Glen Masuda, SRI International, Menlo Park, CA Tejaswini Tiruke, SRI International, Menlo Park, CA Many times projects have

More information

PROC MEANS for Disaggregating Statistics in SAS : One Input Data Set and One Output Data Set with Everything You Need

PROC MEANS for Disaggregating Statistics in SAS : One Input Data Set and One Output Data Set with Everything You Need ABSTRACT Paper PO 133 PROC MEANS for Disaggregating Statistics in SAS : One Input Data Set and One Output Data Set with Everything You Need Imelda C. Go, South Carolina Department of Education, Columbia,

More information

Compute Blocks in Report

Compute Blocks in Report Compute Blocks in Report Compute Blocks Though it is always possible to compute new variables inside a data step, PROC REPORT allows for similar computations to be done internally as well. Computations

More information

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

A Practical and Efficient Approach in Generating AE (Adverse Events) Tables within a Clinical Study Environment A Practical and Efficient Approach in Generating AE (Adverse Events) Tables within a Clinical Study Environment Abstract Jiannan Hu Vertex Pharmaceuticals, Inc. When a clinical trial is at the stage of

More information

The REPORT Procedure: A Primer for the Compute Block

The REPORT Procedure: A Primer for the Compute Block Paper TT15-SAS The REPORT Procedure: A Primer for the Compute Block Jane Eslinger, SAS Institute Inc. ABSTRACT It is well-known in the world of SAS programming that the REPORT procedure is one of the best

More information

Advanced PROC REPORT: Getting Your Tables Connected Using Links

Advanced PROC REPORT: Getting Your Tables Connected Using Links Advanced PROC REPORT: Getting Your Tables Connected Using Links Arthur L. Carpenter California Occidental Consultants ABSTRACT Gone are the days of strictly paper reports. Increasingly we are being asked

More information

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

A Format to Make the _TYPE_ Field of PROC MEANS Easier to Interpret Matt Pettis, Thomson West, Eagan, MN Paper 045-29 A Format to Make the _TYPE_ Field of PROC MEANS Easier to Interpret Matt Pettis, Thomson West, Eagan, MN ABSTRACT: PROC MEANS analyzes datasets according to the variables listed in its Class

More information

Advanced PROC REPORT: Doing More in the Compute Block

Advanced PROC REPORT: Doing More in the Compute Block Paper TU02 Advanced PROC REPORT: Doing More in the Compute Block Arthur L. Carpenter California Occidental Consultants ABSTRACT One of the unique features of the REPORT procedure is the Compute Block.

More information

footnote1 height=8pt j=l "(Rev. &sysdate)" j=c "{\b\ Page}{\field{\*\fldinst {\b\i PAGE}}}";

footnote1 height=8pt j=l (Rev. &sysdate) j=c {\b\ Page}{\field{\*\fldinst {\b\i PAGE}}}; Producing an Automated Data Dictionary as an RTF File (or a Topic to Bring Up at a Party If You Want to Be Left Alone) Cyndi Williamson, SRI International, Menlo Park, CA ABSTRACT Data dictionaries are

More information

CMISS the SAS Function You May Have Been MISSING Mira Shapiro, Analytic Designers LLC, Bethesda, MD

CMISS the SAS Function You May Have Been MISSING Mira Shapiro, Analytic Designers LLC, Bethesda, MD ABSTRACT SESUG 2016 - RV-201 CMISS the SAS Function You May Have Been MISSING Mira Shapiro, Analytic Designers LLC, Bethesda, MD Those of us who have been using SAS for more than a few years often rely

More information

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

There s No Such Thing as Normal Clinical Trials Data, or Is There? Daphne Ewing, Octagon Research Solutions, Inc., Wayne, PA Paper HW04 There s No Such Thing as Normal Clinical Trials Data, or Is There? Daphne Ewing, Octagon Research Solutions, Inc., Wayne, PA ABSTRACT Clinical Trials data comes in all shapes and sizes depending

More information

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

Square Peg, Square Hole Getting Tables to Fit on Slides in the ODS Destination for PowerPoint PharmaSUG 2018 - Paper DV-01 Square Peg, Square Hole Getting Tables to Fit on Slides in the ODS Destination for PowerPoint Jane Eslinger, SAS Institute Inc. ABSTRACT An output table is a square. A slide

More information

Working the System: Our Best SAS Options Patrick Thornton, SRI International, Menlo Park, CA Iuliana Barbalau, Adecco, Pleasanton, CA

Working the System: Our Best SAS Options Patrick Thornton, SRI International, Menlo Park, CA Iuliana Barbalau, Adecco, Pleasanton, CA ABSTRACT Working the System: Our Best SAS Options Patrick Thornton, SRI International, Menlo Park, CA Iuliana Barbalau, Adecco, Pleasanton, CA This paper provides an overview of SAS system options, and

More information

Validation Summary using SYSINFO

Validation Summary using SYSINFO Validation Summary using SYSINFO Srinivas Vanam Mahipal Vanam Shravani Vanam Percept Pharma Services, Bridgewater, NJ ABSTRACT This paper presents a macro that produces a Validation Summary using SYSINFO

More information

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

EXAMPLES OF DATA LISTINGS AND CLINICAL SUMMARY TABLES USING PROC REPORT'S BATCH LANGUAGE EXAMPLES OF DATA LISTINGS AND CLINICAL SUMMARY TABLES USING PROC REPORT'S BATCH LANGUAGE Rob Hoffman Hoffmann-La Roche, Inc. Abstract PROC REPORT Is a powerful report writing tool which can easily create

More information

Data Manipulation with SQL Mara Werner, HHS/OIG, Chicago, IL

Data Manipulation with SQL Mara Werner, HHS/OIG, Chicago, IL Paper TS05-2011 Data Manipulation with SQL Mara Werner, HHS/OIG, Chicago, IL Abstract SQL was developed to pull together information from several different data tables - use this to your advantage as you

More information

Out of Control! A SAS Macro to Recalculate QC Statistics

Out of Control! A SAS Macro to Recalculate QC Statistics Paper 3296-2015 Out of Control! A SAS Macro to Recalculate QC Statistics Jesse Pratt, Colleen Mangeot, Kelly Olano, Cincinnati Children s Hospital Medical Center, Cincinnati, OH, USA ABSTRACT SAS/QC provides

More information

MACROS TO REPORT MISSING DATA: AN HTML DATA COLLECTION GUIDE Patrick Thornton, University of California San Francisco

MACROS TO REPORT MISSING DATA: AN HTML DATA COLLECTION GUIDE Patrick Thornton, University of California San Francisco MACROS TO REPORT MISSING DATA: AN HTML DATA COLLECTION GUIDE Patrick Thornton, University of California San Francisco ABSTRACT This paper presents SAS macros to produce missing data reports in HTML. The

More information

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

Files Arriving at an Inconvenient Time? Let SAS Process Your Files with FILEEXIST While You Sleep Files Arriving at an Inconvenient Time? Let SAS Process Your Files with FILEEXIST While You Sleep Educational Testing Service SAS and all other SAS Institute Inc. product or service names are registered

More information

Getting it Done with PROC TABULATE

Getting it Done with PROC TABULATE ABSTRACT Getting it Done with PROC TABULATE Michael J. Williams, ICON Clinical Research, San Francisco, CA The task of displaying statistical summaries of different types of variables in a single table

More information

Macros to Report Missing Data: An HTML Data Collection Guide Patrick Thornton, University of California San Francisco, SF, California

Macros to Report Missing Data: An HTML Data Collection Guide Patrick Thornton, University of California San Francisco, SF, California Macros to Report Missing Data: An HTML Data Collection Guide Patrick Thornton, University of California San Francisco, SF, California ABSTRACT This paper presents SAS macro programs that calculate missing

More information

The Proc Transpose Cookbook

The Proc Transpose Cookbook ABSTRACT PharmaSUG 2017 - Paper TT13 The Proc Transpose Cookbook Douglas Zirbel, Wells Fargo and Co. Proc TRANSPOSE rearranges columns and rows of SAS datasets, but its documentation and behavior can be

More information

Submitting SAS Code On The Side

Submitting SAS Code On The Side ABSTRACT PharmaSUG 2013 - Paper AD24-SAS Submitting SAS Code On The Side Rick Langston, SAS Institute Inc., Cary NC This paper explains the new DOSUBL function and how it can submit SAS code to run "on

More information

A Side of Hash for You To Dig Into

A Side of Hash for You To Dig Into A Side of Hash for You To Dig Into Shan Ali Rasul, Indigo Books & Music Inc, Toronto, Ontario, Canada. ABSTRACT Within the realm of Customer Relationship Management (CRM) there is always a need for segmenting

More information

Uncommon Techniques for Common Variables

Uncommon Techniques for Common Variables Paper 11863-2016 Uncommon Techniques for Common Variables Christopher J. Bost, MDRC, New York, NY ABSTRACT If a variable occurs in more than one data set being merged, the last value (from the variable

More information

KEYWORDS Metadata, macro language, CALL EXECUTE, %NRSTR, %TSLIT

KEYWORDS Metadata, macro language, CALL EXECUTE, %NRSTR, %TSLIT MWSUG 2017 - Paper BB15 Building Intelligent Macros: Driving a Variable Parameter System with Metadata Arthur L. Carpenter, California Occidental Consultants, Anchorage, Alaska ABSTRACT When faced with

More information

Syntax Conventions for SAS Programming Languages

Syntax Conventions for SAS Programming Languages Syntax Conventions for SAS Programming Languages SAS Syntax Components Keywords A keyword is one or more literal name components of a language element. Keywords are uppercase, and in reference documentation,

More information

How to Create Data-Driven Lists

How to Create Data-Driven Lists Paper 9540-2016 How to Create Data-Driven Lists Kate Burnett-Isaacs, Statistics Canada ABSTRACT As SAS programmers we often want our code or program logic to be driven by the data at hand, rather than

More information

Identifying Duplicate Variables in a SAS Data Set

Identifying Duplicate Variables in a SAS Data Set Paper 1654-2018 Identifying Duplicate Variables in a SAS Data Set Bruce Gilsen, Federal Reserve Board, Washington, DC ABSTRACT In the big data era, removing duplicate data from a data set can reduce disk

More information

SAS Macro Dynamics - From Simple Basics to Powerful Invocations Rick Andrews, Office of the Actuary, CMS, Baltimore, MD

SAS Macro Dynamics - From Simple Basics to Powerful Invocations Rick Andrews, Office of the Actuary, CMS, Baltimore, MD Paper BB-7 SAS Macro Dynamics - From Simple Basics to Powerful Invocations Rick Andrews, Office of the Actuary, CMS, Baltimore, MD ABSTRACT The SAS Macro Facility offers a mechanism for expanding and customizing

More information

The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data

The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data Paper PO31 The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data MaryAnne DePesquo Hope, Health Services Advisory Group, Phoenix, Arizona Fen Fen Li, Health Services Advisory Group,

More information

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

STEP 1 - /*******************************/ /* Manipulate the data files */ /*******************************/ <<SAS DATA statements>> Generalized Report Programming Techniques Using Data-Driven SAS Code Kathy Hardis Fraeman, A.K. Analytic Programming, L.L.C., Olney, MD Karen G. Malley, Malley Research Programming, Inc., Rockville, MD

More information

Getting Up to Speed with PROC REPORT Kimberly LeBouton, K.J.L. Computing, Rossmoor, CA

Getting Up to Speed with PROC REPORT Kimberly LeBouton, K.J.L. Computing, Rossmoor, CA SESUG 2012 Paper HW-01 Getting Up to Speed with PROC REPORT Kimberly LeBouton, K.J.L. Computing, Rossmoor, CA ABSTRACT Learning the basics of PROC REPORT can help the new SAS user avoid hours of headaches.

More information

Are You Missing Out? Working with Missing Values to Make the Most of What is not There

Are You Missing Out? Working with Missing Values to Make the Most of What is not There Are You Missing Out? Working with Missing Values to Make the Most of What is not There Arthur L. Carpenter, California Occidental Consultants ABSTRACT Everyone uses and works with missing values, however

More information

Chapter 6: Modifying and Combining Data Sets

Chapter 6: Modifying and Combining Data Sets Chapter 6: Modifying and Combining Data Sets The SET statement is a powerful statement in the DATA step. Its main use is to read in a previously created SAS data set which can be modified and saved as

More information

Two useful macros to nudge SAS to serve you

Two useful macros to nudge SAS to serve you Two useful macros to nudge SAS to serve you David Izrael, Michael P. Battaglia, Abt Associates Inc., Cambridge, MA Abstract This paper offers two macros that augment the power of two SAS procedures: LOGISTIC

More information

PROC REPORT AN INTRODUCTION

PROC REPORT AN INTRODUCTION Table Generation Using the PROC REPORT Feature Edward R. Smith, Senior Scientific Programmer Covance Periapproval Services Inc, Radnor, PA ABSTRACT The PROC REPORT procedure is a powerful report generation

More information

Amie Bissonett, inventiv Health Clinical, Minneapolis, MN

Amie Bissonett, inventiv Health Clinical, Minneapolis, MN PharmaSUG 2013 - Paper TF12 Let s get SAS sy Amie Bissonett, inventiv Health Clinical, Minneapolis, MN ABSTRACT The SAS language has a plethora of procedures, data step statements, functions, and options

More information

A Few Quick and Efficient Ways to Compare Data

A Few Quick and Efficient Ways to Compare Data A Few Quick and Efficient Ways to Compare Data Abraham Pulavarti, ICON Clinical Research, North Wales, PA ABSTRACT In the fast paced environment of a clinical research organization, a SAS programmer has

More information

Greenspace: A Macro to Improve a SAS Data Set Footprint

Greenspace: A Macro to Improve a SAS Data Set Footprint Paper AD-150 Greenspace: A Macro to Improve a SAS Data Set Footprint Brian Varney, Experis Business Intelligence and Analytics Practice ABSTRACT SAS programs can be very I/O intensive. SAS data sets with

More information

Generating Customized Analytical Reports from SAS Procedure Output Brinda Bhaskar and Kennan Murray, RTI International

Generating Customized Analytical Reports from SAS Procedure Output Brinda Bhaskar and Kennan Murray, RTI International Abstract Generating Customized Analytical Reports from SAS Procedure Output Brinda Bhaskar and Kennan Murray, RTI International SAS has many powerful features, including MACRO facilities, procedures such

More information

Automating Preliminary Data Cleaning in SAS

Automating Preliminary Data Cleaning in SAS Paper PO63 Automating Preliminary Data Cleaning in SAS Alec Zhixiao Lin, Loan Depot, Foothill Ranch, CA ABSTRACT Preliminary data cleaning or scrubbing tries to delete the following types of variables

More information

Tales from the Help Desk 6: Solutions to Common SAS Tasks

Tales from the Help Desk 6: Solutions to Common SAS Tasks SESUG 2015 ABSTRACT Paper BB-72 Tales from the Help Desk 6: Solutions to Common SAS Tasks Bruce Gilsen, Federal Reserve Board, Washington, DC In 30 years as a SAS consultant at the Federal Reserve Board,

More information

ZERO MY HERO! Getting those zeroes on your PROC REPORT or PROC TABULATE tables!!

ZERO MY HERO! Getting those zeroes on your PROC REPORT or PROC TABULATE tables!! ZERO MY HERO! Getting those zeroes on your PROC REPORT or PROC TABULATE tables!! Anna Vincent Research Specialist Data Management Center for Health Statistics Texas Dept. of State Health Services Here

More information

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

A Breeze through SAS options to Enter a Zero-filled row Kajal Tahiliani, ICON Clinical Research, Warrington, PA ABSTRACT: A Breeze through SAS options to Enter a Zero-filled row Kajal Tahiliani, ICON Clinical Research, Warrington, PA Programmers often need to summarize data into tables as per template. But study

More information

SAS Macro Programming for Beginners

SAS Macro Programming for Beginners ABSTRACT SAS Macro Programming for Beginners Lora D. Delwiche, Winters, CA Susan J. Slaughter, Avocet Solutions, Davis, CA Macro programming is generally considered an advanced topic. But, while macros

More information

Using Recursion for More Convenient Macros

Using Recursion for More Convenient Macros Paper BB-04 Using Recursion for More Convenient Macros Nate Derby, Stakana Analytics, Seattle, WA ABSTRACT There are times when a macro needs to alternatively be applied to either one value or a list of

More information

Correcting for natural time lag bias in non-participants in pre-post intervention evaluation studies

Correcting for natural time lag bias in non-participants in pre-post intervention evaluation studies Correcting for natural time lag bias in non-participants in pre-post intervention evaluation studies Gandhi R Bhattarai PhD, OptumInsight, Rocky Hill, CT ABSTRACT Measuring the change in outcomes between

More information

An Introduction to PROC REPORT

An Introduction to PROC REPORT Paper BB-276 An Introduction to PROC REPORT Kirk Paul Lafler, Software Intelligence Corporation, Spring Valley, California Abstract SAS users often need to create and deliver quality custom reports and

More information

A Cross-national Comparison Using Stacked Data

A Cross-national Comparison Using Stacked Data A Cross-national Comparison Using Stacked Data Goal In this exercise, we combine household- and person-level files across countries to run a regression estimating the usual hours of the working-aged civilian

More information

SAS/ETS 13.2 User s Guide. The COMPUTAB Procedure

SAS/ETS 13.2 User s Guide. The COMPUTAB Procedure SAS/ETS 13.2 User s Guide The COMPUTAB Procedure This document is an individual chapter from SAS/ETS 13.2 User s Guide. The correct bibliographic citation for the complete manual is as follows: SAS Institute

More information

An Application of PROC NLP to Survey Sample Weighting

An Application of PROC NLP to Survey Sample Weighting An Application of PROC NLP to Survey Sample Weighting Talbot Michael Katz, Analytic Data Information Technologies, New York, NY ABSTRACT The classic weighting formula for survey respondents compensates

More information

%MAKE_IT_COUNT: An Example Macro for Dynamic Table Programming Britney Gilbert, Juniper Tree Consulting, Porter, Oklahoma

%MAKE_IT_COUNT: An Example Macro for Dynamic Table Programming Britney Gilbert, Juniper Tree Consulting, Porter, Oklahoma Britney Gilbert, Juniper Tree Consulting, Porter, Oklahoma ABSTRACT Today there is more pressure on programmers to deliver summary outputs faster without sacrificing quality. By using just a few programming

More information

In this paper, we will build the macro step-by-step, highlighting each function. A basic familiarity with SAS Macro language is assumed.

In this paper, we will build the macro step-by-step, highlighting each function. A basic familiarity with SAS Macro language is assumed. No More Split Ends: Outputting Multiple CSV Files and Keeping Related Records Together Gayle Springer, JHU Bloomberg School of Public Health, Baltimore, MD ABSTRACT The EXPORT Procedure allows us to output

More information

Poster Frequencies of a Multiple Mention Question

Poster Frequencies of a Multiple Mention Question Title Author Abstract Poster Frequencies of a Multiple Mention Question Leslie A. Christensen Market Research Analyst Sr. Market Planning & Research The Goodyear Tire & Rubber Company The poster will demonstrate

More information

SAS Programming Techniques for Manipulating Metadata on the Database Level Chris Speck, PAREXEL International, Durham, NC

SAS Programming Techniques for Manipulating Metadata on the Database Level Chris Speck, PAREXEL International, Durham, NC PharmaSUG2010 - Paper TT06 SAS Programming Techniques for Manipulating Metadata on the Database Level Chris Speck, PAREXEL International, Durham, NC ABSTRACT One great leap that beginning and intermediate

More information

Tweaking your tables: Suppressing superfluous subtotals in PROC TABULATE

Tweaking your tables: Suppressing superfluous subtotals in PROC TABULATE ABSTRACT Tweaking your tables: Suppressing superfluous subtotals in PROC TABULATE Steve Cavill, NSW Bureau of Crime Statistics and Research, Sydney, Australia PROC TABULATE is a great tool for generating

More information

ABSTRACT INTRODUCTION MACRO. Paper RF

ABSTRACT INTRODUCTION MACRO. Paper RF Paper RF-08-2014 Burst Reporting With the Help of PROC SQL Dan Sturgeon, Priority Health, Grand Rapids, Michigan Erica Goodrich, Priority Health, Grand Rapids, Michigan ABSTRACT Many SAS programmers need

More information

BY S NOTSORTED OPTION Karuna Samudral, Octagon Research Solutions, Inc., Wayne, PA Gregory M. Giddings, Centocor R&D Inc.

BY S NOTSORTED OPTION Karuna Samudral, Octagon Research Solutions, Inc., Wayne, PA Gregory M. Giddings, Centocor R&D Inc. ABSTRACT BY S NOTSORTED OPTION Karuna Samudral, Octagon Research Solutions, Inc., Wayne, PA Gregory M. Giddings, Centocor R&D Inc., Malvern, PA What if the usual sort and usual group processing would eliminate

More information

Paper CC-016. METHODOLOGY Suppose the data structure with m missing values for the row indices i=n-m+1,,n can be re-expressed by

Paper CC-016. METHODOLOGY Suppose the data structure with m missing values for the row indices i=n-m+1,,n can be re-expressed by Paper CC-016 A macro for nearest neighbor Lung-Chang Chien, University of North Carolina at Chapel Hill, Chapel Hill, NC Mark Weaver, Family Health International, Research Triangle Park, NC ABSTRACT SAS

More information

USING PROC TABULATE AND LAG(n) FUNCTION FOR RATES OF CHANGE Khoi To, Office of Planning and Decision Support, Virginia Commonwealth University

USING PROC TABULATE AND LAG(n) FUNCTION FOR RATES OF CHANGE Khoi To, Office of Planning and Decision Support, Virginia Commonwealth University SAS 5581-2016 USING PROC TABULATE AND LAG(n) FUNCTION FOR RATES OF CHANGE Khoi To, Office of Planning and Decision Support, Virginia Commonwealth University ABSTRACT For SAS users, PROC TABULATE and PROC

More information

%MISSING: A SAS Macro to Report Missing Value Percentages for a Multi-Year Multi-File Information System

%MISSING: A SAS Macro to Report Missing Value Percentages for a Multi-Year Multi-File Information System %MISSING: A SAS Macro to Report Missing Value Percentages for a Multi-Year Multi-File Information System Rushi Patel, Creative Information Technology, Inc., Arlington, VA ABSTRACT It is common to find

More information

An Easy Route to a Missing Data Report with ODS+PROC FREQ+A Data Step Mike Zdeb, FSL, University at Albany School of Public Health, Rensselaer, NY

An Easy Route to a Missing Data Report with ODS+PROC FREQ+A Data Step Mike Zdeb, FSL, University at Albany School of Public Health, Rensselaer, NY SESUG 2016 Paper BB-170 An Easy Route to a Missing Data Report with ODS+PROC FREQ+A Data Step Mike Zdeb, FSL, University at Albany School of Public Health, Rensselaer, NY ABSTRACT A first step in analyzing

More information

Arthur L. Carpenter California Occidental Consultants, Oceanside, California

Arthur L. Carpenter California Occidental Consultants, Oceanside, California Paper 028-30 Storing and Using a List of Values in a Macro Variable Arthur L. Carpenter California Occidental Consultants, Oceanside, California ABSTRACT When using the macro language it is not at all

More information

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

Regaining Some Control Over ODS RTF Pagination When Using Proc Report Gary E. Moore, Moore Computing Services, Inc., Little Rock, Arkansas PharmaSUG 2015 - Paper QT40 Regaining Some Control Over ODS RTF Pagination When Using Proc Report Gary E. Moore, Moore Computing Services, Inc., Little Rock, Arkansas ABSTRACT When creating RTF files using

More information

The DMSPLIT Procedure

The DMSPLIT Procedure The DMSPLIT Procedure The DMSPLIT Procedure Overview Procedure Syntax PROC DMSPLIT Statement FREQ Statement TARGET Statement VARIABLE Statement WEIGHT Statement Details Examples Example 1: Creating a Decision

More information

Cleaning Duplicate Observations on a Chessboard of Missing Values Mayrita Vitvitska, ClinOps, LLC, San Francisco, CA

Cleaning Duplicate Observations on a Chessboard of Missing Values Mayrita Vitvitska, ClinOps, LLC, San Francisco, CA Cleaning Duplicate Observations on a Chessboard of Missing Values Mayrita Vitvitska, ClinOps, LLC, San Francisco, CA ABSTRACT Removing duplicate observations from a data set is not as easy as it might

More information

Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA

Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA ABSTRACT Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA Data set documentation is essential to good

More information

Producing Summary Tables in SAS Enterprise Guide

Producing Summary Tables in SAS Enterprise Guide Producing Summary Tables in SAS Enterprise Guide Lora D. Delwiche, University of California, Davis, CA Susan J. Slaughter, Avocet Solutions, Davis, CA ABSTRACT This paper shows, step-by-step, how to use

More information

Hidden in plain sight: my top ten underpublicized enhancements in SAS Versions 9.2 and 9.3

Hidden in plain sight: my top ten underpublicized enhancements in SAS Versions 9.2 and 9.3 Hidden in plain sight: my top ten underpublicized enhancements in SAS Versions 9.2 and 9.3 Bruce Gilsen, Federal Reserve Board, Washington, DC ABSTRACT SAS Versions 9.2 and 9.3 contain many interesting

More information

Macro Quoting: Which Function Should We Use? Pengfei Guo, MSD R&D (China) Co., Ltd., Shanghai, China

Macro Quoting: Which Function Should We Use? Pengfei Guo, MSD R&D (China) Co., Ltd., Shanghai, China PharmaSUG China 2016 - Paper 81 Macro Quoting: Which Function Should We Use? Pengfei Guo, MSD R&D (China) Co., Ltd., Shanghai, China ABSTRACT There are several macro quoting functions in SAS and even some

More information

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

Quick Data Definitions Using SQL, REPORT and PRINT Procedures Bradford J. Danner, PharmaNet/i3, Tennessee ABSTRACT PharmaSUG2012 Paper CC14 Quick Data Definitions Using SQL, REPORT and PRINT Procedures Bradford J. Danner, PharmaNet/i3, Tennessee Prior to undertaking analysis of clinical trial data, in addition

More information

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

Macros for Two-Sample Hypothesis Tests Jinson J. Erinjeri, D.K. Shifflet and Associates Ltd., McLean, VA Paper CC-20 Macros for Two-Sample Hypothesis Tests Jinson J. Erinjeri, D.K. Shifflet and Associates Ltd., McLean, VA ABSTRACT Statistical Hypothesis Testing is performed to determine whether enough statistical

More information

Are you Still Afraid of Using Arrays? Let s Explore their Advantages

Are you Still Afraid of Using Arrays? Let s Explore their Advantages Paper CT07 Are you Still Afraid of Using Arrays? Let s Explore their Advantages Vladyslav Khudov, Experis Clinical, Kharkiv, Ukraine ABSTRACT At first glance, arrays in SAS seem to be a complicated and

More information

Using PROC SQL to Generate Shift Tables More Efficiently

Using PROC SQL to Generate Shift Tables More Efficiently ABSTRACT SESUG Paper 218-2018 Using PROC SQL to Generate Shift Tables More Efficiently Jenna Cody, IQVIA Shift tables display the change in the frequency of subjects across specified categories from baseline

More information

Ranking Between the Lines

Ranking Between the Lines Ranking Between the Lines A %MACRO for Interpolated Medians By Joe Lorenz SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in

More information

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

Journey to the center of the earth Deep understanding of SAS language processing mechanism Di Chen, SAS Beijing R&D, Beijing, China Journey to the center of the earth Deep understanding of SAS language processing Di Chen, SAS Beijing R&D, Beijing, China ABSTRACT SAS is a highly flexible and extensible programming language, and a rich

More information

Using Unnamed and Named Pipes

Using Unnamed and Named Pipes 227 CHAPTER 12 Using Unnamed and Named Pipes Overview of Pipes 227 Using Unnamed Pipes 228 Unnamed Pipe Syntax 228 Using Redirection Sequences 229 Unnamed Pipe Example 229 Using Named Pipes 230 Named Pipe

More information

Using Templates Created by the SAS/STAT Procedures

Using Templates Created by the SAS/STAT Procedures Paper 081-29 Using Templates Created by the SAS/STAT Procedures Yanhong Huang, Ph.D. UMDNJ, Newark, NJ Jianming He, Solucient, LLC., Berkeley Heights, NJ ABSTRACT SAS procedures provide a large quantity

More information

Go Ahead and _BREAK_-down: Advanced COMPUTE Block Examples

Go Ahead and _BREAK_-down: Advanced COMPUTE Block Examples Paper SAS431-2017 Go Ahead and _BREAK_-down: Advanced COMPUTE Block Examples Cynthia Zender, SAS Institute Inc. ABSTRACT When you look at examples of the REPORT procedure, you see code that tests _BREAK_

More information

SD10 A SAS MACRO FOR PERFORMING BACKWARD SELECTION IN PROC SURVEYREG

SD10 A SAS MACRO FOR PERFORMING BACKWARD SELECTION IN PROC SURVEYREG Paper SD10 A SAS MACRO FOR PERFORMING BACKWARD SELECTION IN PROC SURVEYREG Qixuan Chen, University of Michigan, Ann Arbor, MI Brenda Gillespie, University of Michigan, Ann Arbor, MI ABSTRACT This paper

More information

Applications Development

Applications Development AD003 User Implementation and Revision of Business Rules Without Hard Coding: Macro-Generated SAS Code By Michael Krumenaker, Sr. Project Manager, Palisades Research, Inc. and Jit Bhattacharya, Manager

More information

Using PROC SQL to Calculate FIRSTOBS David C. Tabano, Kaiser Permanente, Denver, CO

Using PROC SQL to Calculate FIRSTOBS David C. Tabano, Kaiser Permanente, Denver, CO Using PROC SQL to Calculate FIRSTOBS David C. Tabano, Kaiser Permanente, Denver, CO ABSTRACT The power of SAS programming can at times be greatly improved using PROC SQL statements for formatting and manipulating

More information

Let Hash SUMINC Count For You Joseph Hinson, Accenture Life Sciences, Berwyn, PA, USA

Let Hash SUMINC Count For You Joseph Hinson, Accenture Life Sciences, Berwyn, PA, USA ABSTRACT PharmaSUG 2014 - Paper CC02 Let Hash SUMINC Count For You Joseph Hinson, Accenture Life Sciences, Berwyn, PA, USA Counting of events is inevitable in clinical programming and is easily accomplished

More information

The Dataset Diet How to transform short and fat into long and thin

The Dataset Diet How to transform short and fat into long and thin Paper TU06 The Dataset Diet How to transform short and fat into long and thin Kathryn Wright, Oxford Pharmaceutical Sciences, UK ABSTRACT What do you do when you are given a dataset with one observation

More information

David Beam, Systems Seminar Consultants, Inc., Madison, WI

David Beam, Systems Seminar Consultants, Inc., Madison, WI Paper 150-26 INTRODUCTION TO PROC SQL David Beam, Systems Seminar Consultants, Inc., Madison, WI ABSTRACT PROC SQL is a powerful Base SAS Procedure that combines the functionality of DATA and PROC steps

More information

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

Using SAS Macro to Include Statistics Output in Clinical Trial Summary Table Using SAS Macro to Include Statistics Output in Clinical Trial Summary Table Amy C. Young, Ischemia Research and Education Foundation, San Francisco, CA Sharon X. Zhou, Ischemia Research and Education

More information

SAS/STAT 13.1 User s Guide. The NESTED Procedure

SAS/STAT 13.1 User s Guide. The NESTED Procedure SAS/STAT 13.1 User s Guide The NESTED Procedure This document is an individual chapter from SAS/STAT 13.1 User s Guide. The correct bibliographic citation for the complete manual is as follows: SAS Institute

More information

Creating Macro Calls using Proc Freq

Creating Macro Calls using Proc Freq Creating Macro Calls using Proc Freq, Educational Testing Service, Princeton, NJ ABSTRACT Imagine you were asked to get a series of statistics/tables for each country in the world. You have the data, but

More information

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

Customized Flowcharts Using SAS Annotation Abhinav Srivastva, PaxVax Inc., Redwood City, CA ABSTRACT Customized Flowcharts Using SAS Annotation Abhinav Srivastva, PaxVax Inc., Redwood City, CA Data visualization is becoming a trend in all sectors where critical business decisions or assessments

More information

The REPORT Procedure CHAPTER 32

The REPORT Procedure CHAPTER 32 859 CHAPTER 32 The REPORT Procedure Overview 861 Types of Reports 861 A Sampling of Reports 861 Concepts 866 Laying Out a Report 866 Usage of Variables in a Report 867 Display Variables 867 Order Variables

More information

A Quick and Gentle Introduction to PROC SQL

A Quick and Gentle Introduction to PROC SQL ABSTRACT Paper B2B 9 A Quick and Gentle Introduction to PROC SQL Shane Rosanbalm, Rho, Inc. Sam Gillett, Rho, Inc. If you are afraid of SQL, it is most likely because you haven t been properly introduced.

More information

It s Proc Tabulate Jim, but not as we know it!

It s Proc Tabulate Jim, but not as we know it! Paper SS02 It s Proc Tabulate Jim, but not as we know it! Robert Walls, PPD, Bellshill, UK ABSTRACT PROC TABULATE has received a very bad press in the last few years. Most SAS Users have come to look on

More information

So Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines

So Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines Paper TT13 So Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines Anthony Harris, PPD, Wilmington, NC Robby Diseker, PPD, Wilmington, NC ABSTRACT

More information

To conceptualize the process, the table below shows the highly correlated covariates in descending order of their R statistic.

To conceptualize the process, the table below shows the highly correlated covariates in descending order of their R statistic. Automating the process of choosing among highly correlated covariates for multivariable logistic regression Michael C. Doherty, i3drugsafety, Waltham, MA ABSTRACT In observational studies, there can be

More information

My Reporting Requires a Full Staff Help!

My Reporting Requires a Full Staff Help! ABSTRACT Paper GH-03 My Reporting Requires a Full Staff Help! Erin Lynch, Daniel O Connor, Himesh Patel, SAS Institute Inc., Cary, NC With cost cutting and reduced staff, everyone is feeling the pressure

More information

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

Quick and Efficient Way to Check the Transferred Data Divyaja Padamati, Eliassen Group Inc., North Carolina. ABSTRACT PharmaSUG 2016 - Paper QT03 Quick and Efficient Way to Check the Transferred Data Divyaja Padamati, Eliassen Group Inc., North Carolina. Consistency, quality and timelines are the three milestones

More information

Sample Questions. SAS Advanced Programming for SAS 9. Question 1. Question 2

Sample Questions. SAS Advanced Programming for SAS 9. Question 1. Question 2 Sample Questions The following sample questions are not inclusive and do not necessarily represent all of the types of questions that comprise the exams. The questions are not designed to assess an individual's

More information