PROC CAPABILITY and General Statements 
BY, FREQ, WEIGHT, and ID Statements
In addition, you can optionally specify one of each of the following statements:
 BY variables;
 FREQ variable;
 WEIGHT variable;
 ID variable;
The BY statement specifies variables in the input data set that
are used for BY processing.
A separate analysis is done for each group of observations defined by
the levels of the BY variables.
The input data set must be sorted in order of the BY variables.
The FREQ statement names a variable that provides frequencies for each observation
in the input data set. If
n is the value of the FREQ variable for a given observation, then that
observation is used n times.
If the value of the FREQ variable is missing or is less than one, the
observation is not used in the analysis.
If the value is not an integer, only the integer portion is used.
The WEIGHT statement names a variable that provides weights
for each observation
in the input data set.
The CAPABILITY procedure
uses the values w_{i} of the WEIGHT variable to
modify the computation of a number of summary statistics
by
assuming that the variance of the ith
value X_{i}
of the analysis variable
is equal to , where
is an unknown parameter.
This assumption is rarely applicable
in process capability analysis, and
the purpose of the WEIGHT statement is simply
to make the
CAPABILITY procedure consistent with other data
summarization procedures,
such as the UNIVARIATE procedure.
The values of the WEIGHT variable do not have to be integers
and are typically positive.
By default, observations with nonpositive or missing values of
the WEIGHT variable are handled as follows^{*}:

If the value is zero, the observation is counted in the total number
of observations.

If the value is negative, it is converted to zero, and the
observation is counted in the total number of observations.

If the value is missing, the observation is excluded from
the analysis.
To exclude observations that contain negative and zero weights
from the analysis, specify the option EXCLNPWGT in the
PROC statement.
Note that most SAS/STAT procedures, such as PROC GLM,
exclude negative and zero weights by default.
When you specify a WEIGHT variable, the procedure uses its values,
w_{i}, to compute weighted versions of the
statistics^{*}
provided in the
Moments table.
For example, the procedure computes
a weighted mean
and a weighted variance
s_{w}^{2} as
and
where x_{i} is the ith variable value.
The divisor d is controlled by the VARDEF= option in the PROC CAPABILITY
statement.
When you use both the WEIGHT and SPEC statements,
capability indices are computed using
and
s_{w} in place of
and s.
Again, note that
weighted capability indices are seldom
needed in practice.
When you specify a WEIGHT statement, the procedure
also computes a weighted standard error
and a weighted version of Student's t test.
This test is the only test of location that
is provided when weights are specified.
The WEIGHT statement does not affect the determination
of the mode, extreme values, extreme observations,
or the number of missing values of the analysis variables.
However, the weights w_{i} are used to compute
weighted percentiles^{*}.
The WEIGHT variable has no effect on the calculation of extreme values,
and it has no effect on graphical displays produced with the plot statements.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.