Example Program and Statement Details

Example Graph

The following graph was generated by the Example Program:
Example Box Plot Graph Using Parameters

Example Program

proc template;
  define statgraph boxplotparm1;
    begingraph;
      entrytitle "City Mileage for Vehicle Types";
      layout overlay;
       boxplotparm y=value x=x stat=stat /
         datalabel=datalabel spread=true ;     
      endlayout;
    endgraph;
  end;
run;
 
proc sgrender data=boxdata template=boxplotparm1;
run;
The following input data generated the box for Sedan in the graph. See Generalized Macro for BOXPLOTPARM Data to see the code for creating all of the data.
STAT      X          VALUE    DATALABEL
 ...      
N         Sedan        262
MEAN      Sedan    21.0840
MEDIAN    Sedan         20 
Q1        Sedan         18 
Q3        Sedan         24 
STD       Sedan     4.2346
OUTLIER   Sedan         36    Honda
OUTLIER   Sedan         35    Toyota
OUTLIER   Sedan         35    Toyota
OUTLIER   Sedan         38    Volkswagen
MIN       Sedan         12 
MAX       Sedan         33 
 ...

Statement Summary

The BOXPLOTPARM statement requires pre-computed input data. One reason to choose this statement over the BOXPLOT statement is that you can control the computational technique used to compute various statistics for the box plot, such as the mean, quartiles, location of fences, outlier definition, and so on. See Generalized Macro for BOXPLOTPARM Data for examples of such computations using PROC SUMMARY and multiple DATA steps.
The BOXPLOTPARM statement displays a single box if given just Y and a STAT argument. It displays multiple boxes if given both Y and X and a STAT argument and X has more than one unique value.
By default for numeric or character columns, the category (X) axis is TYPE=DISCRETE. You can override the default and specify TYPE=LINEAR in the parent layout, provided that the X column is numeric. The axis for the analysis (Y) column is always LINEAR. When the X axis is LINEAR, you can use the INTERVALBOXWIDTH= option to specify the box width.
When ORIENT=VERTICAL, the X (or X2) axis is used for the X column and the Y (or Y2) axis is used for the Y column. When ORIENT=HORIZONTAL, the X (or X2) axis is used for the Y column and the Y (or Y2) axis is used for the X column.
Two basic box plot representations can be drawn with the BOXPLOTPARM statement: a schematic (Tukey) box plot and a skeletal box plot. See the EXTREME= option for details.
The following figure illustrates the box plot elements:
box plot elements
As shown in the figure, the bottom and top edges of the box are located at the 1st quartile (25th percentile) and 3rd quartile (75th percentile) of the sample. Within the box, you can display the median (50th percentile) as a line and the mean as a marker (see the DISPLAY= option).
You can also display markers and data labels for outliers. Outliers are observations that are more extreme than the upper and lower fences (). Outliers that are beyond upper and lower far fences () are called FAR OUTLIERS and can also be identified and labeled. From a graphical perspective, the location of fences along the axis are known, but there is no line or marker that displays a fence. (See DISPLAY=, LABELFAR=, and DATALABEL= options).
Finally, you can control the range represented by the whiskers. By default, the whiskers are drawn from the upper edge of the box to the MAX value, and from the lower edge of the box to the MIN value. (See the EXTREME= option.)

Input Data Requirements for the BOXPLOTPARM Statement

