Niraj J. Pandya, Element Technologies Inc., NJ.  Summarize all possible combinations of class level variables even if few categories are altogether missing.

Slides:



Advertisements
Similar presentations
When Good Looks Arent Enough Lisa Eckler. When Good Looks Arent Enough.
Advertisements

©2011, Veridical Solutions. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc.
Copyright © 2008 SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks.
Knowing Understanding the Basics Writing your own code part 2 SAS Lab.
Guide to extract/download multiple databases from Mainframe Tapes to PC using SAS PC Fereydoun J. Foroudian Blue Cross of California SAS is a registered.
SAS Programming: Working With Variables. Data Step Manipulations New variables should be created during a Data step Existing variables should be manipulated.
Descriptive Statistics In SAS Exploring Your Data.
Quick Data Summaries in SAS Start by bringing in data –Use permanent data set for these examples Proc Tabulate –Produces summaries very quickly and easily.
Introduction to SQL Session 1 Retrieving Data From a Single Table.
Basic And Advanced SAS Programming
Topics in Data Management SAS Data Step. Combining Data Sets I - SET Statement Data available on common variables from different sources. Multiple datasets.
Data Preparation for Analytics Using SAS Gerhard Svolba, Ph.D. Reviewed by Madera Ebby, Ph.D.
FORMAT FESTIVAL AN INTRODUCTION TO SAS® FORMATS AND INFORMATS By David Maddox.
Statistical Discovery. TM From SAS. JMP ® Software: Introduction to Categorical Data Analysis.
SAS SQL SAS Seminar Series
SAS Macros ® 101 How I learned to stop worrying and love macros Alex Chaplin BCS USA Section.
A Concise Display of Multiple Response Items Patrick Thornton.
SAS PROC REPORT PROC TABULATE
Chapter 9 Producing Descriptive Statistics PROC MEANS; Summarize descriptive statistics for continuous numeric variables. PROC FREQ; Summarize frequency.
Copyright © 2008, SAS Institute Inc. All rights reserved. RMS Titanic: Using SAS Enterprise Guide To Report On A Tragedy Matt Malczewski, SAS Canada.
My ODS: Real-World Uses of Modifying Table Templates Steve James Centers for Disease Control and Prevention Atlanta, Ga.
Copyright © 2010, SAS Institute Inc. All rights reserved. Applied Analytics Using SAS ® Enterprise Miner™
Multiple Uses for a Simple SQL Procedure Rebecca Larsen University of South Florida.
%rtf2data: A utility macro to convert RTF Table to SAS® dataset
Copyright © 2008 SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks.
Copyright © 2004, SAS Institute Inc. All rights reserved. SAS is a registered trademark or trademark of SAS Institute Inc. in the USA and other countries.
Essential ODS PDF Patrick Thornton.
A Brief Introduction to PROC TRANSPOSE prepared by Voytek Grus for
1 Click to edit Master title style Demographic Analysis Panel Current and Future State FDA/PhUSE CSS - Working Group 5 - Analysis Standards Script Examples.
1 Efficient SAS Coding with Proc SQL When Proc SQL is Easier than Traditional SAS Approaches Mike Atkinson, May 4, 2005.
1 Filling in the blanks with PROC FREQ Bill Klein Ryerson University.
The Worst Data Step Traps and Pitfalls How to Recognize Them How to Avoid Them 1.
1 Using the Magical Keyword “INTO” in PROC SQL Thiru Satchi Blue Cross and Blue Shield of Massachusetts Boston Area SAS Users Group April 5, 1999.
The Power of the BY Statement SVSUG Paul Choate, California Developmental Services (& Toby Dunn, U.S. Army Medical Department Center & School)
1 EPIB 698C Lecture 4 Raul Cruz-Cano Summer 2012.
Copyright © 2005, SAS Institute Inc. All rights reserved. SAS is a registered trademark or trademark of SAS Institute Inc. in the USA and other countries.
1 Statistical Software Programming. STAT 6360 –Statistical Software Programming Sorting, Printing, Summarizing Data Now that we can input data and do.
Lesson 8 - Topics Creating SAS datasets from procedures Using ODS and data steps to make reports Using PROC RANK Programs in course notes LSB 4:11;5:3.
Rob Gately OptumInsight, Epidemiology Waltham, MA Adjusting Analyses of Survey Results using a Predicted Probability of Response Presented at DSUG Colorado.
An Introduction Katherine Nicholas & Liqiong Fan.
Computing with SAS Software A SAS program consists of SAS statements. 1. The DATA step consists of SAS statements that define your data and create a SAS.
FORMAT statements can be used to change the look of your output –if FORMAT is in the DATA step, then the formats are permanent and stored with the dataset.
1 Chapter 3: Getting Started with Tasks 3.1 Introduction to Task Dialogs 3.2 Creating a Listing Report 3.3 Creating a Frequency Report 3.4 Creating a Two-Way.
Customize SAS Output Using ODS Joan Dong. The Output Delivery System (ODS) gives you greater flexibility in generating, storing, and reproducing SAS procedure.
Multiple Imputation using SAS Don Miller 812 Oswald Tower
Elementary Analysis Richard LeGates URBS 492. Univariate Analysis Distributions –SPSS Command Statistics | Summarize | Frequencies Presents label, total.
Second Period: PROC TABULATE Jill Casey. Example 1: Simple 2D Table.
Patrick Thornton SRI International.  Example of a Multiple Response Item ◦ Variable coding and example data  A Cross Tabulation using Proc REPORT 
BMTRY 789 Lecture9: Proc Tabulate Readings – Chapter 11 & Selected SUGI Reading Lab Problems , 11.2 Homework Due Next Week– HW6.
Build your Metadata with PROC CONTENTS and ODS OUTPUT Louise S. Hadden Abt Associates Inc.
Better Metadata Through SAS® II: %SYSFUNC, PROC DATASETS, and Dictionary Tables.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 16 & 17 By Tasha Chapman, Oregon Health Authority.
Notes on SQL. SQL Programming Employers increasingly tell us that they look for 3 things on a resume: SAS, R and SQL. In these notes you will learn: 1.What.
Session 1 Retrieving Data From a Single Table
Advantages of sas for reporting
DATA MANAGEMENT MODULE: USING SQL in R
Applied Business Forecasting and Regression Analysis
Poster Title Author #1 name, ABC Corporation, City, Country Author #2 name, ABC Corporation, City, Country Abstract A brief abstract at the beginning summarizes.
Joshua Klick, Economist, Bureau of Labor Statistics
A brief introduction to the topic
DATA MANAGEMENT MODULE: USING SQL in R
Poster Title Author #1 name, ABC Corporation, City, Country Author #2 name, ABC Corporation, City, Country Abstract A brief abstract at the beginning summarizes.
Lesson 8 - Topics Creating SAS datasets from procedures
PROC DOC III: Self-generating Codebooks Using SAS®
Quick Data Summaries in SAS
Producing Descriptive Statistics
Automate Repetitive Programming Tasks: Effective SAS® Code Generators
5/8/2019 3:20 AM bQuery-Tool 3.0 A new and elegant way to create queries and ad-hoc reports on your Baan/Infor ERP LN data. This Baan session is a query.
Presentation transcript:

