# PROC CAPABILITY and General Statements

#### Example 5.1 Reading Specification Limits

See CAPSPEC2 in the SAS/QC Sample LibraryYou can specify specification limits either in the SPEC statement or in a SPEC= data set. In Computing Capability Indices, limits were specified in a SPEC statement. This example illustrates how to create a SPEC= data set to read specification limits with the SPEC= option in the PROC CAPABILITY statement.

Consider the drink can data presented in Computing Descriptive Statistics. Suppose, in addition to the fluid weight of each drink can, the weight of the can itself is stored in a variable named `Cweight`, and both variables are saved in a data set called `Can2`. A partial listing of `Can2` follows:

```proc print data=Can2(obs=5);
run;
```

Output 5.1.1: The Data Set `Can2`

 Process Capability Analysis of Fluid Weight

Obs Weight Cweight
1 12.07 1.07
2 12.02 0.86
3 12.00 1.06
4 12.01 1.08
5 11.98 1.02

The following DATA step creates a data set named `Limits` containing specification limits for the fluid weight and the can weight. `Limits` has 4 variables (`_VAR_`, `_LSL_`, `_USL_`, and `_TARGET_`) and 2 observations. The first observation contains the specification limit information for the variable `Weight`, and the second contains the specification limit information for the variable `Cweight`.

```data Limits;
length _var_ \$8;
_var_    = 'Weight';
_lsl_    = 11.95;
_target_ = 12;
_usl_    = 12.05;
output;
_var_    = 'Cweight';
_lsl_    = 0.90;
_target_ = 1;
_usl_    = 1.10;
output;
run;
```

The following statements read the specification information from the `Limits` data set into the CAPABILITY procedure by using the SPEC= option. These statements print summary statistics, capability indices, and specification limit information for `Weight` and `Cweight`. Figure 5.1 and Figure 5.2 display the output for `Weight`. Output 5.1.2 displays the output for `Cweight`.

```title 'Process Capability Analysis of Drink Can Data';
proc capability data=Can2 specs=Limits;
var Cweight;
run;
```

Output 5.1.2: Printed Output for Variable `Cweight`

 Process Capability Analysis of Drink Can Data

The CAPABILITY Procedure
Variable: Cweight (Can Weight (ounces))

Moments
N 100 Sum Weights 100
Mean 1.004 Sum Observations 100.4
Std Deviation 0.06330941 Variance 0.00400808
Skewness -0.074821 Kurtosis -0.5433858
Uncorrected SS 101.1984 Corrected SS 0.3968
Coeff Variation 6.30571767 Std Error Mean 0.00633094

Basic Statistical Measures
Location Variability
Mean 1.004000 Std Deviation 0.06331
Median 1.000000 Variance 0.00401
Mode 1.040000 Range 0.29000
Interquartile Range 0.08500

Note: The mode displayed is the smallest of 2 modes with a count of 8.

Tests for Location: Mu0=0
Test Statistic p Value
Student's t t 158.5862 Pr > |t| <.0001
Sign M 50 Pr >= |M| <.0001
Signed Rank S 2525 Pr >= |S| <.0001

Tests for Normality
Test Statistic p Value
Shapiro-Wilk W 0.987310 Pr < W 0.4588
Kolmogorov-Smirnov D 0.061410 Pr > D >0.1500
Cramer-von Mises W-Sq 0.048175 Pr > W-Sq >0.2500
Anderson-Darling A-Sq 0.361939 Pr > A-Sq >0.2500

Quantiles (Definition 5)
Quantile Estimate
100% Max 1.150
99% 1.140
95% 1.105
90% 1.080
75% Q3 1.045
50% Median 1.000
25% Q1 0.960
10% 0.910
5% 0.900
1% 0.870
0% Min 0.860

Extreme Observations
Lowest Highest
Value Obs Value Obs
0.86 2 1.11 42
0.88 89 1.12 28
0.88 64 1.12 34
0.90 68 1.13 48
0.90 59 1.15 52

Specification Limits
Limit Percent
Lower (LSL) 0.900000 % < LSL 3.00000
Target 1.000000 % Between 92.00000
Upper (USL) 1.100000 % > USL 5.00000

Process Capability Indices
Index Value 95% Confidence Limits
Cp 0.526515 0.453237 0.599670
CPL 0.547575 0.446607 0.647299
CPU 0.505454 0.408856 0.600808
Cpk 0.505454 0.409407 0.601501
Cpm 0.525467 0.454973 0.601113