Poster Frequencies of a Multiple Mention Question

Similar documents
SAS Macro Dynamics: from Simple Basics to Powerful Invocations Rick Andrews, Office of Research, Development, and Information, Baltimore, MD

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

Simplifying the Sample Design Process with PROC PMENU

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

Creating Macro Calls using Proc Freq

Statistics, Data Analysis & Econometrics

Using SAS Macros to Extract P-values from PROC FREQ

Internet, Intranets, and The Web

Facilitate Statistical Analysis with Automatic Collapsing of Small Size Strata

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

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

A Side of Hash for You To Dig Into

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

Chapter 6: Modifying and Combining Data Sets

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

ABSTRACT INTRODUCTION MACRO. Paper RF

Arthur L. Carpenter California Occidental Consultants, Oceanside, California

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

A Macro that can Search and Replace String in your SAS Programs

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

Macro Method to use Google Maps and SAS to Geocode a Location by Name or Address

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

Demystifying Inherited Programs

Random Sampling For the Non-statistician Diane E. Brown AdminaStar Solutions, Associated Insurance Companies Inc.

Going Under the Hood: How Does the Macro Processor Really Work?

Keeping Track of Database Changes During Database Lock

Greenspace: A Macro to Improve a SAS Data Set Footprint

Pruning the SASLOG Digging into the Roots of NOTEs, WARNINGs, and ERRORs

%Addval: A SAS Macro Which Completes the Cartesian Product of Dataset Observations for All Values of a Selected Set of Variables

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

Automatic Indicators for Dummies: A macro for generating dummy indicators from category type variables

PharmaSUG Paper TT11

Submitting SAS Code On The Side

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

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

The Proc Transpose Cookbook

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

Using Proc Freq for Manageable Data Summarization

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

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

Checking for Duplicates Wendi L. Wright

PLA YING WITH MACROS: TAKE THE WORK OUT OF LEARNING TO DO MACROS. Arthur L. Carpenter

DSCI 325: Handout 15 Introduction to SAS Macro Programming Spring 2017

Base and Advance SAS

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

Unlock SAS Code Automation with the Power of Macros

Implementing external file processing with no record delimiter via a metadata-driven approach

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

A Consolidated Macro for Iterative Hot Deck Imputation

Applications Development

Top-Down Programming with SAS Macros Edward Heaton, Westat, Rockville, MD

A Cross-national Comparison Using Stacked Data

The Output Bundle: A Solution for a Fully Documented Program Run

Using Templates Created by the SAS/STAT Procedures

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

EXPORTING SAS OUTPUT ONTO THE WORLD WIDE WEB

Chapter 1 Section 3. Page 22. A graph is a visual display of information or data. There are three types of graphs.

Using PROC PLAN for Randomization Assignments

PharmaSUG Paper IB11

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

Data Quality Review for Missing Values and Outliers

A SAS Macro for Balancing a Weighted Sample

An Animated Guide: Proc Transpose

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

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

... ) city (city, cntyid, area, pop,.. )

Program Validation: Logging the Log

The Ugliest Data I ve Ever Met

Copy That! Using SAS to Create Directories and Duplicate Files

Paper DB2 table. For a simple read of a table, SQL and DATA step operate with similar efficiency.

Tired of CALL EXECUTE? Try DOSUBL

Seminar Series: CTSI Presents

A Macro for Systematic Treatment of Special Values in Weight of Evidence Variable Transformation Chaoxian Cai, Automated Financial Systems, Exton, PA

Automating Preliminary Data Cleaning in SAS

Using the CLP Procedure to solve the agent-district assignment problem

Posters. Paper

Innovations in Vehicle Simulation Software for Ease of Use. Thomas D. Gillespie, Ph.D. Mechanical Simulation Corporation

ADOPTING SPSS MACROS TO MAXIMIZE OFFICE PRODUCTIVITY

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

ADOPTING SPSS MACROS TO MAXIMIZE OFFICE PRODUCTIVITY

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

What's the Difference? Using the PROC COMPARE to find out.

The Demystification of a Great Deal of Files

My objective is twofold: Examine the capabilities of MP Connect and apply those capabilities to a real-world application.

Reading in Data Directly from Microsoft Word Questionnaire Forms

PharmaSUG Paper TT03. Kirk Paul Lafler, Software Intelligence Corporation, Spring Valley, California

... WHERE. AnnotaI8 Data.S... XSYS & YSYS. Harie Annotate: How Not to Lose Your Head When Enhancing BAS/GRAPH output

An Introduction to SAS Macros

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

Getting Classy: A SAS Macro for CLASS Statement Automation

Hot-deck Imputation with SAS Arrays and Macros for Large Surveys

Getting it Done with PROC TABULATE

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

An Application of PROC NLP to Survey Sample Weighting

Format-o-matic: Using Formats To Merge Data From Multiple Sources

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

Missing Data: What Are You Missing?

Using SAS/SCL to Create Flexible Programs... A Super-Sized Macro Ellen Michaliszyn, College of American Pathologists, Northfield, IL

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

