O'Reilly logo

Step-by-Step Programming with Base SAS 9.4, Second Edition, 2nd Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 30
Plotting the Relationship between
Variables
Introduction to Plotting the Relationship between Variables . . . . . . . . . . . . . . . . . 531
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Plotting One Set of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
Understanding the PLOT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
Enhancing the Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Specifying the Axes Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Specifying the Tick Marks Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
Specifying Plotting Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Removing the Legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
Plotting Multiple Sets of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
Creating Multiple Plots on Separate Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
Creating Multiple Plots on the Same Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
Plotting Multiple Sets of Variables on the Same Axes . . . . . . . . . . . . . . . . . . . . . . 546
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
PROC PLOT Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
Introduction to Plotting the Relationship between
Variables
Overview
An effective way to examine the relationship between variables is to plot their values.
You can use the PLOT procedure to display relationships and patterns in the data.
This section covers the following topics:
plot one set of variables
enhance the appearance of a plot
create multiple plots on separate pages
531

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required