Niraj J. Pandya, Element Technologies Inc., NJ

 Summarize all possible combinations of class level variables even if few categories are altogether missing in the database.  It is difficult to get SAS to summarize what isn’t there, e.g., how can a procedure directly count data points that do not exist in the data?  Techniques/options with some SAS Procedures to summarize missing categories in the report and fill with zero 2

3

4 Proc Format; Value range1='Low' 2='Normal' 3='High' ; Value sex 1 = 'Male' 2 = 'Female' ; Run;

/* Hard coded dummy dataset in the format same as expected in final output */ Data Dummy(drop = i j); Do i = 1 to 3; Do j = 1 to 2; SEX = j; RANGE = i; N = 0; MEAN =.; MEDIAN =.; STD =.; MIN =.; MAX =.; Output; End; Run; 5 /* Create a dataset containing summary statistics */ Proc Means Data = HDL noprint; Class SEX RANGE; Var LBRSLT; Output out = Stat(keep = SEX RANGE N Mean Median Std Min Max) N = N Mean = Mean Median = Median Std = Std Min = Min Max = Max; Run;

Data Stat; Merge Dummy Stat; By SEX RANGE; Format SEX sex. RANGE range.; /* Apply previously defined formats */ Run; Proc Print noobs; Run; 6

Proc Means Data = HDL noprint completetypes; Format SEX sex. RANGE range.; Class SEX RANGE/preloadfmt; Var LBRSLT; Output out = Stat(keep = SEX RANGE N Mean Median Std Min Max) N = N Mean = Mean Median = Median Std = Std Min = Min Max = Max ; Run; 7

Proc Tabulate Data = HDL; Format SEX sex. RANGE range.; Class SEX RANGE/preloadfmt; Var LBRSLT; Table SEX='SEX'*RANGE='RANGE', LBRSLT=''*N='N' LBRSLT=''*MEAN='MEAN' LBRSLT=''*MEDIAN='MEDIAN' LBRSLT=''*STD='STD' LBRSLT=''*MIN='MIN' LBRSLT=''*MAX='MAX' / printmiss; Run; 8

/* Create Dummy variables for each expected statistics */ Data HDL1; Set HDL; N=LBRSLT; MEAN=LBRSLT; MEDIAN=LBRSLT; STD=LBRSLT; MIN=LBRSLT; MAX=LBRSLT; Run; 9 Proc Report Data=hdl1 completerows nowd; Format SEX sex. RANGE range.; Column SEX RANGE N MEAN MEDIAN STD MIN MAX; Define SEX / order = internal group preloadfmt; Define RANGE / order = internal group preloadfmt; Define N / analysis n; Define MEAN / analysis mean; Define MEDIAN / analysis median; Define STD / analysis std; Define MIN / analysis min; Define MAX / analysis max; Run;

10

11 Conclusion  Reduction of unnecessary data manipulation and hard coding  PRELOADFMT: Taking care of user defined formats  Code efficient and less time consuming

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 registered trademarks or trademarks of their respective companies. 12

 Name: NIRAJ J. PANDYA Phone:

14