Chapter 24 Formatting Variables and Values. Chapter Table of Contents ASSIGNING FORMATS CREATING FORMATS...359

Similar documents
Chapter 32 Histograms and Bar Charts. Chapter Table of Contents VARIABLES METHOD OUTPUT REFERENCES...474

Chapter 2 The Data Table. Chapter Table of Contents

Chapter 6 INTERVALS Statement. Chapter Table of Contents

Chapter 25 Specifying Forecasting Models

9.1 SAS. SQL Query Window. User s Guide

Chapter 27 Using Predictor Variables. Chapter Table of Contents

SAS University Edition: Installation Guide for Amazon Web Services

User Installation Guide for SAS 9.1 Foundation for 64-bit Microsoft Windows

UNIX Operating Environment

9.1 SAS/ACCESS. Interface to SAP BW. User s Guide

OS/2: TELNET Access Method

SAS BI Dashboard 4.4. User's Guide Second Edition. SAS Documentation

SAS. Cloud. Account Administrator s Guide. SAS Documentation

SAS Visual Analytics 7.1 for SAS Cloud. Quick-Start Guide

Guide to Operating SAS IT Resource Management 3.5 without a Middle Tier

DBF Chapter. Note to UNIX and OS/390 Users. Import/Export Facility CHAPTER 7

SAS Task Manager 2.2. User s Guide. SAS Documentation

Statgraphics Getting started

SAS Marketing Automation 5.1. User s Guide

Encryption Services. What Are Encryption Services? Terminology. System and Software Requirements APPENDIX 5

SAS Business Data Network 3.1

SAS Add-In 2.1 for Microsoft Office: Getting Started with Data Analysis

SAS/GRAPH 9.2 ODS Graphics Editor. User s Guide

SAS BI Dashboard 4.3. User's Guide. SAS Documentation

IBM SPSS Statistics for Beginners for Windows

Using SPSS, Chapter 2: Descriptive Statistics

OnDemand for Academics

SAS/GRAPH Network Visualization Workshop 2.1

Analyzing the Server Log

Job Aid. Update Bank Accounts and Pay Distribution Instructions

Summary of important mathematical operations and formulas (from first tutorial):

When to Move a SAS File between Hosts

T201 - SEARCHING FOR MONEY

Gestation Period as a function of Lifespan

IT Service Level Management 2.1 User s Guide SAS

Guide to SAS/AF Applications Development

Overview. NT Event Log. CHAPTER 8 Enhancements for SAS Users under Windows NT

SAS 9.4 PC Files Server

Smart Web. User Guide. Amcom Software, Inc.

Build Your First Web-based Report Using the SAS 9.2 Business Intelligence Clients

TRAINING MANUAL. Executing Reports. Formatting Options. Copyright 2004 University of San Diego. All rights reserved.

SAS University Edition: Installation Guide for Linux

Directions for Frequency Tables, Histograms, and Frequency Bar Charts

How To Use Spss

Pipeliner CRM Phaenomena Guide Opportunity Management Pipelinersales Inc.

Welcome to the First Step Webinar!

CHAPTER 7 INTRODUCTION TO SAMPLING DISTRIBUTIONS

InfiniteInsight 6.5 sp4

Qlik REST Connector Installation and User Guide

Sendspace Wizard Desktop Tool Step-By-Step Guide

Licensed to: CengageBrain User

Welcome to GIFTS Online Mobile... 3

Pipeliner CRM Phaenomena Guide Lead Management Pipelinersales Inc.

Features for France. Microsoft Corporation. Published: November 2006

There are six different windows that can be opened when using SPSS. The following will give a description of each of them.

SAS University Edition: Installation Guide for Windows

Paper Getting to the Good Part of Data Analysis: Data Access, Manipulation, and Customization Using JMP

Absorbance Spectrophotometry: Analysis of FD&C Red Food Dye #40 Calibration Curve Procedure

Complete the Payroll Transfer Form

4 Other useful features on the course web page. 5 Accessing SAS

SEND AND RETRIEVE INFORMATION USING

January 26, 2009 The Faculty Center for Teaching and Learning

4. Descriptive Statistics: Measures of Variability and Central Tendency

STATGRAPHICS Online. Statistical Analysis and Data Visualization System. Revised 6/21/2012. Copyright 2012 by StatPoint Technologies, Inc.

Integrating Microsoft Word with Other Office Applications

Add-In 7.1 for Microsoft Office

Accounts Payable Workflow Guide. Version 11.2

