SGSCATTER Procedure

PLOT Statement

Creates a paneled graph that contains multiple independent scatter plots.
Creating a Graph with Multiple Independent Scatter Plots and Spline Curves

Syntax

PLOT plot-request(s) </ options>;

Summary of Optional Arguments

specifies the value of the ID variable in an attribute map data set.
specifies the number of columns in the graph.
displays a label for each data point.
adds a confidence or prediction ellipse to the scatter plot.
creates grid lines for each tick on both axes.
specifies a classification variable to divide the values into groups.
specifies that line segments join all of the scatter points.
specifies the appearance of the legend for the scatter plot.
adds a loess fit to the scatter plot.
specifies the appearance of the markers in the plot.
removes the legend from the graph.
adds a fitted, penalized B-spline curve to the scatter plot.
duplicates the tick marks from the X and Y axes on the opposite sides of each cell.
adds a regression fit to the scatter plot.
specifies the number of rows in the graph.
specifies the amount of spacing (in pixels) that is placed between the cells in the graph, if the PLOT statement creates multiple cells.
specifies the degree of transparency for the plot components.
specifies that the X axis, Y axis, or both axes are scaled uniformly for all of the cells in the graph.

Required Argument

plot-request-1 < ... plot-request-n>
specifies one or more plot requests. Each plot request specifies the variables to plot and produces a separate cell. All variables must be in the input data set. Multiple plot requests are separated with blanks. You can plot character or numeric variables. A plot request can be either of these:
y-variable*x-variable
plots the values of two variables.
y-variable
variable plotted on the left vertical axis.
x-variable
variable plotted on the horizontal axis.
(y-variable(s))*(x-variable(s))
plots the values of two or more variables and produces a separate cell for each combination of Y and X variables. That is, each Y*X pair is plotted on a separate set of axes.
y-variable(s)
variables plotted on the left vertical axes.
x-variable(s)
variables plotted on the horizontal axes.
If you use only one y-variable or only one x-variable, omit the parentheses for that variable, for example,
plot (temp rain)*month;
This plot request produces two cells, one for TEMP and MONTH and one for RAIN and MONTH.

Optional Arguments

ATTRID= variable
specifies the value of the ID variable in an attribute map data set. You specify this option only if you are using an attribute map to control visual attributes of the graph. For more information, see Using SG Attribute Maps to Control Visual Attributes.
COLUMNS= n
specifies the number of columns in the graph.
DATALABEL <= variable>
displays a label for each data point. If you specify a variable, the values of that variable are used for the data labels. If you do not specify a variable, the value of the Y variable is used for the data label.
ELLIPSE <= (options)>
adds a confidence or prediction ellipse to the scatter plot. options can be one or more of the following:
ALPHA= n
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
Restriction:To use this option, all of the X and Y variables must be numeric.
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.
GRID
creates grid lines for each tick on both axes.
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.
JOIN <= (options)>
specifies that line segments join all of the scatter points. The line segments connect the scatter points in increasing order along the X axis. The data order of the input data set has no effect on the order of the lines.
You can specify the following options:
LINEATTRS= style-element <(options)> | (options)
specifies the appearance of the join lines. You can specify the appearance by using a style element or by using suboptions. If you specify a style element, you can also specify suboptions to override specific appearance attributes.
options can be one or more of the following:
COLOR= color
specifies the color of the line. You can specify colors using the same color schemes that are supported by SAS/GRAPH software. For more information, see Color-Naming Schemes in SAS/GRAPH: Reference.
Default:For ungrouped data, the default color is specified by the ContrastColor attribute of the GraphFit 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.

PATTERN= line-pattern
specifies the line pattern for the line. You can reference SAS patterns by number or by name. For a list of line patterns, see Line Patterns.
Default:For ungrouped data, the default line pattern is specified by the LineStyle attribute of the GraphFit style element in the current style.

For grouped data, the default line pattern is specified by the LineStyle attribute of the GraphData1 ... GraphDatan style elements in the current style.

THICKNESS= n <units>
specifies the thickness of the line. You can also specify the unit of measure. The default unit is pixels. For a list of measurement units that are supported, see Units of Measurement.
Default:For ungrouped data, the default line thickness is specified by the LineThickness attribute of the GraphFit style element in the current style.

