HISTOGRAM Statement: CAPABILITY Procedure

Customizing a Histogram

See CAPHST1 in the SAS/QC Sample LibraryThis example is a continuation of the preceding example. The following statements show how you can use HISTOGRAM statement options and INSET statements to customize a histogram:

ods graphics off;
title 'Process Capability Analysis of Plating Thickness';
legend2 frame;
proc capability data=Trans noprint;
   spec lsl = 3.45 usl = 3.55;
   histogram Thick / normal
                     midpoints = 3.4 to 3.6 by 0.025
                     vscale    = count
                     legend    = legend2
                     nospeclegend ;
   inset lsl usl    / cfill = ywh;
   inset n mean (5.2) cpk (5.2) / cfill = ywh;
run;

The histogram is displayed in Figure 5.11.

Figure 5.11: Customizing the Appearance of the Histogram

Customizing the Appearance of the Histogram


The MIDPOINTS= option specifies a list of values to use as bin midpoints. The VSCALE=COUNT option requests a vertical axis scaled in counts rather than percents. The INSET statements inset the specification limits and summary statistics. The NOSPECLEGEND option suppress the default legend for the specification limits that is shown in Figure 5.8.

For more information about HISTOGRAM statement options, see the section Dictionary of Options. For details on the INSET statement, see INSET Statement: CAPABILITY Procedure.