Chapter Contents Previous Next
 HISTOGRAM Statement

## Adding a Normal Curve to the Histogram

 See CAPHST1 in the SAS/QC Sample Library

This example is a continuation of the preceding example.

The following statements fit a normal distribution using the thickness measurements and superimpose the fitted density curve on the histogram:

   title 'Process Capability Analysis of Plating Thickness';
legend1 frame cframe=ligr cborder=black position=center;
proc capability data=trans noprint;
spec lsl = 3.45 llsl = 2 clsl = black
usl = 3.55 lusl = 2 cusl = black;
histogram / normal(color=yellow w=3)
cfill  = blue
frame = ligr
legend = legend1;
run;


The NORMAL option summarizes the fitted distribution in the printed output shown in Figure 4.3, and it specifies that the normal curve be displayed on the histogram shown in Figure 4.4.

 The CAPABILITY Procedure Fitted Normal Distribution for thick

 Parameters for Normal Distribution Parameter Symbol Estimate Mean Mu 3.49533 Std Dev Sigma 0.032117

 Goodness-of-Fit Tests for Normal Distribution Test Statistic DF p Value Kolmogorov-Smirnov D 0.05563823 Pr > D >0.150 Cramer-von Mises W-Sq 0.04307548 Pr > W-Sq >0.250 Anderson-Darling A-Sq 0.27840748 Pr > A-Sq >0.250 Chi-Square Chi-Sq 6.96953022 5 Pr > Chi-Sq 0.223

 Quantiles for Normal Distribution Percent Quantile Observed Estimated 1.0 3.42950 3.42061 5.0 3.44300 3.44250 10.0 3.45750 3.45417 25.0 3.46950 3.47367 50.0 3.49600 3.49533 75.0 3.51650 3.51699 90.0 3.53550 3.53649 95.0 3.55300 3.54816 99.0 3.57200 3.57005
Figure 4.3: Summary for Fitted Normal Distribution

Figure 4.4: Histogram Superimposed with Normal Curve

The printed output includes the following:

• parameters for the normal curve. The normal parameters and are estimated by the sample mean ()and the sample standard deviation ().
• a chi-square goodness-of-fit test. Compared to the usual cutoff values of 0.05 and 0.10, the p-value of 0.2229 for this test indicates that the thicknesses are normally distributed.
• goodness-of-fit tests based on the empirical distribution function (EDF): the Anderson-Darling, Cramer-von Mises, and Kolmogorov-Smirnov tests. The p-values for these tests are smaller than the usual cutoff values of 0.05 and 0.10, indicating that the thicknesses are normally distributed.
• a chi-square goodness-of-fit test. The p-value of 0.2229 for this test indicates that the thicknesses are normally distributed. In general EDF tests (when available) are preferable to chi-square tests. See the "EDF Goodness-of-Fit Tests" section for details.
• observed and estimated percentages outside the specification limits
• observed and estimated quantiles

For details, including formulas for the goodness-of-fit tests, see "Printed Output". Note that the NOPRINT option in the PROC CAPABILITY statement suppresses only the printed output with summary statistics for the variable THICK. To suppress the printed output in Figure 4.3, specify the NOPRINT option enclosed in parentheses after the NORMAL option.

The NORMAL option is one of many options that you can specify in the HISTOGRAM statement. See the "Syntax" section for a complete list of options or the "Dictionary of Options" section for detailed descriptions of options.

 Chapter Contents Previous Next Top