INSET Statement |
A PLOT statement in the BOXPLOT procedure can be followed by a series of INSET and INSETGROUP statements. Each INSET statement in that series produces one inset in the box plot produced by the preceding PLOT statement. If the box plot occupies multiple panels, the inset appears on each panel.
The data requested using the keywords are displayed in the order in which they are specified. Summary statistics requested with an INSET statement are calculated using the observations in all groups.
identify summary statistics or other data to be displayed in the inset. By default, inset statistics are identified with appropriate labels, and numeric values are printed using appropriate formats. However, you can provide customized labels and formats. You provide the customized label by specifying the keyword for that statistic followed by an equal sign (=) and the label in quotes. Labels can have up to 24 characters. You provide the numeric format in parentheses after the keyword. Note that if you specify both a label and a format for a statistic, the label must appear before the format.
The available keywords are listed in Table 25.1.
control the appearance of the inset. Most of these options apply only to traditional graphics and are ignored when ODS Graphics is enabled. Table 25.2 lists all the INSET statement options and identifies those that are valid when ODS Graphics is enabled. Complete descriptions for each option follow.
Keyword |
Description |
---|---|
DATA= |
(label, value) pairs from SAS-data-set |
MEAN |
mean of all observations |
MIN |
minimum observed value |
MAX |
maximum observed value |
NMIN |
minimum group size |
NMAX |
maximum group size |
NOBS |
number of observations in box plot |
STDDEV |
pooled standard deviation |
The DATA= keyword specifies a SAS data set containing (label, value) pairs to be displayed in an inset. The data set must contain the variables _LABEL_ and _VALUE_. _LABEL_ is a character variable of up to 24 characters whose values provide labels for inset entries. _VALUE_ can be character or numeric, and provides values displayed in the inset. The label and value from each observation in the DATA= data set occupy one line in the inset.
The pooled standard deviation requested with the STDDEV keyword is defined as
where is the number of groups, is the size of the th group, and is the variance of the th group.
Option |
Description |
ODS Graphics |
---|---|---|
specifies color of inset background |
||
specifies color of inset header background |
||
specifies color of inset frame |
||
specifies color of inset header text |
||
specifies color of inset drop shadow |
||
specifies color of inset text |
||
specifies data units for POSITION= coordinates |
||
specifies font of inset text |
||
specifies format of values in inset |
✓ |
|
specifies inset header text |
✓ |
|
specifies height of inset and header text |
||
suppresses frame around inset |
✓ |
|
specifies position of inset |
✓ |
|
specifies reference point of inset positioned with POSITION= coordinates |
Following are descriptions of the options that you can specify in the INSET statement after a slash (/). Only those options marked with † are applicable when ODS Graphics is enabled.
specifies the color of the inset background (including the header background if you do not specify the CFILLH= option).
If you do not specify the CFILL= option, then by default the background is empty. This means that items that overlap the inset (such as box-and-whiskers plots or reference lines) show through the inset. If you specify any value for the CFILL= option, then overlapping items no longer show through the inset. Specify CFILL=BLANK to leave the background uncolored and also to prevent items from showing through the inset.
specifies the color of the header background. By default, if you do not specify a CFILLH= color, the CFILL= color is used.
specifies the color of the frame around the inset. By default, the frame is the same color as the axis of the plot.
specifies the color of the header text. By default, if you do not specify a CHEADER= color, the INSET statement CTEXT= color is used.
specifies the color of the drop shadow. If you do not specify the CSHADOW= option, a drop shadow is not displayed.
specifies the color of the text in the inset. By default, the inset text color is the same as the other text in the box plot.
specifies that data coordinates be used in positioning the inset with the POSITION= option. The DATA option is available only when you specify POSITION, and it must be placed immediately after the coordinates . See the entry for the POSITION= option.
specifies a format for all the values displayed in an inset. If you specify a format for a particular statistic, then this format overrides the format you specified with the FORMAT= option.
specifies the header text. The string can be up to 40 characters. If you do not specify the HEADER= option, no header line appears in the inset.
determines the position of the inset. The position can be a compass point keyword, a margin keyword, or (for traditional graphics) a pair of coordinates . You can specify coordinates in axis percent units or axis data units. For more information, see the section Positioning Insets. By default, POSITION=NW, which positions the inset in the upper-left (northwest) corner of the plot.
specifies the reference point for an inset that is positioned by a pair of coordinates with the POSITION= option. Use the REFPOINT= option with POSITION= coordinates. The REFPOINT= option specifies which corner of the inset frame you want positioned at coordinates . The keywords BL, BR, TL, and TR represent bottom left, bottom right, top left, and top right, respectively. The default is REFPOINT=BL.
If you specify the position of the inset as a compass point or margin keyword, the REFPOINT= option is ignored.