The PARETO Procedure

Example 15.10 Customizing Inset Labels and Formatting Values

Note: See Customizing Inset Labels and Formatting Values in the SAS/QC Sample Library.

When you add an inset to a Pareto chart, by default each inset statistic is identified by an appropriate label and its value is displayed using an appropriate format. However, you might want to provide your own labels and formats. For example, in Figure 15.7 the default label used for the N statistic is not very descriptive. The following statements produce a comparative Pareto chart whose insets display longer labels for both statistics. A format that uses one decimal place is also specified for each statistic. (These are integer values—the decimals are added only to demonstrate this feature.) Note that a single INSET statement produces an inset in each cell of the comparative Pareto chart.

proc pareto data=Failure3;
   vbar Cause /
      class    = Stage
      freq     = Counts
      maxncat  = 5
      classkey = 'Before Cleaning';
   inset n    ='Observations Shown' (4.1)
         nexcl='Observations Excluded' (3.1);
run;

The resulting chart is displayed in Output 15.10.1.

You can provide your own label by specifying the keyword for that statistic followed by an equal sign (=) and the label in quotation marks. The label can have up to 24 characters.

The format 4.1 specified in parentheses after the N keyword displays the statistics by using a field width of four and one decimal place. In general, you can specify any numeric SAS format in parentheses after an inset keyword. You can also use the FORMAT= option to specify a format to be used for all the statistics in the INSET statement. For more information about SAS formats, see SAS Formats and Informats: Reference.

Note: If you specify both a label and a format for a statistic, the label must appear before the format.

Output 15.10.1: Customizing Labels and Formatting Values in an Inset