TheFinancialEdge. Configuration Guide for General Ledger

MS Excel. Handout: Level 2. elearning Department. Copyright 2016 CMS e-learning Department. All Rights Reserved. Page 1 of 11

EXCEL SPREADSHEET MANUAL

Data Analysis Tools. Tools for Summarizing Data

Years after US Student to Teacher Ratio

PowerSchool Parent Portal User Guide. PowerSchool 7.x Student Information System

ABSTRACT INTRODUCTION EXERCISE 1: EXPLORING THE USER INTERFACE GRAPH GALLERY

WebSphere Business Monitor V6.2 KPI history and prediction lab

élan Mira WiFi Wireless Communication User Guide

Standard & Poor s Research Insight Getting Started (Global) By Standard & Poor s

Google Sites. How to create a site using Google Sites

Using an Automatic Back Up for Outlook 2003 and Outlook 2007 Personal Folders

Credit Card Processing

Directions for the AP Invoice Upload Spreadsheet

VMware vcenter Log Insight User's Guide

Microsoft Excel Basics

Microsoft Office Live Meeting Events User s Guide

Merging Labels, Letters, and Envelopes Word 2013

Prism 6 Step-by-Step Example Linear Standard Curves Interpolating from a standard curve is a common way of quantifying the concentration of a sample.

Microsoft Excel 2013: Using a Data Entry Form

Petrel TIPS&TRICKS from SCM

PharmaSUG Paper QT26

The first thing to do is choose if you are creating a mail merge for printing or an merge for distribution over .

Excel 2007 Basic knowledge

Microsoft Excel Tips & Tricks

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

SAS BI Dashboard 3.1. User s Guide

StarWind iscsi SAN Software: Installing StarWind on Windows Server 2008 R2 Server Core

How to Create and Manage Alerts

Time & Expense Entry WalkThrough

Microsoft Dynamics GP. SmartList Builder User s Guide With Excel Report Builder

Interact for Microsoft Office

Appendix III: SPSS Preliminary

Transcription:

Chapter 24 Formatting Variables and Values Chapter Table of Contents ASSIGNING FORMATS...352 CREATING FORMATS...359 349

Part 2. Introduction 350

Chapter 24 Formatting Variables and Values Formats determine how variables and values are displayed. In group variables and model effects, formats can also determine how values are used in calculations. You can use formats to set the width of displayed values, the number of decimal points displayed, the handling of blanks, zeroes, and commas, and other details. The SAS System provides many standard formats for displaying character and numeric values. In addition, you can use the FORMAT procedure to create your own formats. Figure 24.1. Assigning a Format 351

Part 2. Introduction Assigning Formats By default, SAS/INSIGHT software displays each variable using the format supplied in your SAS data set. If your data set contains numeric variables with no formats, SAS/INSIGHT software chooses a format based on that variable s values. When you save the data, formats chosen by SAS/INSIGHT software are not automatically saved, but any formats you assign are saved. You can assign formats by using the Edit:Formats menu. =) Open the BASEBALL data set. This data set contains statistics and salaries of major league baseball players. =) Select the variable SALARY. Figure 24.2. SALARY Selected =) Choose Edit:Formats:9.1. File Edit Analyze Tables Graphs Curves Vars Help Figure 24.3. Windows Variables Observations Formats Copy Delete 8.0 9.1 10.2 11.3 12.4 13.5 14.6 E12. Other... Edit:Formats Menu 352

Chapter 24. Assigning Formats This gives the variable SALARY a width of nine character positions, including the decimal and one position after the decimal. The actual data values for SALARY continue to be stored with double precision. Figure 24.4. Format 9.1 =) Choose Edit:Formats:E12. This gives the variable SALARY a width of 12 character positions and expresses each value in exponential notation. Figure 24.5. Format E12. The Edit:Formats menu provides quick access to frequently used formats. There are many other standard formats provided by the SAS System. =) Choose Edit:Formats:Other. 353

Part 2. Introduction File Edit Analyze Tables Graphs Curves Vars Help Figure 24.6. Windows Variables Observations Formats Copy Delete 8.0 9.1 10.2 11.3 12.4 13.5 14.6 E12. Other... Edit:Formats Menu This displays the Format dialog. In the dialog, the fields w and d specify the width and decimal places to be used by the formats. Note that the SALARY variable and the E12. format are currently selected. Figure 24.7. Format Dialog =) Select DOLLARw.d in the Format list. Formats are listed alphabetically, so the DOLLARw.d format is above the Ew. format. 354

