Doing More with Graphics |
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 SAS/ASSIST, 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.
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 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.
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.
Select Individual for the Confidence limits, and leave the Confidence level as 95.
Select OK to return to the Line and Symbol Options dialog box.
Select Plot Symbol.
In the Symbols List dialog box, select a symbol. For this example, Empty circle is selected.
Select OK, 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 previously selected in the current SAS/ASSIST session, then the previous title automatically appears on this graphic.
Follow this selection path:Run SubmitThe 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
Additional Plot Options |
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.
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.
By selecting Additional Options, you can
Change the color, width, length, style, label, and tick marks for each axis
Change the placement and configuration of the legend (Multiple Plots and Category Plots)
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.