SAS: Usage Hints and Sample Programs

Chapter 12: Graphical Displays

Visual displays of data are one of the most important components of data analysis. Before PC SAS became widely available, quality graphs were difficult to make. The pure text versions printed in the output window had rather limited graphical capabilities such as crude scatterplots with PROC PLOT, charts with PROC CHART, or histograms and boxplots with PROC UNIVARIATE. They are fine for understanding results from data analysis, yet are not of the quality desired for publications or presentations. Both the text and high quality visual aids are available with PC SAS and are relatively easy to apply. They give excellent insights into the nature of your data by showing the "center" and "spread" of continuous data across levels of categorical variables as well serious outliers. They will also show how two or more continuous variables relate to each other.

To make high-quality visual aids, SAS GRAPH is readily now available with the PC version. While the task of producing high-quality graphics in SAS GRAPH is demanding, both versions 8.2 and 9.1.3 offers superior capabilities that make it well worth the time and effort required to become proficient with its many features. PC-SAS provides you with one system for both data analysis and graphical display. If you run SAS primarily on a unix system, you should consider what PC SAS now provides regarding its graphical capabilities.

As you read through this chapter, it will be helpful to see several examples of programs and their associated displays of what SAS GRAPH is able to produce, particularly with the GPLOT procedure, by going to

http://www.sas.com/service/techsup/sample/sample_graph.html

This site shows several graphs you can produce with SAS. In this article I will introduce some of the important components in making them. The SAS web site gives statements and visual displays that are not possible to present here.

Many names of SAS graphical procedures begin with the letter "G". That is, rather than entering PROC PLOT statements to make a scatterplot in an output window, you can apply similar statements and many additional ones with the more sophisticated PROC GPLOT. One exception is a procedure first available in Version 8.2 that produces boxplots with the same high quality as these "GPLOT" programs is PR0C BOXPLOT.

Before you move to a new project or want to produce a new set of graphs, or if your graph window is very full for any reason, you may want to delete graphs in the existing graph directory, or one that you have made. The command to do this:

PROC GREPLAY igout = work.Gseg NOfs; DELETE _all_; run; quit;