| TEMPLATE Procedure: Plot Statements (Experimental) |
| BOXPLOT Y= numeric-column | expression < / option(s)> ; |
| BOXPLOT Y= numeric-column | expression X= column | expression < / option(s)> ; |
| Usage Information |
Box Plot
![[Box Plot]](./images/boxplot.gif)
| Tip: |
The BOXPLOT statement displays a single box if given just a Y argument. The BOXPLOT statement displays multiple boxes if given both Y and X arguments. |
| Required Arguments |
specifies the column for the Y values.
specifies the column for the X values.
| Options |
| Option | Description |
|---|---|
| BACKGROUND= color | style-reference | Specifies the background color of the graph. |
| BACKTRANSPARENCY= number | Specifies the degree of the transparency of the background color. |
| CAPSHAPE= NONE | SERIF | LINE | BRACKET | Specifies the shape at the ends of the whiskers. |
| CONNECT= NONE | MIN | Q1 | MEDIAN | Q3 | MAX | MEAN | Specifies which statistic is used to connect multiple boxes. |
| DATALABEL= column | Specifies the labels of the outliers. |
| DATALABELCOLOR= color | style-reference | Specifies the color of the outlier labels. |
| DATALABELFONTFAMILY= 'string' | style-reference | Specifies the family of the font of the outlier labels. |
| DATALABELFONTSIZE= dimension | style-reference | Specifies the size of the font of the outlier labels. |
| DATALABELFONTSTYLE= NORMAL | ITALIC | style-reference | Specifies the style of the font of the outlier labels. |
| DATALABELFONTWEIGHT= NORMAL | BOLD | style-reference | Specifies the weight of the font of the outlier labels. |
| DATALABELFORMAT= format | Specifies the format of the outlier labels. |
| DATATRANSPARENCY= number | Specifies the degree of the transparency of the boxes. |
| EXTREME= boolean | Specifies whether the whiskers can extend beyond the fences. |
| FILL= boolean | Specifies whether to fill the interior of the boxes. |
| FILLCOLOR= color | style-reference | Specifies the fill color of the interior of the boxes. |
| GRIDTRANSPARENCY= number | Specifies the degree of the transparency of the grid lines. |
| LABELFAR= boolean | Specifies whether all outliers or only far outliers are labeled. |
| LABELTRANSPARENCY= number | Specifies the percentage of the transparency of outlier labels. |
| LINECOLOR= color | style-reference | Specifies the color of the connecting lines that are specified by the CONNECT= option. |
| LINEPATTERN= line | style-reference | Specifies the pattern of the connecting lines that are specified by the CONNECT= option. |
| LINETHICKNESS= dimension | style-reference | Specifies the thickness of the connecting lines that are specified by the CONNECT= option. |
| MARKERCOLOR= color | style-reference | Specifies the color of the outlier markers. |
| MARKERS= boolean | Specifies whether the outlier markers are displayed. |
| MARKERSIZE= dimension | style-reference | Specifies the width of the marker, which is equal to the height of the marker. |
| MARKERSYMBOL= marker | style-reference | Specifies the symbol of the marker of the outlier markers. |
| MEANCOLOR= color | style-reference | Specifies the color of the marker that represents the mean values. |
| MEANSIZE= dimension | style-reference | Specifies the size of the marker that represents the mean values. |
| MEANSYMBOL= marker | style-reference | Specifies the symbol of the marker that represents the mean values. |
| MEDIANCOLOR= color | style-reference | Specifies the color of the line that represents the median values. |
| MEDIANSIZE= dimension | style-reference | Specifies the size of the line that represents the median values. |
| NOTCHES= boolean | Specifies whether the boxes are notched. |
| ORIENT= HORIZONTAL | VERTICAL | Specifies the orientation of the Y axis and of the boxes. |
| OUTLINECOLOR= color | style-reference | Specifies the color of the outlines around the boxes. |
| OUTLINEPATTERN= line | style-reference | Specifies the pattern of the outlines around the boxes. |
| OUTLINETHICKNESS= dimension | style-reference | Specifies the thickness of the outlines around the boxes. |
| PERCENTILE= integer | Specifies one of five definitions used to calculate percentiles. |
| SORT= X | NONE | Specifies whether to use the X column to sort the input data. |
| TRANSPARENCY= number | Specifies the degree of the transparency of the boxes, background, grid, outlier markers and their labels, and wall, if displayed in a graph. |
| WALLTRANSPARENCY= number | Specifies the degree of the transparency for of plot wall or walls. |
| WHISKERCOLOR= color | style-reference | Specifies the colors of the whiskers. |
| WHISKERPATTERN= line | style-reference | Specifies the patterns of the whiskers. |
| WHISKERTHICKNESS= dimension | style-reference | specifies the thickness of the whiskers. |
| XAXIS= X | X2 | Specifies whether data is mapped to the primary X axis or the secondary X (X2) axis. |
| XAXISOPTS= ( axis-options ) | Specifies one or more X axis options. |
| XGRID= boolean | Specifies whether the grid lines are drawn at the tick marks. |
| XOFFSETMAX= number | Specifies an offset to add to the end that represents high data values on the primary X axis. |
| XOFFSETMIN= number | Specifies an offset to add to the end that represents low data values on the primary X axis. |
| YAXIS= Y | Y2 | Specifies whether data is mapped to the primary Y axis or the secondary Y (Y2) axis. |
| YAXISOPTS= ( axis-options ) | Specifies one or more Y axis options. |
| YGRID= boolean | Specifies whether the grid lines drawn at the tick marks. |
| YOFFSETMAX= number | Specifies an offset to add to the end that represents high data values on the primary Y axis. |
| YOFFSETMIN= number | Specifies an offset to add to the end that represents low data values on the primary Y axis. |
specifies the background color of the graph.
| Default: | Specified by the GraphBackground:Background style reference. |
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. |
specifies the degree of the transparency of the background color.
| Default: | 0 |
| Range: | 0 (opaque) to 1 (entirely transparent) |
| Interaction: | The BACKTRANSPARENCY= option overrides the TRANSPARENCY= option for the background. |
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. |
| See also: | TRANSPARENCY= option |
specifies the shape at the ends of the whiskers.
| SERIF |
specifies that short lines are drawn at right angles at the ends of the whiskers. |
| LINE |
specifies that serifs are extended for the width of the box. |
| BRACKET |
specifies that lines with short vertical extensions are drawn in the direction of the box. |
| Default: | LINE |
| Interaction: | The cap color and the thickness are specified by the WHISKERCOLOR= and WHISKERTHICKNESS= options. |
| Interaction: | The cap pattern is always solid. |
specifies which statistic is used to connect multiple boxes.
| Default: | NONE |
| Interaction: | The CONNECT= option only applies when the X argument is used to generate multiple boxes. |
specifies the labels of the outliers.
| Default: | No labels are displayed. |
specifies the color of the outlier labels.
| Default: | Specified by the GraphDataDefault:ContrastColor style reference. |
specifies the family of the font of the outlier labels.
| Default: | Specified by the GraphDataText:Font_Face style reference. |
| Restriction: | You must specify one font family name, not a list of font family names. |
specifies the size of the font of the outlier labels.
| Default: | Specified by the GraphDataText:Font_Size style reference. |
specifies the style of the font of the outlier labels.
| Default: | Specified by the GraphDataText:Font_Style style reference. |
specifies the weight of the font of the outlier labels.
| Default: | Specified by the GraphDataText:Font_Weight style reference. |
specifies the format of the outlier labels.
| Default: | The format of the column. For an unformatted numeric column, the outlier label uses the BEST12 format. |
| Restriction: | The w.d format must be specified using the Fw.d format. |
specifies the degree of the transparency of the boxes.
| Default: | 0 |
| Range: | 0 (opaque) to 1 (entirely transparent). |
| Interaction: | The DATATRANSPARENCY= option overrides the TRANSPARENCY= option for the boxes. |
specifies whether the whiskers can extend beyond the fences.
| Default: | FALSE |
| Tip: |
If EXTREME=FALSE, then the whiskers are
drawn from the upper edge of the box to the largest value within the upper
fence, and from the lower edge of the box to the smallest value within the
lower fence.
If EXTREME=TRUE, then the whiskers are drawn to the largest and smallest data values, whether these values are inside or outside the fences. The outliers and far outliers are not displayed and are not labeled. |
| Tip: | Fences are locations above and below the box. The upper and lower fences are located at a distance 1.5 times the Interquartile Range (IQR) ( IQR = Q3 - Q1 ). The upper and lower far fences are located at a distance 3 times the IQR. |
specifies whether to fill the interior of the boxes.
| Default: | FALSE |
specifies the fill color of the interior of the boxes.
| Default: | Specified by the GraphDataDefault:foreground style reference. |
specifies the degree of the transparency of the grid lines.
| Default: | 0 |
| Range: | 0 (opaque) to 1 (entirely transparent). |
| Interaction: | The GRIDTRANSPARENCY= option overrides the TRANSPARENCY= option for the grid lines. |
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. |
specifies whether all outliers or only far outliers are labeled.
| Default: | FALSE |
| Interaction: | If EXTREME=TRUE, then the LABELFAR= option is ignored. |
| Interaction: |
If LABELFAR=FALSE, then the labels
specified by the DATALABEL= option apply to both outliers and far outliers.
If LABELFAR=TRUE, then the labels specified by the DATALABEL= option only apply to far outliers. |
specifies the percentage of the transparency of the outlier labels.
| Default: | 0 |
| Range: | 0 (opaque) to 1 (entirely transparent) |
| Interaction: | The LABELTRANSPARENCY= option overrides the TRANSPARENCY= option for the outlier labels. |
specifies the color of the connecting lines that are specified by the CONNECT= option.
| Default: | Specified by the OUTLINECOLOR= option. |
specifies the pattern of the connecting lines that are specified by the CONNECT= option.
| Default: | SOLID |
specifies the thickness of the connecting lines that are specified by the CONNECT= option.
| Default: | 1px |
specifies the color of the outlier markers.
| Default: | Specified by the GraphDataDefault:ContrastColor style reference. |
specifies whether the outlier markers are displayed.
| Default: | TRUE |
| Interaction: | If EXTREME=TRUE, then the MARKERS= option is ignored. |
specifies the width of the marker, which is equal to the height of the marker.
| Default: | 8px |
specifies the marker symbol of the outlier markers.
| Default: | CIRCLE |
specifies the color of the marker that represents the mean values.
| Default: | Specified by the GraphDataDefault:ContrastColor style reference. |
specifies the size of the marker that represents the mean values.
| Default: | 12px |
specifies the symbol of the marker that represents the mean values.
| Default: | DIAMOND |
specifies the color of the line that represents the median values.
| Default: | Specified by the GraphDataDefault:ContrastColor style reference. |
specifies the size of the line that represents the median values.
| Default: | 1px |
specifies whether the boxes are notched.
| Tip: |
The endpoints of the notches are at the
following computed locations.
In the equation, the IQR is the interquartile range and N is the sample size. The medians (central lines) of the two boxes are significantly different at approximately the 0.05 level if the corresponding notches do not overlap.
|
specifies the orientation of the Y axis and of the boxes.
| Default: | VERTICAL |
specifies the color of the outlines around the boxes.
| Default: | Specified by the GraphOutlines:foreground style reference. |
specifies the pattern of the outlines around the boxes.
| Default: | SOLID |
specifies the thickness of the outlines around the boxes.
| Default: | 1px |
specifies one of five definitions used to calculate percentiles.
| Default: | 5 |
| Range: | 1 - 5 |
| See also: | The percentile definitions are described for the Univariate procedure in the Base SAS Procedures Guide, Volume 3 |
specifies whether to use the X column to sort the input data.
| Default: | NONE |
specifies the degree of the transparency of the boxes, background, grid, outlier markers and their labels, and wall, if displayed in a graph.
| Default: | 0 |
| Range: | 0 (opaque) to 1 (entirely transparent) |
| Interaction: | The transparencies can be set individually with the BACKTRANSPARENCY=, DATATRANSPARENCY=, GRIDTRANSPARENCY=, LABELTRANSPARENCY=, and WALLTRANSPARENCY= options. If you specify the TRANSPARENCY= option for a graph, then the individual transparency options can be specified to override it for individual features. The settings remain in effect for other features that are not individually overridden. |
| Interaction: | In a LAYOUT OVERLAY block, the TRANSPARENCY= option only affects the outlier markers and their labels. The LAYOUT OVERLAY statement settings control the transparency of the background, grid, and wall. |
specifies the degree of the transparency of the plot wall or walls.
| Default: | 0 |
| Range: | 0 (opaque) to 1 (entirely transparent) |
| Interaction: | The WALLTRANSPARENCY= option overrides the TRANSPARENCY= option for the graph wall. |
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. |
specifies the colors of the whiskers.
| Default: | Specified by the OUTLINECOLOR= option. |
specifies the patterns of the whiskers.
| Default: | SOLID |
specifies the thickness of the whiskers.
| Default: | 1 px |
specifies whether data is mapped to the primary X axis or to the secondary X (X2) axis.
| Default: | X |
| Interaction: |
Outside of a LAYOUT OVERLAY block,
an individual plot can have only one X axis. The XAXIS= option of a plot specifies
whether the axis is in the primary (bottom) or secondary (top) position. The
XAXISOPTS= option of a plot specifies whether the axis is displayed and specifies
the axis characteristics.
Within a LAYOUT OVERLAY block, multiple plots can share a primary axis and a secondary axis. The primary and secondary axes can have different scales, and the XAXIS= option for a particular plot can map data to either axis. The XAXISOPTS= and X2AXISOPTS= options of a LAYOUT OVERLAY statement specify whether the axes are displayed, and specify the axis characteristics. |
specifies one or more X axis options.
| Requirement: | The list of axis options must be enclosed in parentheses and separated by spaces. |
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. |
specifies whether the grid lines are drawn at the tick marks.
| Default: | FALSE | ||||||
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. | ||||||
| Interaction: |
If you specify or use the default
XGRID= option for the OVERLAY LAYOUT statement, then the XGRID= option specified
for a graph is ignored. Default characteristics for the grid lines are specified
from the following attributes on the GraphGridLines style element:
|
specifies an offset to add to the end that represents high data values on the primary X axis. The offset is expressed as a decimal proportion of the full axis length. For a continuous axis, the offset is added to the highest data value or highest tick value, whichever is greater. For a discreet axis, the offset is added to the highest data value, which is always the highest tick value.
| Default: | Generated as suitable for the graph. |
| Range: | 0 - 1 |
| Interaction: | For a continuous axis, the offset is added after any threshold adjustment is made to the axis. |
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. |
| Main discussion: | THRESHOLDMAX= sub-option. |
specifies an offset to add to the end that represents low data values on the primary X axis. The offset is expressed as a decimal proportion of the full axis length. For a continuous axis, the offset is added to the lowest data value or lowest tick value, whichever is less. For a discreet axis, the offset is added to the lowest data value, which is always the lowest tick value.
| Default: | Generated as suitable for the graph. |
| Range: | 0 - 1 |
| Interaction: | For a continuous axis, the offset is added after any threshold adjustment is made to the axis. |
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. |
| Main discussion: | THRESHOLDMAX= sub-option. |
specifies whether data is mapped to the primary Y axis or to the secondary Y (Y2) axis.
| Default: | Y |
| Interaction: |
Outside of a LAYOUT OVERLAY block,
an individual plot can have only one Y axis. The YAXIS= option of a plot
specifies whether the axis is in the primary (left) or secondary (right) position.
The YAXISOPTS= option of a plot specifies whether the axis is displayed and
specifies the axis characteristics.
Within a LAYOUT OVERLAY block, multiple plots can share a primary axis and a secondary axis. The primary and secondary axes can have different scales, and the YAXIS= option for a particular plot can map data to either axis. The YAXISOPTS= and Y2AXISOPTS= options of a LAYOUT OVERLAY statement specify whether the axes are displayed, and specify the axis characteristics. |
specifies one or more Y axis options.
| Requirement: | The list of axis options must be enclosed in parentheses and separated by spaces. |
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. |
specifies whether grid lines are drawn at the tick marks.
| Default: | FALSE | ||||||
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. | ||||||
| Interaction: |
If you specify or use the default
YGRID= option for the OVERLAY LAYOUT statement, then the YGRID= option specified
for a graph is ignored. Default characteristics for the grid lines are specified
from the following attributes on the GraphGridLines style element:
|
specifies an offset to add to the end that represents high data values on the primary Y axis. The offset is expressed as a decimal proportion of the full axis length. For a continuous axis, the offset is added to the highest data value or highest tick value, whichever is greater. For a discreet axis, the offset is added to the highest data value, which is always the highest tick value.
| Default: | Generated as suitable for the graph. |
| Range: | 0 - 1 |
| Interaction: | For a continuous axis, the offset is added after any threshold adjustment is made to the axis. |
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. |
| Main discussion: | THRESHOLDMAX= sub-option. |
specifies an offset to add to the end that represents low data values on the primary Y axis. The offset is expressed as a decimal proportion of the full axis length. For a continuous axis, the offset is added to the lowest data value or lowest tick value, whichever is less. For a discreet axis, the offset is added to the lowest data value, which is always the lowest tick value.
| Default: | Generated as suitable for the graph. |
| Range: | 0-1 |
| Interaction: | For a continuous axis, the offset is added after any threshold adjustment is made to the axis. |
| Interaction: | Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block. |
| Main discussion: | THRESHOLDMAX= sub-option. |