An Introduction to Proc Transpose. David P. Rosenfeld HR Consultant, Workforce Planning & Data Management City of Toronto

Similar documents
Advisory Committee on Long-Term Care Homes and Services

1 A similar approach is described by Karp (2003) 2 National center for Health Statistics (NCHS)

Using Macro in SAS to Calculate Kappa and 95% CI for Several Pairs of Nurses of Chemical Triage

UNIVERSITY OF THE WEST INDIES OPEN CAMPUS INFORMATION TECHNOLOGY SCHOOL BASED ASSESSMENT

Paper PO-01 Using SAS to Examine Social Networking Difference between Faculty and Students

Technical Notes for HCAHPS Star Ratings (Revised for October 2017 Public Reporting)

Analyzing Hospital Episode Statistics Dataset: How Much Does SAS Help?

Using SAS Programing to Identify Super-utilizers and Improve Healthcare Services

Technical Notes for HCAHPS Star Ratings (Revised for April 2018 Public Reporting)

HOSPICE QUALITY REPORTING PROGRAM

PAUL HARRIS SOCIETY FREQUENTLY ASKED QUESTIONS

Paper PO 53. Reporting of treatment emergent adverse events based on pooled data Analysis or Country Specific Submissions: A case study

Pharmacy Services - Homes for the Aged

2011 PCMH Element 2D or 2014 PCMH Element 3D: Use Data for Population Management

The Metamorphosis of a Study Design Marge Scerbo, CHPDM/UMBC Craig Dickstein, Intellicisions Data Inc.

Raiser s Edge: How To Query Constituent Giving With A Cumulative Total Including Soft Credits

Grant Reporting for Faculty Grant Expense Detail

UN I-PRO: A SYSTEM TO SCREEN LARGE HEALTH CARE DATA SETS USING SAS' William J. McDonald J. Jon Veloski Harper Consulting Group

10.3 PR 01 HUD Grants and Program Income

Retirement Manager Disbursement Monitoring Plan Administrator User Guide

WHAT IS EQ-5D: INTRODUCTION:

Vanderbilt University Medical Center

Career Pathway Management Conference 2017

State of Nebraska DHHS- Division of Developmental Disabilities

Advance MS Excel Training Plan

HELP - MMH Plus (WellPoint Member Medical History Plus System) 04/12/2014

UNIVERSITY OF PETROLEUM & ENERGY STUDIES Dehradun INFORMATION FORM FOR DUPLICATE ID CARD. (Kindly fill all the details in Capital Letters only)

Sevocity v.12 Patient Reminders User Reference Guide

How to Access and Navigate Cognos Query Studio

Concatenating. Concatenation: Vertical combination or chaining of data sets. General form of data step:

ORIS Reports User Guide Catalog of Reports Coeus Premium Dated: October 22, 2013

INSITE : Medication Management for Long-Term Care

PCC's Dashboard has the ability to easily generate lists of patients overdue for well child visits

PET TRUST VET PORTAL TABLE OF CONTENTS

Nursing and Personal Care: Funding Increase Survey

Quality Improvement Medication Reconciliation Tools, Techniques and Tales

Maine Nursing Forecaster

WRHA Immunization Services General Roles and Responsibilities

PROCESS PLANT DESIGN (PPD)

Validation Process for Student Nurse Documentation

Model VBP FY2014 Worksheet Instructions and Reference Guide

2006 Survey of Active-Duty Spouses

Disaster Recovery Grant Reporting System (DRGR) MicroStrategy Standard Reports Reference Guide. DRGR Release July 2009

1.1 Please indicate below if any aspect of the service is legally mandated by any of the following and provide the relevant reference.

Chapter 8: Managing Incentive Programs

Digital Innovation, Inc. Report Writer Standard Reports Dictionary 2017

Data, Research and Federal Policy

MiTIP, the Metropolitan Indianapolis Transportation Program : Beyond the Spreadsheets in the 21 st Century

The data files have not yet been checked for duplicate or problem records.

Paper LS-197 Evaluating Sociodemographic and Geographic Disparities of Hypertension in Florida using SAS

SONOMA STATE UNIVERSITY CAREER SERVICES

Registry Evaluation Form

Jeffress Trust Awards Program in Interdisciplinary Research Frequently Asked Questions FAQs ( ) Eligibility

Incumbent Worker Training Program 2003/2004 Guidelines & Application

Interfaith Council Social Action Committee of Sun City Center, Florida Instructions for Grant Application Form

Waco Independent School District