For grouped data, the default line thickness is specified by the LineThickness attribute of the GraphData1 ... GraphDatan style elements in the current style.

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 rows in the legend.
Interaction:This suboption has no effect if you also specify the ACROSS= suboption.
LOCATION= CELL | OUTSIDE
specifies whether the legend is placed inside an empty cell (CELL) in the plot area or outside of the plot area (OUTSIDE). The LOCATION=CELL suboption should be specified only when the graph contains an empty cell.
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 positions 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.
Default:BOTTOM
Interaction:This suboption has no effect if you also specify LOCATION= CELL.
Note:If you specify more than one legend with the same position, then all of your legends are placed at that position.
TITLE= "text-sting"
specifies the label for the legend. By default, the label of the group variable is used.
LOESS <= (options)>
adds a loess fit to the scatter plot. You can specify the following options:
ALPHA= numeric-value
specifies the confidence level for the confidence limits. Specify a number between 0.00 (100% confidence) and 1.00 (0% confidence).
Default:.05
Interaction:This option has no effect if you do not specify the CLM option.
CLM
creates confidence limits for a mean predicted value for each observation.
DEGREE= 1 | 2
specifies the degree of the local polynomials to use for each local regression. 1 specifies a linear fit and 2 specifies a quadratic fit.
Default:1
INTERPOLATION= CUBIC | LINEAR
specifies the degree of the interpolating polynomials that are used for blending local polynomial fits at the kd tree vertices.
Default:CUBIC
LINEATTRS= style-element <(options)> | (options)
specifies the appearance of the fit line. You can specify the appearance by using a style element or by using suboptions. If you specify a style element, you can also specify suboptions to override specific appearance attributes.
options can be one or more of the following:
COLOR= color
specifies the color of the line. You can specify colors using the same color schemes that are supported by SAS/GRAPH software. For more information, see Color-Naming Schemes in SAS/GRAPH: Reference.
Default:For ungrouped data, the default color is specified by the ContrastColor attribute of the GraphFit 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.

PATTERN= line-pattern
specifies the line pattern for the line. You can reference SAS patterns by number or by name. For a list of line patterns, see Line Patterns.
Default:For ungrouped data, the default line pattern is specified by the LineStyle attribute of the GraphFit style element in the current style.

For grouped data, the default line pattern is specified by the LineStyle attribute of the GraphData1 ... GraphDatan style elements in the current style.

THICKNESS= n <units>
specifies the thickness of the line. You can also specify the unit of measure. The default unit is pixels. For a list of measurement units that are supported, see Units of Measurement.
Default:For ungrouped data, the default line thickness is specified by the LineThickness attribute of the GraphFit style element in the current style.

For grouped data, the default line thickness is specified by the LineThickness attribute of the GraphData1 ... GraphDatan style elements in the current style.

NOGROUP
specifies that the fit does not use the group variable from the scatter plot.
SMOOTH= numeric-value
specifies a smoothing parameter value. If you do not specify a value, then a smoothing value is determined automatically.
Restriction:To use this option, all of the X and Y variables must be numeric.
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 also specify suboptions to override specific appearance attributes.
options can be one or more of the following:
COLOR= color
specifies the color of the markers. You can specify colors using the same color schemes that are supported by SAS/GRAPH software. For more information, see Color-Naming Schemes in SAS/GRAPH: Reference.
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 <units>
specifies the size of the markers. You can also specify the unit of measurement. The default unit is pixels. For a list of measurement units that are supported, see Units of Measurement.
Default:The default marker size is specified by the MarkerSize attribute of the GraphDataDefault style element in the current style.
SYMBOL= symbol-name
specifies the symbol for the markers. For a list of valid marker symbols, see 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.
PBSPLINE <= (options)>
adds a fitted, penalized B-spline curve to the scatter plot. options can be one or more of the following:
ALPHA= numeric-value
specifies the confidence level for the confidence limits. Specify a number between 0.00 (100% confidence) and 1.00 (0% confidence).
Default:.05
Interaction:This option has no effect if you do not specify either the CLI option or the CLM option.
CLI
creates confidence limits for individual predicted values for each observation.
CLM
creates confidence limits for a mean predicted value for each observation.
DEGREE= n
specifies the degree of the spline transformation.
Default:3
LINEATTRS= style-element <(options)> | (options)
specifies the appearance of the curve line. You can specify the appearance by using a style element or by using suboptions. If you specify a style element, you can also specify suboptions to override specific appearance attributes.
options can be one or more of the following:
COLOR= color
specifies the color of the line. You can specify colors using the same color schemes that are supported by SAS/GRAPH software. For more information, see Color-Naming Schemes in SAS/GRAPH: Reference.
Default:For ungrouped data, the default color is specified by the ContrastColor attribute of the GraphFit 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.

