Doing More with SAS/ASSIST Software |
You
can use
Plots on the Graphics menu to create simple X * Y plots, X
* Y plots by category, or multiple plots on one set of axes. In the "Graphics"
chapter of
Getting Started with the SAS System Using SAS/ASSIST Software, you learned how to produce a simple line plot. This
section describes some of the more advanced plotting options.
|
Creating a Scatter Plot with the Regression Line Superimposed |
In this section
you create a plot showing the relationship between the height and the age
of students in the CLASS table, and you leave the points on the plot unconnected.
Additionally, you plot the fitted regression line and upper and lower 95%
confidence limits for an individual prediction.
Setting Up the Plot
-
To display the
Simple X * Y Plot window,
follow this selection path starting from the WorkPlace menu:
Tasks |
|
Graphics |
|
Plots |
|
Simple X * Y
plot |
Simple X * Y Plot Window
- Use
the Table button
to select the SASUSER.CLASS table.
- Use the Vertical axis
button to select HEIGHT as the vertical axis column.
The default label associated with the vertical axis
column, Height in inches, is used as the vertical
axis label.
- Use the Horizontal axis
button to select AGE as the horizontal axis column.
The default label associated with the horizontal axis
column, Age in years, is used as the horizontal
axis label.
Adding a Regression Line and a Title
-
Follow
this selection path to display the Regression Method
window:
Additional options |
|
Line and symbol options |
|
Interpolation method |
|
Use regression analysis to
plot |
Regression Method Window
The
Additional options item
displays different windows depending on the type of plot you select.
- Leave the Type of regression
as Linear.
- Select Individual for
the Confidence limits, and leave the Confidence level as 95.
- Select
OK twice, and
then Goback.
- Follow this selection path to display the Title 1
window:
Edit |
|
Titles |
|
Title 1 |
- Type
Height by Age
as the title for the plot.
Note: Titles carry over from one report or graphic to
another. If you do not type a title and a title was selected previously in
the current SAS/ASSIST session, the previous title automatically appears on
this graphic.
- Select OK twice and
then Goback to return to the Simple
X * Y Plot window.
Running the Plot
-
Follow this selection
path:
Run |
|
Submit |
The plot of the regression line with
the actual data points and the upper and lower 95% confidence limits for an
individual prediction appears in the GRAPH window.
X * Y Plot Output
- To return to the
SAS/ASSIST software from the
GRAPH window, follow this selection path:
File |
|
Close |
X * Y Plot by Category
By choosing X * Y Plot by
Category
instead of Simple X * Y Plot, you can add an extra
dimension to your plot. For example, using the SASUSER.CLASS table, and plotting
HEIGHT versus WEIGHT, you can choose AGE as a category column. Each point
on the plot is a different color depending on the age of the child represented
by the data point. You can choose different line and symbol options for each
value of the category column.
Multiple Plots Per Axes
By choosing Multiple
Plots Per Axes
instead of Simple X * Y Plot, you can specify up
to four columns for the vertical axis. For example, using the SASUSER.CLASS
table, you can plot both HEIGHT and WEIGHT versus AGE. For each plot, you
can specify different line and symbol options.
Other Plot Options
By selecting Additional
Options, you
can
- Change the color, width, length, style, label,
and tick marks for each axis
- Change the range of values for each axis
- Change the symbol, line style, and color of each
plot
- Fill in the area under the curve
- Add vertical and horizontal reference
lines
- Change the color, size, and font of the text
- Change the plot frame style and fill
color
- Change the placement and configuration of the
legend (Multiple Plots and Category Plots)
- Add a second vertical axis.
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.