Previous Page | Next Page

Doing More with Graphics

Doing More with Plots

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.


Setting Up the Plot

  1. To display the Simple X * Y Plot window, follow this selection path starting from the WorkPlace menu:Tasks [arrow] Graphics [arrow] Plots [arrow] Simple X * Y plot

    Simple X * Y Plot Window

    [Simple X * Y Plot Window]

  2. Use the Table button to select the SASUSER.CLASS table.

  3. 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.

  4. 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

  1. Follow this selection path to display the Regression Method window:Additional options [arrow] Line and symbol options [arrow] Interpolation method [arrow] Use regression analysis to plot

    Regression Method Window

    [Regression Method Window]

    The Additional options item displays different windows depending on the type of plot you select.

  2. Leave the Type of regression as Linear.

  3. Select Individual for the Confidence limits, and leave the Confidence level as 95.

  4. Select OK to return to the Line and Symbol Options dialog box.

  5. Select Plot Symbol.

  6. In the Symbols List dialog box, select a symbol. For this example, Empty circle is selected.

  7. Select OK, then Goback.

  8. Follow this selection path to display the Title 1 window:Edit [arrow] Titles [arrow] Title 1

  9. 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.  [cautionend]

  10. Select OK twice to return to the Simple X * Y Plot window.


Running the Plot

  1. Follow this selection path:Run [arrow] 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

    [X * Y Plot Output]

  2. To return to the SAS/ASSIST software from the GRAPH window, follow this selection path: File [arrow] Close


Additional Plot Options


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

Previous Page | Next Page | Top of Page