NOTE TO USERS NI 67xx Pinout Labels for the SCB-68A Analog Output Modules/Devices Using the 68-Pin Shielded Connector Block

SNF QUALITY REPORTING PROGRAM

AHP Online Project Completion Guide Sponsor Instructions Homeownership Projects

Explore Fatigue Essentials A Seminar for Fatigue Users Tired of Spreadsheets. Kyle Hamilton Staff Mechanical Engineer Chris Johnson Program Developer

Lantern Health CIC is a Community Interest Company - Social Enterprise. There is one executive Director: Dr Clare Davison

AWCTS SYSTEM RELEASE NOTES

Long Term Care Initiatives in Ontario. Kris Wichman Project Leader LTC June 2005

Table of Contents. For additional information or assistance: Contact: Andrea Bradley, or

Tips for Entering Match into GEARS

Advanced Travel/Reimbursement Training

Focus on 2025 A 10-year Middle-Skill Occupational Outlook for California

Chapter One. Globalization

AWCTS SYSTEM RELEASE NOTES

Get Started with Health Cloud

RxStation: Cerner s Medication Dispensing Cabinet

RETRIEVAL AND CRITICAL HEALTH INFORMATION SYSTEM

Determinants of HIV Treatment Costs in Developing Countries

Section Items to check Yes No. /letter from Centre Director (internal only, not sent to ARC)

* WELCOME TO THE GCRC CENSUS * * SYSTEM *

NCLEX Administration Website Boards of Nursing/ Regulatory Body Guide Version

Online Panel shortlisting

Overview of Recovery Act, Section 1512 Reporting

A Standardized Approach to De-Identification

Run Management Reports Tutorial

Afghanistan Health Sector Balanced scorecard A TOOLKIT TO CALUTATE THE INDICATORS

Accounts Payable. A written procedure to process invoice(s) for payment.

Coordinated Transit Consultation Meetings SmartTrack, GO RER, Relief Line, Scarborough Subway Extension June 13, 2015 Highlights Report

Integrated Disbursement and Information System (IDIS) Online

Application Deadlines:

Clinician Roster Information System (CRIS)

CAHPS Hospital Survey Podcast Series Transcript

Discretionary Grants: Call for Applications for Non-Governmental Organisation (NGOs) to upskill their employees in short skills programmes

READMISSION ROOT CAUSE ANALYSIS REPORT

CMTS FAQ. Frequently Asked Questions about CMTS. Technical:

Credits & Incentives talk with Deloitte California employment training panel. By Kevin Potter, Bruce Kessler and Lesley Miller Deloitte Tax LLP

Methods to Prepare Hospital Discharge Data

The Intangible Capital of Serial Entrepreneurs

Catalogue of services

US 290 DOING MORE WITH LESS. Michael E. Carlson, P.E. TxDOT Houston District Bridge Design. TTI Short Course TxDOT Houston District Bridge

Saskatchewan. Labour Demand Outlook 2017 to Fall 2017

Why SGI Contributes $91.4 billion annually to the state s

UW Madison 2012 Summer Appointments Funding Setup

Researchfish Administrator Dashboard Guidance Notes

National IP Awards- 2018

Transcription:

An Introduction to Proc Transpose David P. Rosenfeld HR Consultant, Workforce Planning & Data Management City of Toronto

YEAR HOME POSITION 2006 Seven Oaks PRACTICAL CARE AIDE 2006 Cummer Lodge PRACTICAL CARE AIDE 2006 True Davidson Acres REGISTERED PRACTICAL NURSE 2006 Kipling Acres PRACTICAL CARE AIDE 2006 Bendale Acres CLEANER HEAVY DUTY 2006 Fudger House PRACTICAL CARE AIDE 2006 Castleview-Wychwood REGISTERED NURSE HOMES & HOSTELS 2006 Admin. and Sup. Services SUPPORT ASSISTANT C 2006 Lakeshore Lodge FOOD SERVICES WORKER 2006 Wesburn Manor CLEANER HEAVY DUTY 2006 Carefree Lodge REGISTERED NURSE HOMES & HOSTELS 2006 True Davidson Acres PRACTICAL CARE AIDE 2006 Wesburn Manor PRACTICAL CARE AIDE 2006 Bendale Acres SUPPORT ASSISTANT C 2006 Castleview-Wychwood PRACTICAL CARE AIDE 2006 Carefree Lodge FOOD SERVICES WORKER 2006 Seven Oaks REGISTERED PRACTICAL NURSE 2006 True Davidson Acres REGISTERED PRACTICAL NURSE 2007 Fudger House PRACTICAL CARE AIDE 2007 Seven Oaks REGISTERED NURSE 2007 Castleview-Wychwood PRACTICAL CARE AIDE 2007 Cummer Lodge PRACTICAL CARE AIDE 2007 True Davidson Acres PRACTICAL CARE AIDE 2007 Cummer Lodge PRACTICAL CARE AIDE 2007 Cummer Lodge PRACTICAL CARE AIDE 2007 Cummer Lodge PRACTICAL CARE AIDE 2007 Kipling Acres REGISTERED NURSE HOMES & HOSTELS 2007 Seven Oaks PRACTICAL CARE AIDE 2007 Castleview-Wychwood FOOD SERVICES WORKER 2007 Fudger House CLEANER HEAVY DUTY 2007 Cummer Lodge PRACTICAL CARE AIDE 2007 Seven Oaks FOOD SERVICES WORKER 2007 Cummer Lodge CLEANER HEAVY DUTY 2007 Carefree Lodge ADMINISTRATOR 2007 Castleview-Wychwood PRACTICAL CARE AIDE 2007 Cummer Lodge PRACTICAL CARE AIDE 2007 True Davidson Acres PRACTICAL CARE AIDE