PATTERN= line-pattern
specifies the line pattern for the line. You can reference SAS patterns by number or by name. For a list of line patterns, see Line Patterns.
Default:For ungrouped data, the default line pattern is specified by the LineStyle attribute of the GraphFit style element in the current style.

For grouped data, the default line pattern is specified by the LineStyle attribute of the GraphData1 ... GraphDatan style elements in the current style.

THICKNESS= n <units>
specifies the thickness of the line. You can also specify the unit of measure. The default unit is pixels. For a list of measurement units that are supported, see Units of Measurement.
Default:For ungrouped data, the default line thickness is specified by the LineThickness attribute of the GraphFit style element in the current style.

For grouped data, the default line thickness is specified by the LineThickness attribute of the GraphData1 ... GraphDatan style elements in the current style.

NKNOTS= n
specifies the number of evenly spaced internal knots.
Default:100
NOGROUP
specifies that the curve does not use the group variable from the scatter plot.
SMOOTH= numeric-value
specifies a smoothing parameter value. If you do not specify this option, then a smoothing value is determined automatically.
Restriction:To use this option, all of the X and Y variables must be numeric.
REFTICKS
duplicates the tick marks from the X and Y axes on the opposite sides of each cell.
REG <= (options)>
adds a regression fit to the scatter plot. options can be one or more of the following:
ALPHA= numeric-value
specifies the confidence level for the confidence limits. Specify a number between 0.00 (100% confidence) and 1.00 (0% confidence).
Default:.05
Interaction:This option has no effect if you do not specify either the CLI option or the CLM option.
CLI
creates confidence limits for individual predicted values for each observation.
CLM
creates confidence limits for a mean predicted value for each observation.
DEGREE= n
specifies the degree of the polynomial fit. For example, 1 specifies a linear fit, 2 specifies a quadratic fit, and 3 specifies a cubic fit.
Default:1
LINEATTRS= style-element <(options)> | (options)
specifies the appearance of the fit line. You can specify the appearance by using a style element or by using suboptions. If you specify a style element, you can also specify suboptions to override specific appearance attributes.
options can be one or more of the following:
COLOR= color
specifies the color of the line. You can specify colors using the same color schemes that are supported by SAS/GRAPH software. For more information, see Color-Naming Schemes in SAS/GRAPH: Reference.
Default:For ungrouped data, the default color is specified by the ContrastColor attribute of the GraphFit 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.

PATTERN= line-pattern
specifies the line pattern for the line. You can reference SAS patterns by number or by name. For a list of line patterns, see Line Patterns.
Default:For ungrouped data, the default line pattern is specified by the LineStyle attribute of the GraphFit style element in the current style.

For grouped data, the default line pattern is specified by the LineStyle attribute of the GraphData1 ... GraphDatan style elements in the current style.

THICKNESS= n <units>
specifies the thickness of the line. You can also specify the unit of measure. The default unit is pixels. For a list of measurement units that are supported, see Units of Measurement.
Default:For ungrouped data, the default line thickness is specified by the LineThickness attribute of the GraphFit style element in the current style.

For grouped data, the default line thickness is specified by the LineThickness attribute of the GraphData1 ... GraphDatan style elements in the current style.

NOGROUP
specifies that the fit does not use the group variable from the scatter plot.
Restriction:To use this option, all of the X and Y variables must be numeric.
ROWS= n
specifies the number of rows in the graph.
Interaction:This option has no effect if you specify the COLUMNS= option.
SPACING = n
specifies the amount of spacing (in pixels) that is placed between the cells in the graph, if the PLOT statement creates multiple cells.
Default:10
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
UNISCALE= X | Y | ALL
specifies that the X axis, Y axis, or both axes are scaled uniformly for all of the cells in the graph. By default, no scaling is performed. If this option is used, then all variables on the specified axis must be of the same type (all numeric or all character).