At a minimum, valid data for the BOXPLOTPARM statement must provide a numeric column (Y=) that contains calculated statistics for an analysis, and a string column (STAT=) that identifies each statistic. The Y column must contain nonmissing values for the Q1 (25th percentile) and Q3 (75th percentile) statistics. If Y values are missing or not supplied for other statistic values, then those statistics are not displayed in the plot, regardless of syntax requests to display them.
For example, a petroleum company uses a turbine to heat water into steam that is pumped into the ground to make oil more viscous and easier to extract. This process occurs 20 times daily, and the amount of power (in kilowatts) used to heat the water to the desired temperature is recorded. The following data show the statistics that are calculated for one day of this process:
PowerOutputs
Statistic
3180.00
MIN
3340.00
Q1
3487.40
MEAN
3490.00
MEDIAN
3610.00
Q3
4050.00
MAX
20.00
N
To plot the data from the preceding table, the following BOXPLOTPARM statement uses the Y= and STAT= arguments to generate a single box plot for the recorded statistics:
BOXPLOTPARM Y=PowerOutputs STAT=Statistic; 
Graph with Single Box Plot
If the data contain statistics for multiple days of the process, a third column in the data must be present to identify the days that the statistics were recorded. For example, the following data show the statistics that are calculated for two days of this process:
Day
PowerOutputs
Statistic
04JUL
3180.00
MIN
04JUL
3340.00
Q1
04JUL
3487.40
MEAN
04JUL
3490.00
MEDIAN
04JUL
3610.00
Q3
04JUL
4050.00
MAX
04JUL
20.00
N
05JUL
3179.00
MIN
05JUL
3333.50
Q1
05JUL
3471.65
MEAN
05JUL
3419.50
MEDIAN
05JUL
3605.00
Q3
05JUL
3849.00
MAX
05JUL
20.00
N
To plot the data from the preceding table, the BOXPLOTPARM statement needs the Y=, STAT=, and X= arguments to generate a separate box plot for each day that the statistics were recorded:
   BOXPLOTPARM Y=PowerOutputs STAT=Statistic X=Day; 
Graph with Two Box Plots
See Generalized Macro for BOXPLOTPARM Data for a more complete example of providing input data for BOXPLOTPARM.

Arguments

Y=numeric-column | expression
specifies the column for the Y values. The Y values must be the statistical values needed for the box plot. At a minimum, there must be nonmissing values for the 25th and 75th percentiles.
X=column | expression
specifies the column for the X values. The X values must qualify or classify the values in the Y column. This optional argument is used to create a plot box for each classifier.
STAT=string-column
specifies the statistic that is represented by the value in the Y column. Valid STAT= values include the following (the Requirement paragraph that follows this list of STAT= values shows the data restrictions that apply to the STAT= specifications):
Q1
1st quartile (25th percentile). The data must contain a nonmissing value for this quartile.
Q3
3rd quartile (75th percentile). The data must contain a nonmissing value for this quartile.
MAX
maximum data value less than or equal to the upper fence.
MIN
minimum data value greater than or equal to the lower fence.
MEAN
data mean.
MEDIAN
data median.
OUTLIER
an observation outside the lower and upper fences. The fences are located at a distance 1.5 times the Interquartile Range (IQR = Q3–Q1) above and below the box. The outliers are labeled when the DATALABEL= option is used.
FAROUTLIER
an observation outside the lower and upper far fences. The far fences are located at a distance 3 times the Interquartile Range (IQR = Q3–Q1) above and below the box. The far outliers are labeled when the DATALABEL= option is used. Specify that LABELFAR=TRUE to label only the far outliers but not the outliers.
N
subgroup sample size. The N value is not shown in the plot but is used to calculate notch locations when the DISPLAY= option displays notches.
STD
data standard deviation.
BOXWIDTH
width of a box as a ratio of the maximum possible width. The range of values is 0 (narrowest) to 1 (widest). The default is 0.4. If the Y value corresponding to BOXWIDTH is in range, it overrides the setting that is specified in the BOXWIDTH= option.
Requirement: Nonmissing Y values for STAT observations of Q1 and Q3 are required for a box to be drawn. Other STAT values can be omitted or have missing Y values. The STAT values, if present, must conform to the following rules for a box to be displayed:
Q1 <= MEDIAN <= Q3
MIN <= MAX
STD >= 0
N > 0

Options

