SGPLOT Procedure

ELLIPSE Statement

Adds a confidence or prediction ellipse to another plot.
Restriction: In order to produce useful output, the ELLIPSE statement should be used with another plot statement that uses numeric axes.
About Ellipse Plots

Adding a Prediction Ellipse to a Scatter Plot

Syntax

ELLIPSE X= numeric-variable Y= numeric-variable </ option(s)>;

Summary of Optional Arguments

Ellipse options
specifies the confidence level for the ellipse.
specifies that the data for the ellipse is ignored when determining the data ranges for the axes.
specifies whether the area fill is visible.
specifies the appearance of the area fill for the ellipse.
specifies the appearance of the outlines for the ellipse.
specifies whether the outlines of the ellipse are visible.
specifies the type of ellipse.
Plot options
specifies how many times observations are repeated for computational purposes.
specifies a label that identifies the ellipse in the legend.
specifies a name for the plot.
specifies the degree of transparency for the area fill and outline, if displayed.
assigns the X variable to the secondary (top) horizontal axis.
assigns the Y variable to the secondary (right) vertical axis.

Required Arguments

X= numeric-variable
specifies a numeric variable for the X axis.
Y= numeric-variable
specifies a numeric variable for the Y axis.

Optional Arguments

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
CLIP
specifies that the data for the ellipse is ignored when determining the data ranges for the axes. By default, the data for the ellipse is considered when determining the data ranges for the axes.
Interaction:This option is automatically set if you specify UNIFORM=SCALE or UNIFORM=ALL option in the PROC SGPLOT statement.
FILL | NOFILL
specifies whether the area fill is visible. The FILL option shows the area fill. The NOFILL option hides the area fill.
Default:The default status of the area fill is specified by the DisplayOpts attribute of the GraphEllipse style element in the current style.
Interactions:Specifying FILL also hides any visible outlines.

If NOFILL and NOOUTLINE are both specified, then both options are ignored.

FILLATTRS= style-element | (COLOR= color)
specifies the appearance of the area fill for the ellipse. You can specify the color of the fill by using a style element or by using the COLOR= suboption. 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:The default color is specified by the Color attribute of the GraphDataDefault style element in the current style.
Interaction:This option has no effect if you specify the NOFILL option.
FREQ= numeric-variable
specifies how many times observations are repeated for computational purposes. Each observation is repeated n times for computational purposes, where n is the value of the numeric variable. If n is not an integer, then it is truncated to an integer. If n is less than 1 or missing, then it is excluded from the analysis.
LEGENDLABEL= “text-string
specifies a label that identifies the ellipse in the legend. By default, the label describes the confidence value of the ellipse and the type of ellipse. For example, “95% Prediction Ellipse.”
LINEATTRS= style-element <(options)> | (options)
specifies the appearance of the outlines for the ellipse. 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:The default color is specified by the ContrastColor attribute of the GraphDataDefault style element 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:The default line pattern is specified by the LineStyle attribute of the GraphDataDefault style element 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:The default line thickness is specified by the LineThickness attribute of the GraphDataDefault style element in the current style.
NAME= “text-string
specifies a name for the plot. You can use the name to refer to this plot in other statements.
Note:The name is case-sensitive. When you refer to the specified name in other statements, you must use the same exact capitalization.
OUTLINE | NOOUTLINE
specifies whether the outlines of the ellipse are visible. The OUTLINE option shows the outlines and hides the fill. The NOOUTLINE option hides the outlines.
Default:The default status of the outlines is specified by the DisplayOpts attribute of the GraphEllipse style element in the current style.
Interactions:Specifying OUTLINE also hides the fill color.

If NOOUTLINE and NOFILL are both specified, then both options are ignored.

TRANSPARENCY= numeric-value
specifies the degree of transparency for the area fill and outline, if displayed. Specify a value from 0.0 (completely opaque) to 1.0 (completely transparent).
Default:0.5
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 a bivariate normal distribution.
Default:PREDICTED
X2AXIS
assigns the X variable to the secondary (top) horizontal axis.
Y2AXIS
assigns the Y variable to the secondary (right) vertical axis.