Statistical Graphics Using ODS

The SGSCATTER Procedure

You can use the SGSCATTER procedure to produce scatter plot matrices. The following step creates a scatter plot matrix from all the numeric variables in the Class data set (available in the Sashelp library) and produces FigureĀ 21.77:

proc sgscatter data=sashelp.class;
   matrix _numeric_ / diagonal=(kernel histogram);

The diagonal cells of FigureĀ 21.77 contain a histogram and a kernel density fit. The off-diagonal cells contain all pairs of scatter plots.

Figure 21.77: Scatter Plot Matrix with PROC SGSCATTER

Scatter Plot Matrix with PROC SGSCATTER

The MATRIX statement creates a symmetric $n \times n$ scatter plot matrix. Other statements are also available. The PLOT statement creates a panel that contains one or more individual scatter plots. The COMPARE statement creates a rectangular $m \times n$ scatter plot matrix. Linear and nonlinear fits can be added, and you can request many graphical features by specifying options.