Never Cut and Paste Again

Slides:



Advertisements
Similar presentations
DIVERSE REPORT GENERATION By Chris Speck PAREXEL International Durham, NC.
Advertisements

The INFILE Statement Reading files into SAS from an outside source: A Very Useful Tool!
Outline Proc Report Tricks Kelley Weston. Outline Examples 1.Text that spans columnsText that spans columns 2.Patient-level detail in the titlesPatient-level.
Management Reporter By Zara Beckstein/Matt Saad. Basic Navigation Similar to GP 2013 R2 windows, there is a Navigation Pane in the lower left. This will.
Data Dictionary What does “Backordered item” mean? What does “New Customer info.” contain? How does the “account receivable report” look like?
Developing Effective Reports
A Simple Guide to Using SPSS© for Windows
Basic And Advanced SAS Programming
Let SAS Do the Coding for You! Robert Williams Business Info Analyst Sr. WellPoint Inc.
Understanding SAS Data Step Processing Alan C. Elliott stattutorials.com.
Developing Effective Reports
IS 320 Notes for Chapter 8. ClassX Problems: Low-Tech Fix Use last year's videos on ClassX  Select "Semesters" tab  Select IS 320  Select the week/lecture.
Data Analysis Using SPSS
Independent Samples t-Test (or 2-Sample t-Test)
Multiple Uses for a Simple SQL Procedure Rebecca Larsen University of South Florida.
Chapter 1: Introduction to SAS  SAS programs: A sequence of statements in a particular order  Rules for SAS statements: –Every SAS statement ends in.
Lesson 2 Topic - Reading in data Chapter 2 (Little SAS Book)
Introduction to SAS/Graph 9.2 Ken Barz Colorado Prevention Center 22Oct2009 Ken Barz Colorado Prevention Center.
XP. Objectives Sort data and filter data Summarize an Excel table Insert subtotals into a range of data Outline buttons to show or hide details Create.
Chapter 22: Using Best Practices 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Priya Ramaswami Janssen R&D US. Advantages of PROC REPORT -Very powerful -Perform lists, subsets, statistics, computations, formatting within one procedure.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 8 – Adding and.
11/25/2015Slide 1 Scripts are short programs that repeat sequences of SPSS commands. SPSS includes a computer language called Sax Basic for the creation.
Lecture 4 Ways to get data into SAS Some practice programming
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.
Copyright © 2004, SAS Institute Inc. All rights reserved. SASHELP Datasets A real life example Barb Crowther SAS Consultant October 22, 2004.
Patrick Thornton SRI International.  Example of a Multiple Response Item ◦ Variable coding and example data  A Cross Tabulation using Proc REPORT 
Using Dictionary Tables to Profile SAS Datasets By Phillip Julian February 11, 2011.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
Based on Learning SAS by Example: A Programmer’s Guide Chapters 1 & 2
Online Programming| Online Training| Real Time Projects | Certifications |Online Classes| Corporate Training |Jobs| CONTACT US: STANSYS SOFTWARE SOLUTIONS.
Excel Class Outline What is a spreadsheet? What can you do with them? The Cell - basic unit of a spreadsheet Making a Table - cells in Rows and Columns.
Copyright 2009 The Little Engine That Could: Using EXCEL LIBNAME Engine Options to Enhance Data Transfers between SAS® and Microsoft® Excel Files William.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 14 & 19 By Tasha Chapman, Oregon Health Authority.
Reporting The Facts: The ODSmemo macro suite for making reproducible RTF memos within SAS® Rocio Lopez Cleveland Clinic.
Better Metadata Through SAS® II: %SYSFUNC, PROC DATASETS, and Dictionary Tables.
If sig is less than 0.05 (A) then the test is significant at 95% confidence (B) then the test is significant at 90% confidence (C) then the test is significant.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 3 & 4 By Tasha Chapman, Oregon Health Authority.
Introduction to the SPSS Interface
Chapter 5: Enhancing Your Output with ODS
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Loops BIS1523 – Lecture 10.
Introduction to SPSS.
EVOLUTION FROM EXCEL PIVOT TABLES TO
SAS Programming Introduction to SAS.
Basic Queries Specifying Columns
Customization
Some ways to encourage quality programming
Dale Rhoda & Mary Kay Trimner Stata Conference 2018
Chapter 1: Introduction to SAS
Instructor: Raul Cruz-Cano
Conditional Processing
SAS Essentials How SAS Thinks
Introduction to SAS A SAS program is a list of SAS statements executed in order Every SAS statement ends with a semicolon! SAS statements can be in caps.
A SAS macro to check SDTM domains against controlled terminology
Beautiful PROC CONTENTS Output Using the ODS Excel Destination
How to Create Data Driven Lists
Hunter Glanz & Josh Horstman
Introduction to DATA Step Programming: SAS Basics II
Lisa Mendez, PhD & Andrew Kuligowski
Dictionary Tables and Views, obtain information about SAS files
Lesson 1 Notes Chapter 6.
Lab 2 HRP223 – 2010 October 18, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
Detecting Runtime Errors and Exiting from Nested Macros Gracefully
Creating BDS DERIVED Parameters for a Subject-level Frequency Summary Table? Then this macro can be useful.
Automating SAS through the Power of VB Script
Passing Simple and Complex Parameters In and Out of Macros
By A.Arul Xavier Department of mathematics
Introduction to the SPSS Interface
Presentation transcript:

