The UNIVARIATE Procedure |
This example is a continuation of Example 4.14. The following statements fit a normal distribution to the thickness measurements in the Trans data set and superimpose the fitted density curve on the histogram:
title 'Analysis of Plating Thickness'; ods select ParameterEstimates GoodnessOfFit FitQuantiles Bins MyPlot; proc univariate data=Trans; histogram Thick / normal(percents=20 40 60 80 midpercents) name='MyPlot'; inset n normal(ksdpval) / pos = ne format = 6.3; run;
The ODS SELECT statement restricts the output to the "ParameterEstimates," "GoodnessOfFit," "FitQuantiles," and "Bins" tables; see the section ODS Table Names. The NORMAL option specifies that the normal curve be displayed on the histogram shown in Output 4.19.2. It also requests a summary of the fitted distribution, which is shown in Output 4.19.1. This summary includes goodness-of-fit tests, parameter estimates, and quantiles of the fitted distribution. (If you specify the NORMALTEST option in the PROC UNIVARIATE statement, the Shapiro-Wilk test for normality is included in the tables of statistical output.)
Two secondary options are specified in parentheses after the NORMAL primary option. The PERCENTS= option specifies quantiles, which are to be displayed in the "FitQuantiles" table. The MIDPERCENTS option requests a table that lists the midpoints, the observed percentage of observations, and the estimated percentage of the population in each interval (estimated from the fitted normal distribution). See Table 4.12 and Table 4.17 for the secondary options that can be specified with after the NORMAL primary option.
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 | 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 |
The histogram of the variable Thick with a superimposed normal curve is shown in Output 4.19.2.
The estimated parameters for the normal curve ( and ) are shown in Output 4.19.1. By default, the parameters are estimated unless you specify values with the MU= and SIGMA= secondary options after the NORMAL primary option. The results of three goodness-of-fit tests based on the empirical distribution function (EDF) are displayed in Output 4.19.1. Because the -values are all greater than 0.15, the hypothesis of normality is not rejected.
A sample program for this example, uniex08.sas, is available in the SAS Sample Library for Base SAS software.
Copyright © SAS Institute, Inc. All Rights Reserved.