YEAR HOME COUNT PERCENT 2006 Admin. and Sup. Services 3 1.7857 2006 Adult Day Centres 1 0.5952 2006 Bendale Acres 16 9.5238 2006 Carefree Lodge 12 7.1429 2006 Castleview-Wychwood 16 9.5238 2006 Cummer Lodge 18 10.7143 2006 Executive Office 1 0.5952 2006 Fudger House 15 8.9286 2006 Kipling Acres 19 11.3095 2006 Lakeshore Lodge 17 10.1190 2006 Seven Oaks 22 13.0952 2006 True Davidson Acres 19 11.3095 2006 Wesburn Manor 9 5.3571 2007 Admin. and Sup. Services 3 1.4634 2007 Bendale Acres 24 11.7073 2007 Carefree Lodge 11 5.3659 2007 Castleview-Wychwood 24 11.7073 2007 Cummer Lodge 35 17.0732 2007 Executive Office 1 0.4878 2007 Fudger House 18 8.7805 2007 Kipling Acres 23 11.2195 2007 Lakeshore Lodge 12 5.8537 2007 Regional Services 1 0.4878 2007 Seven Oaks 29 14.1463 2007 Supportive Housing 1 0.4878 2007 True Davidson Acres 18 8.7805 2007 Wesburn Manor 5 2.4390 2008 Admin. and Sup. Services 3 1.1070 2008 Adult Day Centres 1 0.3690 2008 Bendale Acres 41 15.1292 2008 Carefree Lodge 8 2.9520 2008 Castleview-Wychwood 32 11.8081 2008 Cummer Lodge 47 17.3432 2008 Executive Office 1 0.3690 2008 Fudger House 20 7.3801 2008 Kipling Acres 31 11.4391 2008 Lakeshore Lodge 23 8.4871 2008 Regional Services 2 0.7380 2008 Seven Oaks 27 9.9631 2008 True Davidson Acres 18 6.6421 2008 Wesburn Manor 17 6.2731

* Without proc transpose, you have the drudgery of doing this fifteen times, and knowing all possible values in advance, annoying even with a macro. *; data col2; set home_count; if home='bendale Acres'; format Bendale_Acres 5.; Bendale_Acres = count; keep year Bendale_Acres; *... *; data outcome; merge col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15; by year;

PROC TRANSPOSE <DATA=input-data-set> <LABEL=label> <LET> <NAME=name> <OUT=output-data-set> <PREFIX=prefix>; BY <DESCENDING> variable-1 <...<DESCENDING> variable-n> <NOTSORTED>; COPY variable(s); ID variable; IDLABEL variable; VAR variable(s);

proc sort data=sasuser.tass_demo; by year; proc freq data=sasuser.tass_demo; by year; tables home/noprint list out=home_count; /* additional tables possible. */ data home_count; set home_count; format count 5.; PROC EXPORT DATA= WORK.home_count OUTFILE= "C:\sas\code\tass\proc_freq_output.dbf" DBMS=DBF REPLACE; RUN; /* output of proc freq before transposition. */

