Quick Results with SAS/GRAPH Software

Quick Results with SAs/GRAPH Software
by Arthur L. Carpenter and Charles E. Shipp
Preface ix
Acknowledgments xi
About the Authors xiii
Using This Book xv
1 Overview of Graphics Capabilities in SAS Software
1.1 Introduction
1.2 Base Product Graphics
1.3 SAS/GRAPH Graphics
1.4 Graphics Options for SAS/GRAPH
1.4.1 Checking the GOPTIONS using the GTESTIT procedure
1.4.2 Choosing between HSIZE & VSIZE and HPOS & VPOS
1.4.3 Using HPOS and VPOS
1.4.4 Viewing and plotting using the TARGETDEVICE= option
2 Plotting without SAS/GRAPH Software
2.1 Introduction
2.2 Plotting with PROC UNIVARIATE
2.3 Plotting Two or More Variables with PROC PLOT
2.3.1 Controlling horizontal and vertical axes
2.3.2 Overlaying plots
2.3.3 Generating multiple plots per page
2.4 Displaying Data Using PROC TIMEPLOT
2.5 Using PROC REG to Create Scatter Plots
2.5.1 Using the PLOT statement in PROC REG
2.5.2 Finding and painting influential points
3 Titles, Axes, and Legends in SAS/GRAPH Output
3.1 Introduction
3.2 Enhancing Titles
3.2.1 Hardware fonts and when they are used
3.2.2 Changing fonts, color, and text size
3.2.3 Splitting title lines using the JUSTIFY= option
3.2.4 Changing text orientation with ROTATE= and ANGLE=
3.2.5 Creating subscripts and superscripts
3.2.6 Using BY and macro variables in titles
3.3 Customizing Axes Using the AXIS Statement
3.3.1 Using the logarithm options
3.3.2 Working with tick mark text strings
3.3.3 Dealing with dates
3.4 Creating Legends
3.4.1 Positioning a legend
3.4.2 Controlling text for legend entry labels
3.4.3 Adjusting the legend entry symbol size
4 Customizing Graphs
4.1 Introduction
4.2 Using Symbols with the OVERLAY Option
4.3 Creating Customized Specialty Graphs Using Data Manipulation
4.3.1 Generating error bars
4.3.2 Creating histograms using GPLOT
4.3.3 Creating multiple axes
4.3.4 Drawing shapes (butterfly plots)
4.3.5 Generating box-whisker plots
4.3.6 Cluster scatter plots
4.4 Controlling Scales on Axes
4.4.1 Creating non-linear axes (probability/quantile plots)
4.4.2 Creating equally scaled X and Y axes
4.5 Using Fonts as Graphic Symbols
4.5.1 Histograms as points
4.5.2 Showing the magnitude of a third variable (Sunflower plots)
5 Helpful Details for Presenting Your Graphs
5.1 Introduction
5.2 Using Device Drivers
5.3 Incorporating Your Graphs into Word Processing Programs
5.3.1 Creating a graphics stream file
5.3.2 Importing your graphs into a word processor
5.4 Editing Your SAS/GRAPH Object under Windows
5.5 When to Use and Not to Use the ANNOTATE Facility
5.6 Graph Construction; Things to Think About
5.6.1 Making a graph make sense
5.6.2 Use of color
5.6.3 Using color on black-and-white plots
5.6.4 Using gray-scales
5.7 Graphics Options and Techniques to Avoid
5.7.1 Stacked bar charts
5.7.2 Plots in layers
5.7.3 Block charts
5.7.4 Optical illusion and the pattern statement
5.7.5 Pie chart
5.7.6 Nonaligned axes
5.7.7 Bubble plots
6 Displaying Graphs Using the GREPLAY Procedure
6.1 Introduction
6.2 Saving and Replaying Graphs
6.2.1 Using GREPLAY interactively
6.2.2 Executing the GREPLAY procedure in line mode
6.3 Controlling Graphical Display with Templates
6.3.1 Controlling plot size with templates
6.3.2 Rotating a graph using a template
6.3.3 Zooming in on a portion of the graph
6.3.4 Controlling and displaying titles
6.3.5 Distortion and perspective
6.3.6 Using templates to cut, paste, and clip graphs
6.3.7 Creating multiple plots using templates
APPENDIX A Example Databases 187
SETUP.SAS
BIOMASS.SAS
CA88AIR.SAS
DOW.SAS
H2OQUAL.SAS
LAMPARA.SAS
SALESMAP.SAS
APPENDIX B Example Programs 195
SETUP.SAS
Figure 1.4.1 Demonstrate PROC GTESTIT
Figure 1.4.2 Demonstrate HPOS and VPOS
Figure 1.4.3b Increasing VPOS and HPOS
Figure 1.4.4 Demonstrate the TARGETDEVICE GOPTION
Figure 2.2 Plotting with PROC UNIVARIATE
Figure 2.3 A Simple PROC PLOT 196
Figure 2.3.1 PROC PLOT Axis Control
Figure 2.3.2a PROC PLOT Overlay with the PLOT Statement
Figure 2.3.2b PROC PLOT Overlay with the OVERLAY Option
Figure 2.3.3 PROC PLOT Multiple Plots per Page
Figure 2.4a TIMEPLOT on Sequence Data
Figure 2.4b TIMEPLOT on Non-sequence Data
Figure 2.5 PROC PLOT Scatter Plot
Figure 2.5.1 Plotting with PROC REG
Figure 2.5.2 PROC REG - Painting a Point
Figure 3.2.1 Hardware Fonts
Figure 3.2.2 Title Options
Figure 3.2.3 Using JUSTIFY to Split a Title
Figure 3.2.4a Using the ANGLE= and ROTATE= Title Options 198
Figure 3.2.4b Using the ANGLE= and ROTATE= Axis Options
Figure 3.2.5 Superscripts and Subscripts in Titles
Figure 3.2.6 Inserting BY Values in Titles
Figure 3.3.1a Logarithmic Scales
Figure 3.3.1b Creating LOG Graph Paper
Figure 3.3.1c Plotting on LOG Scale Graph Paper
Figure 3.3.2 Working with Tick Mark Strings
Figure 3.3.3a Unformatted Date Values on an Axis
Figure 3.3.3b Formatted Date Values on an Axis
Figure 3.3.3c Plotting Dates by Week
Figure 3.4.1a Legends without the LEGEND Statement
Figure 3.4.1b Positioning a Legend with POSITION=
Figure 3.4.1c Positioning a Legend with the ORIGIN Option
Figure 3.4.2 Using the VALUE= Option
Figure 3.4.3 Using the SHAPE= Option
Figure 4.2 Overlay Two Plots Using GPLOT
Figure 4.3.1a Error Bars Using INTERPOL Option
Figure 4.3.1b Error Bars Using Generated Data Points
Figure 4.3.2a Generating a Histogram Using GCHART
Figure 4.3.2b Generating a Histogram Using GCHART
Figure 4.3.2c Histogram Generated with Uneven Midpoints
Figure 4.3.2d Using GPLOT to Generate a Histogram
Figure 4.3.3a GPLOT Example Plot
Figure 4.3.3b Multiple Axes on One Plot
Figure 4.3.3c Separating Three Variables
Figure 4.3.3d Separating Values of a Variable
Figure 4.3.3e GPLOT with the PLOT2 Statements
Figure 4.3.4a Butterfly Plots
Figure 4.3.4b Butterfly Plots
Figure 4.3.5 Box-Whisker Plots
Figure 4.3.6 Cluster Analysis Plots
Figure 4.4.1a GCHART of the Lampara Length Data
Figure 4.4.1bc Unevenly Spaced Vertical Axes
Figure 4.4.1de Probability and Quantile Plots
Figure 4.4.2a Nonequal Axis Scaling
Figure 4.4.2b Using HSIZE to Adjust the Scale
Figure 4.4.2c Using Titles to Adjust the Scale
Figure 4.4.2d Using the Range to Adjust the Scale
Figure 4.5.1 Create a GFONT Histogram
Figure 4.5.2 Creating Sunflower Plots
Figure 5.3.1 Selected GOPTIONS
Figure 5.3.2 BORDER versus NOBORDER
Figure 5.6.4 Demonstrate the Use of Gray Scales
Figure 5.7.1 Stacked Bar Chart
Figure 5.7.2 GPLOT and the AREAS= Option
Figure 5.7.3 Block Charts
Figure 5.7.4 Optical Illusion
Figure 5.7.5 Comparison of Group Size
Figure 5.7.6a Nonaligned Axes
Figure 5.7.6b Nonaligned Axes
Figure 5.7.7 SCATTER Statement in G3D
Figure 6.2 National Sales Map
Figure 6.2.1 Open the GREPLAY Window
Figure 6.3 Displaying the TEMPLATE DIRECTORY Window
Figure 6.3.1a GSLIDE Example Plot
Figure 6.3.1c Using a Border to Control Size
Figure 6.3.1d Controlling Size without a Border
Figure 6.3.2a Display Panel Coordinates
Figure 6.3.2b Rotate Displaying Panel Coordinates
Figure 6.3.2d Rotate Using Template Coordinates
Figure 6.3.3a Sales Map to be Zoomed
Figure 6.3.3b Zoom Panel Coordinates
Figure 6.3.3c Graphic Overlayed with Zoom Coordinates
Figure 6.3.3e Zooming Using Panel Coordinates
Figure 6.3.3f Zooming on a Map
Figure 6.3.3g Zooming on a Legend
Figure 6.3.3i Placing Zoomed Graphs
Figure 6.3.4c Display a Banner Style Title
Figure 6.3.5c Display Titles Using Perspective
Figure 6.3.6b Template Overlays
Figure 6.3.6c Template Overlay of a Map
Figure 6.3.7a Template Preview
Figure 6.3.7c Banner Titles on Multiple Plots
References
SAS Institute Documentation
Articles, Papers, and Books
Graphical Index
Index