Previous Page | Next Page

The BOXPLOT Procedure

Overview: BOXPLOT Procedure

The BOXPLOT procedure creates side-by-side box-and-whiskers plots of measurements organized in groups. A box-and-whiskers plot displays the mean, quartiles, and minimum and maximum observations for a group. Throughout this chapter, this type of plot, which can contain one or more box-and-whiskers plots, is referred to as a box plot.

The PLOT statement of the BOXPLOT procedure produces a box plot. You can specify more than one PLOT statement to produce multiple box plots. You can use options in the PLOT statement to do the following:

  • control the style of the box-and-whiskers plots

  • specify one of several methods for calculating quantile statistics (percentiles)

  • add block legends and symbol markers to reveal stratification in data

  • display vertical and horizontal reference lines

  • control axis values and labels

  • overlay the box plot with plots of additional variables

  • control the layout and appearance of the plot

The INSET and INSETGROUP statements produce boxes or tables (referred to as insets) of summary statistics or other data on a box plot. An INSET statement produces an inset of statistics pertaining to the entire box plot. An INSETGROUP statement produces an inset containing statistics calculated separately for each group. An INSET or INSETGROUP statement by itself does not produce a display; it must be used with a PLOT statement.

You can use options in an INSET or INSETGROUP statement to control insets in these ways:

  • specify the position of the inset

  • specify a header for the inset

  • specify graphical enhancements, such as background colors, text colors, text height, text font, and drop shadows

The BOXPLOT procedure can produce two kinds of graphical output:

  • traditional graphics

  • ODS Statistical Graphics output

PROC BOXPLOT produces traditional graphics box plots by default. These graphs are saved in graphics catalogs. Their appearance is controlled by the SAS/GRAPH GOPTIONS, AXIS, and SYMBOL statements (as described in SAS/GRAPH: Reference) and numerous specialized PLOT statement options.

ODS Statistical Graphics (or ODS Graphics for short) is an extension to the Output Delivery System (ODS) that is invoked when you use the ODS GRAPHICS statement prior to your procedure statements. An ODS graph is produced in ODS output (not a graphics catalog), and the details of its appearance and layout are controlled by ODS styles and templates rather than by SAS/GRAPH statements and procedure options. See Chapter 21, Statistical Graphics Using ODS, for a thorough discussion of ODS Graphics.

Prior to SAS 9.2, the box plots produced by PROC BOXPLOT were extremely basic by default. Producing attractive graphical output required the careful selection of colors, fonts, and other elements, which were specified via SAS/GRAPH statements and PLOT statement options. Beginning with SAS 9.2, the default appearance of box plots is governed by the prevailing ODS style, which automatically produces attractive, consistent output. You can also specify the NOGSTYLE system option to prevent the ODS style from affecting the appearance of traditional graphs.

See the section Getting Started: BOXPLOT Procedure for examples producing box plots via the traditional graphics system and ODS Graphics.

Previous Page | Next Page | Top of Page