* Now transpose the table with proc transpose. *; * By variables are not transposed. *; * The value of the id variable becomes the column name. Is converted to SAS-friendly variable name if necessary. *; * The var variable (could be more than one) is the dependent variable, and is mapped to the column. *; proc transpose data=home_count out=home_count_transposed ; by year ; id home; var count; run; data home_count_transposed (drop=_name label_); /* the name and label of the variable that held the values now mapped to the columns. */ retain year Bendale_Acres Carefree_Lodge Castleview_Wychwood Cummer_Lodge Executive_Office Fudger_House Kipling_Acres Lakeshore_Lodge Seven_Oaks True_Davidson_Acres Wesburn_Manor Admin and_sup Services Adult_Day_Centres Regional_Services Supportive_Housing; /* Only use retain statement if column sequence matters. */ set home_count_transposed; * Now output to spreadsheet with proc export. *; PROC EXPORT DATA= WORK.home_count_transposed OUTFILE= "c:\sas\code\tass\ltc_departures.xls" DBMS=EXCEL REPLACE; SHEET="Home"; RUN;

110 proc freq data=sasuser.tass_demo; by year; 111 tables home/noprint list out=home_count; /* additional tables possible. */ 112 NOTE: There were 644 observations read from the data set SASUSER.TASS_DEMO. NOTE: The data set WORK.HOME_COUNT has 41 observations and 4 variables. NOTE: PROCEDURE FREQ used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 113 data home_count; 114 set home_count; 115 format count 5.; 116 NOTE: There were 41 observations read from the data set WORK.HOME_COUNT. NOTE: The data set WORK.HOME_COUNT has 41 observations and 4 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds

117 PROC EXPORT DATA= WORK.home_count 118 OUTFILE= "C:\sas\code\tass\proc_freq_output.dbf" 119 DBMS=DBF REPLACE; NOTE: "C:\sas\code\tass\proc_freq_output.dbf" was successfully created. NOTE: PROCEDURE EXPORT used (Total process time): real time 0.09 seconds cpu time 0.00 seconds 120 RUN; /* output of proc freq before transposition. */ 121 122 * Now transpose the table with proc transpose. *; 123 * By variables are not transposed. *; 124 * The value of the id variable becomes the column name. Is converted to SAS-friendly variable name if necessary. *; 125 * The var variable (could be more than one) is the dependent variable, and is mapped to the column. *; 126 127 proc transpose data=home_count out=home_count_transposed ; 128 by year ; 129 id home; 130 var count; 131 run; NOTE: There were 41 observations read from the data set WORK.HOME_COUNT. NOTE: The data set WORK.HOME_COUNT_TRANSPOSED has 3 observations and 18 variables. NOTE: PROCEDURE TRANSPOSE used (Total process time): real time 0.01 seconds cpu time 0.01 seconds

132 133 data home_count_transposed 134 (drop=_name label_); /* the name and label of the variable that held the values now mapped to the columns. */ 135 retain year Bendale_Acres Carefree_Lodge Castleview_Wychwood Cummer_Lodge Executive_Office Fudger_House 136 Kipling_Acres Lakeshore_Lodge Seven_Oaks True_Davidson_Acres Wesburn_Manor Admin and_sup Services Adult_Day_Centres 137 Regional_Services Supportive_Housing; /* Only use retain statement if column sequence matters. */ 138 set home_count_transposed; 139 * Now output to spreadsheet with proc export. *; NOTE: There were 3 observations read from the data set WORK.HOME_COUNT_TRANSPOSED. NOTE: The data set WORK.HOME_COUNT_TRANSPOSED has 3 observations and 16 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 140 PROC EXPORT DATA= WORK.home_count_transposed 141 OUTFILE= "c:\sas\code\tass\ltc_departures.xls" 142 DBMS=EXCEL REPLACE; 143 SHEET="Home"; 144 RUN; NOTE: New file "c:\sas\code\tass\ltc_departures.xls" will be created if the export process succeeds. NOTE: "Home" was successfully created. NOTE: PROCEDURE EXPORT used (Total process time): real time 0.46 seconds cpu time 0.09 seconds

YEAR BENDALE_ACRES CAREFREE_LODGE CASTLEVIEW_WYCHWOOD CUMMER_LODGE EXECUTIVE_OFFICE 2006 16 12 16 18 1 2007 24 11 24 35 1 2008 41 8 32 47 1 FUDGER_HOUSE KIPLING_ACRES LAKESHORE_LODGE SEVEN_OAKS TRUE_DAVIDSON_ACRES 15 19 17 22 19 18 23 12 29 18 20 31 23 27 18 WESBURN_MANOR ADMIN AND_SUP ADULT_DAY_CENTRES REGIONAL_SERVICE SUPPORTIVE_HOUSING 9 3 1 5 3 1 1 17 3 1 2

Thanks!