Skip to main content Accessibility help
×
Hostname: page-component-8448b6f56d-c4f8m Total loading time: 0 Render date: 2024-04-24T14:41:56.155Z Has data issue: false hasContentIssue false

Chapter 8 - Data Visualization

Published online by Cambridge University Press:  05 June 2016

Julie Kezik
Affiliation:
Yale School of Public Health
Melissa Hill
Affiliation:
Cd3 Inc., Austin, Texas
Get access

Summary

A SAS programmer is rarely limited to displaying data in only one way; various paths can be taken to produce similar tables and plots. Determining which procedure and graphical output are best for the task is a decision specific to the user and the needs of the project. When sharing results with a group, it may be necessary to include more than one representation in order to help everyone understand the data. The purpose of this chapter is to (1) illustrate a sampling of methods for creating output that is visually diverse yet conveys identical information, and (2) to describe how the Output Delivery System (ODS) can be used to maximize the utility of SAS data visualization tools by exporting SAS output to other software. In Chapter 6 we discussed creating tables and list-style output for both data management and processing purposes. In this chapter we take these tasks one step further using some of the same procedures in combination with ODS statistical graphics to create graphical style output. We will also discuss additional SAS procedures such as GCHART and GPLOT, which are designed specifically for plotting data.

USING THE OUTPUT DELIVERY SYSTEM (ODS)

In this chapter we will introduce the output delivery system (ODS) and the two ways we use this indispensable SAS feature. First, ODS statements can be used to export SAS output to specific destinations. The programmer can choose how and where SAS output is stored as well as has control over its format. Second, ODS Statistical Graphics can be used to create visually appealing and printer-friendly graphics.

EXAMPLE 8.1. Basic ODS Syntax.

Ods rtf file=‘C:\stats.rtf’;

Proc print data=sashelp.class;

Run;

Ods rtf close;

To ensure results are created in HTML format (output to the results viewer), go to tools > options > preferences > under the results tab and make sure the “create HTML” box is checked. Viewing in HTML is especially important when using the ODS graphics statement to create a plot, explained in Example 8.3.

CREATING PLOTS FROM PROCS

The FREQUENCY Procedure

The FREQUENCY procedure produces tables and listings. Output can be requested for one variable or for a combination of variables. Procedure options (i.e., TREND, MEASURES, CL) and additional statements (i.e., PLOTS) are used to create detailed output and graphics.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2016

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×