Never Cut and Paste Again How to Automate Results with ODS PowerPoint, Metadata and Macros

What’s the Problem? SAS creates dataset, reports, charts, etc. Clients (internal and external) want presentations Clients always want report re-run Cutting, pasting, and re-formatting is: Time consuming Error prone Boring…

Learning Objectives Create PowerPoint® files using the SAS® PowerPoint ODS Create macros to automatically calculate descriptive statistics on all variables in a dataset using the DICTIONARY.COLUMNS dataset Send reporting elements (tables and chart) to PowerPoint presentation files

Outline Healthcare claims data structures Create fact tables from healthcare data Create results table with descriptive statistics Create PowerPoint file Create tables in PowerPoint using PROC REPORT Create charts in PowerPoint using PROC SGPLOT

What’s In, What’s Out Conference white paper has a step-by-step walkthrough of all of the code Presentation will touch on the key concepts and syntax

Healthcare Data Structures Paid bills (aka administrative claims data) Transactional data One observation per claim Disparate dataset Pharmacy Claims (e.g. paid bills for prescriptions) Medical Claims (e.g. paid bills for hospital stay)

Create Fact Table From Healthcare Data Commonly used in data warehouses Create a single observation per entity (patient) Add study measures Total paid Total Claims etc.

Create Fact Table From Healthcare Data PROC SQL; CREATE TABLE Fact AS SELECT PatientID, DateOfBirth , Gender FROM Medical UNION SELECT FROM Pharmacy ; QUIT;

Limitations of Variable Names Too Short (32 characters) Limited Character Set (no spaces, leading number, etc.) e.g. Baseline Allowed Amount Per Member Per Month for Inpatient Hospitalizations Due to Chronic Obstructive Pulmonary Disease becomes BaseAAPMPMInptHospCOPD

Variable Label Property 256 Characters Larger character set DATA Fact; SET Fact; ATTRIB DateOfBirth LABEL = "Date Of Birth" ; RUN;

Overloading the Variable Name Overloading the variable name with a prefix BASE_ for Baseline data FLUP_ for Follow Up data Used by macro to identify reportable values

Study Measure Macros Builds a reusable library %Macro AssignRxCount(Dataset=); *Create Variable with a Label; DATA &Dataset; SET &Dataset; ATTRIB FLUP_RxCount LENGTH = 8 FORMAT = COMMA9. LABEL = "Total Number of Prescriptions"; RUN; *Populate the Fact table value; PROC SQL; UPDATE &Dataset f SET FLUP_RxCount = ( SELECT COUNT(AmountPaid) FROM Pharmacy p WHERE p.PatientID = f.PatientID); QUIT; %mend; Builds a reusable library Couples the variable creation and population Iterate through the measures

Completed Fact Table

Iterate Through Metadata proc sql ; SELECT Name, Type INTO :MeasureVariable1-MeasureVariable9999, :MeasureType1-:MeasureType9999 FROM DICTIONARY.Columns WHERE LibName = "&FactLib" and MemName = "&FactDS" AND (Name like"BASE%" or Name like"FLUP%") ; quit; %let MeasureCounter = &SqlObs; %DO ctr = 1 %to &MeasureCounter; … %END DICTIONARY.COLUMNS contains every variable in every dataset in every library Load each variable name and type into an array Loop through the array and summarize the data

Summarize Based on Data Type %IF &&MeasureType&ctr = char %then %do; %AddCategoricalResults( Library=&FactLib, Dataset=&FactDS, Variable=&&MeasureVariable&ctr ); %end; %else %if &&MeasureType&ctr = num %then %AddContinuousResults( Call a different summarizing macro based on the data type char data = #(%) num data = Mean(median)[SD]

Results Table

Advantages of Results Table PowerPoint generation is independent of fact table variables Everything needed is in the results table Results formatting is completed, no need to check metadata All project-specific data structures have been translated into a standard format

Create PowerPoint file Two statements are minimum Any PROC sending data to the results window will send results to PowerPoint …but the devil is in the details… ODS PowerPoint ; /* Any PROC sending output to the results window */ ODS PowerPoint Close;

PowerPoint ODS Lessons Learned FILE = <Any Valid File Path> LAYOUT=TitleAndContent OPTIONS PAPERSIZE=(10in 5.63in) Control other style properties in PROCs vs. PowerPoint ODS Wide PowerPoint Tables => $()*#&@!! Control width with font size

Output Results with Data Type Specific Macros Create a separate macros for Numeric Character Can be expanded to consider Format Currency Dates pValue Nominal vs. Ordinal Distribution

White Paper Code Output Sample

White Paper Code Output Sample

Sample from Magellan Method Different colored header section Banded rows Custom column headers with population sizes Bolded rows for significant p values

Conclusions Variable labels, formats and overloaded variable names can be used by macros to automate descriptive statistics for dozens, even thousands of measures ODS PowerPoint can be used to send the results of any PROC to a PowerPoint file Tables with PROC REPORT or PROC TABULATE Charts with PROC SGPLOT

Contact Information Name: Ted D. Williams, PharmD, BCPS Company: Magellan Method City/State: Middletown, RI Phone:314.387.4305 Email:tdwilliams1@magellanhealth.com