Statement Option
Description
Specifies the width of a box as a ratio of the maximum possible width.
Specifies the shape at the ends of the whiskers.
Specifies the width of the group clusters as a fraction of the midpoint spacing.
Specifies that a connect line joins a statistic from box to box.
Specifies the properties of the line connecting multiple boxes.
Specifies the labels of the outliers.
Specifies the color and font attributes of the outlier labels.
Specifies the degree of the transparency of the box outlines, box fill, whiskers, mean, median, caps, connect lines, and outliers, if displayed.
Specifies an amount to offset all boxes from the discrete X ticks.
Specifies the box plot features to display.
Specifies the statistics to be displayed for each box.
Specifies whether the whiskers can extend beyond the fences.
Specifies the appearance of the interior fill area of the boxes.
Creates a box plot for each unique group value of the specified column.
Specifies how to display the boxes that represent group values for the coordinate pairs.
Specifies the ordering of the grouped boxes for each category value.
Specifies whether missing values of the group variable are included in the plot.
Specifies indices for mapping line attributes (color and pattern) to one of the GraphData1–GranphDataN style elements.
Specifies the box width when an interval category (X) column is specified.
Specifies whether all outliers or only far outliers are labeled.
Specifies the label for a legend.
Specifies the attributes of the maker that represents the mean values.
Specifies the properties of the line that represents the median values.
Assigns a name to a plot statement for reference in other template statements.
Specifies the orientation of the Y axis and of the boxes.
Specifies the attributes of the outlier makers.
Specifies the information to display when the cursor is positioned over an outlier.
Specifies the line properties of the box outlines.
Specifies that the data columns and plot type for this plot be used for determining default axis features.
Specifies user-defined roles that can be used to display information in the tooltips.
Specifies whether outliers with the same value are spread out to avoid overlap.
Specifies the information to display when the cursor is positioned over a box or whisker in the box plot.
Specifies display formats for the information that is defined by the tooltip roles.
Specifies display labels for the information that is defined by the tooltip roles.
Specifies the line properties of the whiskers and caps.
Specifies whether data are mapped to the primary X (bottom) axis or the secondary X2 (top) axis.
Specifies whether data are mapped to the primary Y (left) axis or the secondary Y2 (right) axis.
BOXWIDTH=number
specifies the width of a box as a ratio of the maximum possible width.
Default:0.4 for non-grouped data, 0.6 for grouped data
Range: 0 (narrowest) to 1 (widest)
Interaction: This setting is overridden by the Y value whenever STAT=BOXWIDTH and the corresponding Y value is in range.
Interaction: For grouped box plots with a discrete X (category) axis, the box width is a percentage of the CLUSTERWIDTH.
CAPSHAPE=SERIF | LINE | BRACKET
specifies the shape at the ends of the whiskers.
Default: The GraphBox:CapStyle style reference.
SERIF
specifies a short line perpendicular to the whisker.
LINE
specifies a line perpendicular to whisker extending the width of the box.
BRACKET
specifies a line perpendicular to the whisker extending the width of the box with short extensions at the ends drawn in the direction of the box.
Interaction: The cap color and the thickness are specified by the WHISKERATTRS= option. The cap pattern is always solid.
Interaction: The DISPLAY= option must include CAPS for cap lines to be shown.
CLUSTERWIDTH= number
specifies the width of the group clusters as a fraction of the midpoint spacing on a discrete axis or a fraction of the minimum interval between adjacent data values on an interval axis.
Default: 0.7
Range: 0.1 (narrowest) to 1 (widest)
Interaction: For this option to take effect, the GROUP= option must also be specified, and the GROUPDISPLAY= option must be set to CLUSTER.
Clusters in a Box Plot
CONNECT= MEAN | MEDIAN | Q1 | Q3 | MIN | MAX
specifies that a connect line joins a statistic from box to box.
Default: The GraphBox:Connect style reference.
Requirement: The DISPLAY= option must contain the CONNECT display-option for the connect line to be displayed.
Interaction: This option only applies when the X= argument is used to generate multiple boxes.
CONNECTATTRS=style-element | style-element (line-options) | (line-options)
specifies the attributes of the lines connecting multiple boxes. See General Syntax for Attribute Options for the syntax on using a style-element and Line Options for available line-options.
Default: The GraphConnectLine style element.
Interaction: If there is only one box, this option is ignored.
Interaction: If the DISPLAY= option does not include CONNECT, or if the GROUP= option is used, this option is ignored.
DATALABEL=column
specifies the labels of the values that are identified as outlier or far outlier by the STAT= column. Either a numeric or a character column can be used.
Default: no data labels are displayed
Interaction: This option is ignored if EXTREME=TRUE or the DISPLAY= option does not display the outliers.
See also: LABELFAR= option
DATALABELATTRS=style-element | style-element (text-options) | (text-options)
specifies the color and font attributes of the outlier labels. See General Syntax for Attribute Options for the syntax on using a style-element and Text Options for available text-options.
Default: The GraphDataText style element.
Interaction: This option is ignored if EXTREME=TRUE or the DISPLAY= option does not display the outliers.
DATATRANSPARENCY=number
specifies the degree of the transparency of the box outlines, box fill, whiskers, mean, median, caps, connect lines, and outliers, if displayed.
Default: 0
Range: 0 (opaque) to 1 (entirely transparent).
Tip: The FILLATTRS= option can be used to set transparency for just the interior fill area of the boxes. You can combine this option with FILLATTRS= to set one transparency for the box outlines and the whiskers, mean, median, caps, and connect lines, but a different transparency for the box fills. Example:
datatransparency=0.2 fillattrs=(transparency=0.6)
DISCRETEOFFSET=number
specifies an amount to offset all boxes from the discrete X ticks.
Default: 0 (no offset, all boxes are centered on the discrete ticks)
Range: -0.5 to +0.5, where .5 represents half the distance between discrete ticks. A positive offset is to the right when ORIENT=VERTICAL, and up when ORIENT=HORIZONTAL. (If the layout's axis options set REVERSE=TRUE, then the offset direction is also reversed.)
Details: This feature is useful for graphing multiple response variables side by side on a common axis. By default within an overlay-type layout, if multiple BOXPLOTPARM statements are used with different analysis variables, the boxes for matching X values are centered on the ticks. Depending on the data, the boxes might be superimposed. The following code fragment shows the default box positioning:
layout overlay / cycleattrs=true 
    yaxisopts=(label="Miles Per Gallon");

  boxplotparm x=type y=mpg_city stat=y_stat    / name="City" ;
  boxplotparm x=type y=mpg_highway stat=y_stat / name="Highway" ;

  discretelegend "City" "Highway";
endlayout;
Box Plot with Boxes Centered on Discrete X Ticks
To place the different response values side by side, you can assign a different offset to each BOXPLOTPARM statement. The BOXWIDTH= option can be used in conjunction with the DISCRETEOFFSET= option to create narrower boxes when desired.
layout overlay / cycleattrs=true 
    yaxisopts=(label="Miles Per Gallon");

  boxplotparm x=type y=mpg_city stat=y_stat    / name="City"
    discreteoffset=.2 ;
  boxplotparm x=type y=mpg_highway stat=y_stat / name="Highway"
    discreteoffset=-.2 ;

  discretelegend "City" "Highway";
endlayout;
Box Plot with Tick Offsets
DISPLAY=STANDARD | ALL | (display-options)
specifies which additional features of the box plot to display.
Default: The GraphBox:DisplayOpts style reference. If this style element does not exist, the default is STANDARD.
STANDARD
displays this combination of features (CAPS FILL MEAN MEDIAN OUTLIERS)
ALL
displays all features
(display-options)
a list of features to be displayed. The list must be enclosed in parentheses and can include any of the following:
CAPS displays caps at the ends of the whiskers
CONNECT displays the line connecting multiple boxes
FILL displays filled boxes
MEAN displays the mean symbol within the box
MEDIAN displays the median line within the box
NOTCHES displays notched boxes
OUTLIERS displays markers for the outliers
Restriction: The display features requested can be displayed only if the input data includes this information.
Interaction: If EXTREME=TRUE, then the OUTLIERS feature is ignored
To control the appearance of these features, use the CONNECTATTRS=, FILLATTRS=, MEANATTRS=, MEDIANATTRS=, OUTLIERATTRS=, and WHISKERATTRS= options. The WHISKERATTRS= option controls affects both CAPS and WHISKERS.
Tip: Regardless of which display-options are being displayed, this option does not affect the axis range.
Details: 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. Endpoints of the Notches
DISPLAYSTATS=NONE | STANDARD | ALL | (statistics-list)
specifies the statistics to be displayed for each box.
Default: NONE
NONE
does not display any statistics
STANDARD
displays N, MEAN, and STD
ALL
displays all available statistics (see the statistics-list)
(statistics-list)
specifies a list of features to be displayed. The list must be enclosed in parentheses and can include any of the following:
MAX Maximum data value below the box upper fence
MEAN Mean data value for box
MEDIAN Median data value for box
MIN Minimum data value above the box upper fence
N Number of observations for box
Q1 Lower quartile (25th percentile) for box
Q3 Upper quartile (75th percentile) for box
STD Standard deviation of the data for box
RANGE Range of the data (MAX–MIN)
IQR Interquartile range (Q3–Q1)
Restriction: This option is ignored if ORIENT=HORIZONTAL
Restriction: Only those statistics included in the STAT= column can be displayed. RANGE requires both MAX and MIN to be included. IQR requires both Q1 and Q3 to be included.
EXTREME=boolean
specifies whether the whiskers can extend beyond the fences.
Default: FALSE
FALSE
specifies that whiskers be 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. This representation is sometime called a schematic box and whisker plot or Tukey box and whisker plot.
TRUE
specifies that whiskers be 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. This representation is sometime called a skeletal box and whisker plot.
Interaction: This option overrides the DATALABEL=, DATALABELATTRS=, LABELFAR=, OUTLIERATTRS=, and SPREAD= options.
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. (SeeExample Program and Statement Details .)
FILLATTRS=style-element | style-element (fill-options) | (fill-options)
specifies the appearance of the interior fill area of the boxes. See General Syntax for Attribute Options for the syntax on using a style-element and Fill Options for available fill-options.
Default:
  • For non-grouped data, the Color attribute of GraphDataDefault style element.
  • For grouped data, the Color attribute of GraphData1 – GraphDataN style elements.
Interaction: For this option to have any effect, the fill must be enabled by the ODS style or the DISPLAY= option.
Tip: The DATATRANSPARENCY= option sets the transparency for the box outlines, box fill, whiskers, mean, median, caps, connect lines, and outliers. You can combine this option with DATATRANSPARENCY= to set one transparency for the box outlines and the whiskers, mean, median, caps, and connect lines, but a different transparency for the box fills. Example:
datatransparency=0.2 fillattrs=(transparency=0.6)
GROUP=column | discrete-attr-var | expression
creates a box plot for each unique group value of the specified column.
discrete-attr-var
specifies a discrete attribute variable that is defined in a DISCRETEATTRVAR statement.
Restriction: A discrete attribute variable specification must be a direct reference to the attribute variable. It cannot be set by a dynamic variable.
Default:
  • Each distinct group value is represented in the graph by a different box outline color. The outline colors are defined by the GraphData1:ContrastColor–GraphDataN:ContrastColor style references.
  • If the MEDIAN, CAPS, or NOTCHES are enabled by the DISPLAY= option, each of these features uses the same color as the box outline. Line styles do not change by group value.
  • If the MEAN or OUTLIERS are enabled by the DISPLAY= option, each distinct group value is represented by a different marker. The markers are defined by the MarkerSymbol and ContrastColor attributes of the GraphData1–GraphDataN style elements. A marker is used for both MEAN and OUTLIERS, if displayed.
  • If box fills are enabled by the ODS style or by the DISPLAY= option, each distinct group value is represented in the graph by a different fill color. The fill colors are defined by the GraphData1:Color–GraphDataN:Color style references.
Interaction: The box plot display depends on the setting for the GROUPDISPLAY= option.
Interaction: Connect lines are not drawn for grouped data.
Interaction: By default, the group values are mapped in the order of the data. The GROUPORDER= option can be used to control the sorting order of the group values. The INDEX= option can be used to alter the default sequence of colors and markers.
Interaction: The INCLUDEMISSINGGROUP option controls whether missing group values are considered a distinct group value.
Tip: The representations that are used to identify the groups can be overridden individually. For example, each distinct group value is represented by a different line pattern for the box outlines, but the PATTERN= setting on the OUTLIERATTRS= option could be used to assign the same line pattern to all box outlines and connect lines.
GROUPDISPLAY=OVERLAY | CLUSTER
specifies how to display the boxes that represent group values for the coordinate pairs. The following example shows a box plot with GROUPDISPLAY=CLUSTER:
Box Plot with Clustered Boxes
Default: OVERLAY
OVERLAY
draws boxes for a given group value at the exact coordinate. Depending on the data, boxes at a given coordinate might overlap.
CLUSTER
draws boxes for a given group value adjacent to each other. This option is available only when the category (X) column is discrete.
Interaction: This option is ignored unless GROUP= is specified.
Tip: Use the CLUSTERWIDTH= option to control the width of the clusters when CLUSTER is in effect.
GROUPORDER=DATA | ASCENDING | DESCENDING
specifies the ordering of the grouped boxes for each category value. It also sets the default order of the groups in the legend.
Default: DATA
DATA
shows each group within a category in data order of the group column.
ASCENDING
shows each group within a category in ascending order of the group column.
DESCENDING
shows each group within a category in descending order of the group column.
Interaction: This option is ignored unless GROUP= is specified.
Note: Attributes such as color, symbol, and pattern are assigned to each group in the DATA order by default regardless of the GROUPORDER= option setting.
Note: The ASCENDING and DESCENDING settings linguistically sort the group values within each category (or X value) for display position purposes only. The data order of the observations and the visual attributes that are assigned to the group values remain unchanged.
INCLUDEMISSINGGROUP=boolean
specifies whether missing values of the group variable are included in the plot.
Default: TRUE
Interaction: For this option to take effect, the GROUP= option must also be specified.
Tip: Unless a discrete attribute map is in effect or the INDEX= option is used, the attributes of the missing group value are determined by the GraphMissing style element except when the MISSING= system option is used to specify a non-default missing character or when a user-defined format is applied to the missing group value. In those cases, the attributes of the missing group value are determined by a GraphData1–GraphDataN style element.
INDEX=numeric-column | expression
specifies indices for mapping line attributes (color and pattern) to one of the GraphData1–GranphDataN style elements.
Default: no default
Restriction: If the value of the numeric-column is missing or is less than 1, the observation is not used in the analysis. If the value is not an integer, only the integer portion is used.
Interaction: For this option to take effect, the GROUP= option must also be specified.
Interaction: All of the indexes for a specific group value must be the same. Otherwise, the results are unpredictable.
Interaction: The index values are 1-based indices. For the style definitions in GraphData1–GraphDataN, if the index value is greater than N, then a modulo operation remaps that index value to a number less than N to determine which style to use.
Interaction: If this option is not used, then the group values are mapped in the order of the data.
Discussion: Indexing can be used to collapse the number of groups that are represented in a graph. For more information, see Remapping Groups for Grouped Data.
INTERVALBOXWIDTH= AUTO | dimension
specifies the box width when an interval category (X) column is specified.
Default: AUTO
AUTO Uses 85% of the smallest interval between any two boxes for the given plot.
dimension Sets the box width to the specified value.
Restriction: The axis type for the category axis (X by default) must be LINEAR, and the X column must be numeric.
LABELFAR=boolean
specifies whether all outliers or only far outliers are labeled. For more information about outliers, see the Example Program and Statement Details.
Default: FALSE
FALSE
the labels specified by the DATALABEL= option apply to both outliers and far outliers.
TRUE
the labels specified by the DATALABEL= option only apply to far outliers.
Interaction: This option is ignored if EXTREME=TRUE or the DISPLAY= option does not display the outliers.
LEGENDLABEL= "string"
specifies a label for the legend item that is associated with this plot.
Default: The string specified on the NAME= option.
Restriction: This option applies only to an associated DISCRETELEGEND statement.
Interaction: If the GROUP= option is specified, this option is ignored.
MEANATTRS=style-element | style-element (marker-options) | (marker-options)
specifies the attributes of the marker representing the mean within the box. See General Syntax for Attribute Options for the syntax on using a style-element and Marker Options for available marker-options.
Default:
  • For non-grouped data, GraphBoxMean style element.
  • For grouped data, the MarkerSymbol, Markersize, and ContrastColor attributes of the GraphData1 – GraphDataN style elements.
Interaction: This option is ignored if the DISPLAY= option does not display the mean.
MEDIANATTRS=style-element | style-element (line-options) | (line-options)
specifies the appearance of the line representing the median within the box. See General Syntax for Attribute Options for the syntax on using a style-element and Line Options for available line-options.
Default:
  • For non-grouped data, the GraphBoxMedian style element.
  • For grouped data, the LineStyle and LineThickness attributes of the GraphBoxMedian style element, and the ContrastColor attribute of the GraphData1 – GraphDataN style elements.
Interaction: This option is ignored if the DISPLAY= option does not display the median.
NAME="string"
assigns a name to a plot statement for reference in other template statements.
Default: no default
Restriction: The string is case sensitive, cannot contain spaces, and must define a unique name within the template.
Interaction: The string is used as the default legend label if the LEGENDLABEL= option is not used.
The specified name is used primarily in legend statements to coordinate the use of colors and line patterns between the graph and the legend.
ORIENT= VERTICAL | HORIZONTAL
specifies the orientation of the Y axis and of the boxes.
Default: VERTICAL
OUTLIERATTRS=style-element | style-element (marker-options) | (marker-options)
specifies the attributes of the markers representing the outliers. See General Syntax for Attribute Options for the syntax on using a style-element and Marker Options for available marker-options.
Default:
  • For non-grouped data, GraphOutlier style element.
  • For grouped data, the MarkerSymbol, Markersize, and ContrastColor attributes of the GraphData1 – GraphDataN style elements.
Interaction: This option is ignored if EXTREME=TRUE or the DISPLAY= option does not display the outliers.
OUTLIERTIP=(role-list)
specifies the information to display when the cursor is positioned over an outlier. If this option is used, it replaces all of the information that is displayed by default. Roles for columns that do not contribute to the box plot can be specified along with roles that do contribute.
Default: The columns assigned to these roles are automatically included in the tooltip information: X and Y.
(role-list)
an ordered, blank-separated list of unique BOXPLOTPARM roles. BOXPLOTPARM roles for OUTLIERTIP include X, Y, STAT, and DATALABEL.
Note: In the tooltip, the STAT role displays the text “outlier” or “far outlier” as applicable.
The following example displays tooltips for the columns that are assigned to the X and Y roles, and also the data column OBS, which is not assigned to any pre-defined BOXPLOTPARM role. The OBS column must first be assigned a role:
ROLENAME=(TIP1= OBS) OUTLIERTIP=(X Y TIP1)
Requirement: To generate tooltips, you must include an ODS GRAPHICS ON statement that has the IMAGEMAP option specified, and write the graphs to the ODS HTML destination.
Interaction: The labels and formats for the OUTLIERTIP variables can be controlled with the TIPLABEL= and TIPFORMAT= options.
See Also: The ROLENAME= option for specifying user-defined roles. The TIP option for specifying the information to display when the cursor is positioned over a box or whisker in the box plot.
OUTLINEATTRS=style-element | style-element (line-options) | (line-options)
specifies the appearance of the box outline. See General Syntax for Attribute Options for the syntax on using a style-element and Line Options for available line-options.
Default: The GraphOutlines style element.
PRIMARY=boolean
specifies that the data columns for this plot and the plot type be used for determining default axis features.
Default: FALSE
Restriction: This option is ignored if the plot is placed under a GRIDDED or LATTICE layout block.
Details: This option is needed only when two or more plots within an overlay-type layout contribute to a common axis. For more information, see When Plots Share Data and a Common Axis.
ROLENAME=(role-name-list)
specifies user-defined roles that can be used to display information in the tooltips.
Default: no user-defined roles
(role-name-list)
a blank-separated list of role-name = column pairs.
For example, ROLENAME=(TIP1=OBS) assigns the column OBS to the user-defined role TIP1.
Requirement: The role names that you choose must be unique and different from the pre-defined roles X, Y, STAT, DATALABEL , N, STD, MIN, MAX, MEAN, MEDIAN, Q1, Q3, and BOXWIDTH.
This option provides a way to add to the data columns that appear in tooltips that are specified by the OUTLIERTIP= and TIP= options.
SPREAD=boolean
specifies whether outliers with the same value are spread out to avoid overlap. For vertical box plots this means offsetting the outliers horizontally. If this option is false, outliers with the same value are plotted in the same position. Thus, only one is visible
Default: FALSE
Interaction: This option is ignored if EXTREME=TRUE or the DISPLAY= option does not display the outliers.
TIP=(role-list)
specifies the information to display when the cursor is positioned over a box or whisker in the box plot. If this option is used, it replaces all of the information that is displayed by default. Roles for columns that do not contribute to the box plot can be specified along with roles that do contribute.
Default: The columns assigned to these roles are automatically included in the tooltip information: X, N, MIN, MAX, Q1, Q3, MEAN, MEDIAN, and STD.
(role-list)
an ordered, blank-separated list of unique BOXPLOTPARM roles. BOXPLOTPARM roles for TIP include X, N, STD, MIN, MAX, MEAN, MEDIAN, Q1, Q3 and BOXWIDTH.
User-defined roles are defined with the ROLENAME= option.
The following example displays tooltips for the columns assigned to the roles X and Y, and also to the data column OBS, which is not assigned to any pre-defined BOXPLOTPARM role. The OBS column must first be assigned a role.
ROLENAME=(TIP1=OBS)
TIP=(TIP1 X Y)
Requirement: To generate tooltips, you must include an ODS GRAPHICS ON statement that has the IMAGEMAP option specified, and write the graphs to the ODS HTML destination.
Requirement: If a user-defined role is specified in the ROLENAME= option, then the data values for that role must be identical for each distinct X (category) value.
Interaction: The labels and formats for the TIP variables can be controlled with the TIPLABEL= and TIPFORMAT= options.
Tip: Statistics such as N, MIN, MAX are special roles. They are not column-based like the X role.
See Also: The ROLENAME= option for specifying user-defined roles. The OUTLIERTIP= option for specifying the information to display when the cursor is positioned over an outlier.
TIPFORMAT=(role-format-list)
specifies display formats for the information that is defined by the tooltip roles.
Default: The column format of the variable assigned to the role or BEST6. if no format is assigned to a numeric column.
(role-format-list)
a list of role-name = format pairs separated by blanks.
ROLENAME=(TIP1=OBS) 
TIP=(TIP1 X MEAN MIN MAX) TIPFORMAT=(X=4. TIP1=4.)
Requirement: This option provides a way to control the formats of columns that appear in tooltips. Only the roles that appear in the OUTLIERTIP or TIP options are used.
Interaction: For this option to have any effect, a column must be assigned to each of the specified roles.
TIPLABEL=(role-label-list)
specifies display labels for the information that is defined by the tooltip roles.
Default: The column label or column name of the variable that is assigned to the role.
(role-label-list)
a list of role-name = "string" pairs separated by blanks.
ROLENAME=(TIP1=OBS)
TIP=(TIP1 X MEAN MIN MAX) OUTLIERTIP=(TIP1)
TIPLABEL=(X="Box" TIP1="Observeration")
 
Requirement: This option provides a way to control the labels of columns that appear in tooltips. Only the roles that appear in the OUTLIERTIP= or TIP= options are used.
Interaction: For this option to have any effect, a column must be assigned to each of the specified roles.
WHISKERATTRS=style-element | style-element (line-options) | (line-options)
specifies the line properties of the whiskers and caps. See General Syntax for Attribute Options for the syntax on using a style-element and Line Options for available line-options.
Default:
  • For non-grouped data, the GraphBoxWhisker style element.
  • For grouped data, the LineStyle and LineThickness attributes of the GraphBoxWhisker style element, and the ContrastColor attribute of the GraphData1 – GraphDataN style elements.
Restriction: The caps are always drawn with a solid line.
XAXIS=X | X2
specifies whether data are mapped to the primary X (bottom) axis or to the secondary X2 (top) axis.
Default: X
Interaction: This option is ignored if the X= argument is not specified.
Interaction: The overall plot specification and the layout type determine the axis display for the specified axis. For more information, see How Axis Features Are Determined.
YAXIS=Y | Y2
specifies whether data are mapped to the primary Y (left) axis or to the secondary Y2 (right) axis.
Default: Y
Interaction: The overall plot specification and the layout type determine the axis display for the specified axis. For more information, see How Axis Features Are Determined.