| TEMPLATE Procedure: Plot Statements (Experimental) |
| BOX Y= numeric-column | expression < / option(s)> ; |
| BOX Y= numeric-column | expression X= column | expression < / option(s)> ; |
| Usage Information |
Box Plot
![[Box Plot]](./images/boxplot.gif)
| Tip: |
The BOX statement displays a single box if given just a Y argument. The BOX 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. |
| LABELFAR= boolean | Specifies whether all outliers or only far outliers are labeled. |
| LABELTRANSPARENCY= number | Specifies the percentage of the transparency of the outlier labels. |
| LINECOLOR= color | style-reference | Specifies the colors 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 marker symbol 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 a 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, and outlier markers and their labels, if displayed in a graph. |
| 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. |
| YAXIS= Y | Y2 | Specifies whether data is mapped to the primary Y axis or the secondary Y (Y2) 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 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 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: | 1 px |
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, and outlier markers and their labels, 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=, and LABELTRANSPARENCY= options. If you specify the TRANSPARENCY= option for a graph, 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. |
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 the secondary X (X2) axis.
| Default: | X |
| Interaction: | 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 whether data is mapped to the primary Y axis or the secondary Y (Y2) axis.
| Default: | Y |
| Interaction: | 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. |