Chapter 24. Assigning Formats Figure 24.8. Format DOLLARw.d The example in the upper right corner of the dialog illustrates the format you have selected. DOLLAR is the standard format for display of currency in the United States. There is also a DOLLARX format sometimes preferred in European countries. =) Click OK to set the format you prefer. Figure 24.9. SALARY Formatted Now the variable SALARY uses the format you assigned. By default, this format is also used for axes in subsequent analyses. You can modify the axes, however, to use other formats. =) Choose Analyze:Distribution ( Y ). This creates a distribution analysis of SALARY. The box plot and histogram axes use the format you assigned to the SALARY variable in the data window. =) Select SALARY in the distribution window. 355

Part 2. Introduction Figure 24.10. Distribution Analysis, SALARY Selected =) Choose Edit:Formats:8.0. This assigns the 8.0 format to SALARY on axes in the distribution window. In the data window, SALARY continues to use the DOLLAR format. 356

Chapter 24. Assigning Formats Figure 24.11. SALARY Axes Formatted You can also format individual values in analysis tables. For example, suppose you need to see greater precision for the mean and standard deviation. =) Select the values for Mean and Std Dev in the Moments table. 357

Part 2. Introduction Figure 24.12. Moments Table, Values Selected =) Choose Edit:Formats:14.6. Now the mean and standard deviation show six digits after the decimal. Figure 24.13. Moments Table, Values Formatted 358

Chapter 24. Creating Formats Creating Formats Although there are many formats available in the SAS System, occasionally you will want to create your own. To do this, use the FORMAT procedure. For example, suppose you want to consider certain groupings of baseball players based on the length of their careers. You can combine the values of YR MAJOR into four groups, as follows. =) Enter PROC FORMAT statements in the Program Editor. Figure 24.14. Program Editor =) Choose Run:Submit. File Edit View Tools Run Solutions Help Figure 24.15. Run Menu =) Select YR MAJOR. Submit Recall Last Submitted Submit Top Line Submit N Lines... Submit Clipboard Signon... Remote Submit... Remote Get Remote Display Signoff... 359

Part 2. Introduction Figure 24.16. YR MAJOR Selected =) Choose Edit:Formats:Other. This displays the Format Dialog. Figure 24.17. Format Dialog =) Enter YEARFMT in the Name field. =) Enter 12 in the w field, then press the Return key. Now the example in the upper right of the dialog shows a value formatted with YEARFMT. 360

Chapter 24. Creating Formats Figure 24.18. YEARFMT Entered =) Click OK to close the Format dialog. Now YEARFMT is used to display the values of YR MAJOR. Figure 24.19. YEARFMT Assigned By default, the new format is used to display values wherever you use YR MAJOR. Formats are not used in calculations except for nominal variables in model effects or for group variables. In these cases, the format is used to determine the groups. You can see this use of formats by creating a box plot. =) Deselect YR MAJOR in the data window. =) Choose Analyze:Box Plot/Mosaic Plot ( Y ). This displays the box plot variables dialog. =) Assign YR MAJOR the X role and CR HITS the Y role. 361

Part 2. Introduction Figure 24.20. Box Plot Variables Dialog =) Click the OK button to create the box plot. Figure 24.21. Box Plot of CR HITS by YR MAJOR 362

Chapter 24. Creating Formats Since YEARFMT defines four formatted values, there are four boxes in the box plot. One of the boxes has no whiskers because it represents only two observations. Pete Rose and Tony Perez, ballplayers of exceptional hitting ability and longevity, are in a class by themselves. To learn more about SAS formats, refer to SAS Language Reference: Dictionary. To learn more about creating your own formats with PROC FORMAT, refer to the SAS Procedures Guide. Related Reading: Box Plots, Chapter 33. 363

The correct bibliographic citation for this manual is as follows: SAS Institute Inc., SAS/ INSIGHT User s Guide, Version 8, Cary, NC: SAS Institute Inc., 1999. 752 pp. SAS/INSIGHT User s Guide, Version 8 Copyright 1999 by SAS Institute Inc., Cary, NC, USA. ISBN 1 58025 490 X All rights reserved. Printed in the United States of America. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute Inc. U.S. Government Restricted Rights Notice. Use, duplication, or disclosure of the software by the government is subject to restrictions as set forth in FAR 52.227 19 Commercial Computer Software-Restricted Rights (June 1987). SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513. 1st printing, October 1999 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. The Institute is a private company devoted to the support and further development of its software and related services.