Previous Page | Next Page

The SGSCATTER Procedure

MATRIX Statement


Creates a scatter plot matrix.
Featured in: Creating a Scatter Plot Matrix


Syntax

MATRIX numeric-variable-1 numeric-variable-2 < ... numeric-variable-n> </ options>;

options can be one or more of the following:

DATALABEL= variable

DIAGONAL= (graph-list)

ELLIPSE <= (options)>

GROUP= variable

LEGEND = (options)

MARKERATTRS= style-element <(options)> | (options)

NOLEGEND

START= BOTTOMLEFT | TOPLEFT

TRANSPARENCY= numeric-value


Required Options

numeric-variable-1 numeric-variable-2 < ... numeric-variable-n >

specifies two or more numeric variables for the matrix.


Options

DATALABEL= variable

specifies a variable that is used to create data labels for each point in the plot.

DIAGONAL= (graph-list)

adds graphs to the diagonal cells of the plot matrix. If you do not specify the DIAGONAL option, the diagonal cells contain the variable names.

graph-list can be one or more of the following:

HISTOGRAM

specifies a histogram.

KERNEL

specifies a kernel density estimate.

NORMAL

specifies a normal density curve.

ELLIPSE <= (options) >

Adds a confidence or prediction ellipse to each cell that contains a scatter plot.

options can be one or more of the following:

ALPHA= numeric-value

specifies the confidence level for the ellipse. Specify a number between 0.00 (100% confidence) and 1.00 (0% confidence).

Default: .05
TYPE= MEAN | PREDICTED

specifies the type of ellipse. MEAN specifies a confidence ellipse for the population mean. PREDICTED specifies a prediction ellipse for a new observation. Both ellipse types assume bivariate normal distribution.

Default: PREDICTED
Interaction: The GROUP option does not affect the creation of ellipses. The SGSCATTER procedure always uses all of the data points to calculate the confidence or prediction ellipse.
GROUP= variable

specifies a classification variable to divide the values into groups. If a fit line is requested, then the GROUP= variable is also applied to the fit plot unless you specify the NOGROUP suboption in the option for the fit plot.

LEGEND= (options)

specifies the appearance of the legend for the scatter plot.

options can be one or more of the following:

ACROSS= n

specifies the number of columns in the legend.

DOWN= n

specifies the number of columns in the legend.

Interaction: If you specify both the ACROSS= and DOWN= suboptions, then the DOWN= suboption has no effect.
NOBORDER

removes the border from the legend.

NOTITLE

removes the label from the legend.

POSITION= position-value

specifies the position of the legend within the graph. The values are as follows:

BOTTOM

places the legend at the bottom of the graph.

LEFT

places the legend at the left side of the graph.

RIGHT

places the legend at the right side of the graph.

TOP

places the legend at the top of the graph.

Note:   If you specify more than one legend with the same position, then all of your legends are placed at that position.  [cautionend]

Default: BOTTOM
TITLE= "text-sting"

specifies the label for the legend. By default, the label of the group variable is used.

MARKERATTRS= style-element <(options)>| (options)

specifies the appearance of the markers in the plot. You can specify the appearance by using a style element or by using suboptions. If you specify a style element, you can additionally specify suboptions to override specific appearance attributes.

options can be one or more of the following:

COLOR= color

specifies the color of the markers. For more information about specifying colors, see SAS/GRAPH Colors and Images in the SAS/GRAPH: Reference, Second Edition.

Default: For ungrouped data, the default color is specified by the ContrastColor attribute of the GraphDataDefault style element in the current style.

For grouped data, the default color is specified by the ContrastColor attribute of the GraphData1 ... GraphDatan style elements in the current style.

SIZE= n

specifies the size of the markers in pixels.

Default: For ungrouped data, the default marker size is specified by the MarkerSize attribute of the GraphDataDefault style element in the current style.

For grouped data, the default marker size is specified by the MarkerSize attribute of the GraphData1 ... GraphDatan style elements in the current style.

SYMBOL= symbol-name

specifies the symbol for the markers. See Marker Symbols for a list of valid marker symbols.

Default: For ungrouped data, the default marker symbol is specified by the MarkerSymbol attribute of the GraphDataDefault style element in the current style.

For grouped data, the default marker symbol is specified by the MarkerSymbol attribute of the GraphData1 ... GraphDatan style elements in the current style.

NOLEGEND

removes the legend from the graph.

START= BOTTOMLEFT | TOPLEFT

specifies whether the diagonal starts in the top left corner or the bottom left corner.

Default: TOPLEFT
TRANSPARENCY= numeric-value

specifies the degree of transparency for the plot components. Specify a value from 0.0 (completely opaque) to 1.0 (completely transparent).

Default: 0.0
Restriction: This option is available with SAS 9.2 Phase 2 and later.

Previous Page | Next Page | Top of Page