Out of Control! A SAS Macro to Recalculate QC Statistics

Transcription:

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 with SAS code and output how a market researcher can handle the problem of calculating percentages of a particular mention on a multiple mention question. These frequencies will be based on the number of respondents in the survey as opposed to the number of responses. The poster will supply code for a macro that can be %INCLUDED into the user's programs and the creation of a global macro variable that eliminates the need for the user to hard code values into his program. Proceedings of MWSUG '95 408 Coder's Corner Posters

Poster - Frequencies of a Multiple Mention Question Situation In a market research survey you have asked a respondent the following question. This type of question is referred to as a multiple mention. Q5. What type of vehicle do you own? (check all that apply) CJ car CJ mini van CJ pick up truck CJ sport utility CJ other. Problem A market researcher will want percentages of the responses on the multiple mention question based on the number of people in the survey, as opposed to the number of responses. What percentage of people own a mini van? Problem The SAS code required to answer the business problem is four fold. 1. Find the number of respondents in the study. 2. Take an array of five variables for one observation and transpose it into a new data set with one variable and five observations. 3. Find the frequency of a particular value, e.g. 2=mini van, in the new dataset. 4. Divide this frequency by the number of respondents in the original dataset Solution The following pieces of code are used to solve the problem. The macro REALFREQ can be stored separately and %INCLUDED into any SAS program that requires handling a multiple mention question. Proceedings of MWSUG '95 409 Coder's Corner Posters

Poster - Frequencies of a Multiple Mention Question Solution REALFREQ macro continued /*MACRO REALFREQ */ /*OBTAIN THE FREQUENCY OF A MULTIPLE MENTION WITII */ /*THE DEMONINATOR OF THE PERCENT BEING THE NUMBER OF RESPONDENTS */ /*AND NOT THE NUMBER OF MENTIONS */ /*PASS TO THE MACRO: */ /* DATASET NAME */ /* VARIABLE NAME OF THE FIRST MENTION - as an array variable */ /* VARIABLE NAME OF THE LAST MENTION - as an array variable */ /* THE N TO USE FOR THE DEMONINATOR *1 /* FORMAT NAME FOR THE VARIABLE */ /* TITI..E FOR THE PRINTED OUTPUT */ %MACRO REALFREQ(dataset,ELEMl,ELEMn,N,fmt,titl); DATA start; SET &DATASET; ARRAYelem (i) &eleml-&elemn; DO OVER elem; mention=elem; OUTPUT; END; PROC FREQ DATA=start; TABLE mention/out=one NOPRINT; DATA next; SET one; DROP percent; FORMAT mention &fmt; mentperc=(count/&n)* 100; PROC PRINT; V AR mention mentperc count; TITLE 1 "&titl"; %MEND REALFREQ; Proceedings of MWSUG '95 410 Coder's Corner Posters

Poster - Frequencies of a Multiple Mention Question Solution Main program continued *************************************************************., * MWSUG95A * Example of handling a multiple mention question for the * MidWest SAS User Group 1995 Conference * LA Christensen CJ7/14/95 *************************************************************., %INCLUDE TSO(MWSUG95m); %INCLUDE TSO(MWSUG9Sf); O/oGLOBAL NRESP; OPTIONS SYMBOLGEN MACROGEN; DATA cars; INPUT carl cars; CARDS; 12... 35... 13... 4.... 134.. 4.... 2.... DATA cars; SET cars END=EOF; IF EOF THEN CALL SYMPUT(,NRESP',_N.J; PROC PRINT; *include macro; *include foonat; *set up global macro VaT, *expand log for macro; *read in data for question; *note no. respondents; *check raw data; V AR carl cars; TITLE! 'What Type of Vehicle Do You Own?'; %REALFREQ(cars,carl,car5,&NRESP.carf.,Vehicle Ownership);*nm macro; Proceedings of MWSUG '95 411 Coder's Corner Posters

Poster Frequencies of a Multiple Mention.Question Solution Format for response variable continued *******************************************************************. * MWSUG95F * FORMATS FOR EXAMPLE OF MULTIPLE MENTION HANDLING * LA CHRISTENSEN 07/14/95 *******************************************************************., PROC FORMAT; VALUE CARP 1='CAR' 2='MINI VAN' 3='PICK UP' 4='SPORT UTILITY' 5='OTHER'; Solution After running the above program, you will see the following output What Type of Vehicle Do You Own? OBS CARl CAR2 CAR3 CAR4 CARS 1 1 2 1 2 3 3 5 4 1 3 5 4 6 1 3 4 7 4 8 2 9 1 10 1 Vehicle Ownership OBS MENTION MENTPERC COUNT 1 350 35 2 CAR 60 6 3 MINI VAN 20 2.. 20 % or those surveyed 4 PICK UP 30 3 own a mini van 5 SPORT UTILITY 30 3 6 OTHER 10 1 Thus, the answer to the business question of what percentage of people own a mini van is 20%. SAS is a registered trademark or trademark of the SAS Institute Inc. in the USA and other counties. indicates USA registration. Proceedings of MWSUG '95 412 Coder's Comer Posters