The CAPABILITY Procedure |
Syntax |
The syntax for the OUTPUT statement is as follows:
You can use any number of OUTPUT statements in the CAPABILITY procedure. Each OUTPUT statement creates a new data set containing the statistics specified in that statement. When you use the OUTPUT statement, you must also use the VAR statement. In addition, the OUTPUT statement must contain at least one of the following:
a specification of the form keyword=names
the PCTLPTS= and PCTLPRE= specifications
The components of the OUTPUT statement are described as follows.
specifies the statistics to include in the output data set and gives names to the new variables that contain the statistics. Specify a keyword for each desired statistic, an equal sign, and the names of the variables to contain the statistic.
In the output data set, the first variable listed after a keyword in the OUTPUT statement contains the statistic for the first variable listed in the VAR statement; the second variable contains the statistic for the second variable in the VAR statement, and so on. The list of names following the equal sign can be shorter than the list of variables in the VAR statement. In this case, the procedure uses the names in the order in which the variables are listed in the VAR statement. Consider the following example:
proc capability noprint; var length width height; output out=summary mean=mlength mwidth; run;
The variables MLENGTH and MWIDTH contain the means for Length and Width. The mean for Height is computed by the procedure but is not saved in the output data set. See Summary of Keywords for tables of available keywords and the statistics they represent. Formulas for selected statistics are provided in the section Details.
specifies the name of the output data set. To create a permanent SAS data set, specify a two-level name. See SAS Language Reference: Dictionary for more information on permanent SAS data sets. For example, the previous statements create an output data set named Summary. If the OUT= option is omitted, then by default the new data set is named using the DATA convention.
specifies percentiles that are not automatically computed by the procedure. The CAPABILITY procedure automatically computes the st, th, th, th, th, th, th, th, and th percentiles for the data. These can be saved in an output data set by using keyword=names specifications. The PCTLPTS= option generates additional percentiles and outputs them to a data set; these additional percentiles are not printed.
If you use the PCTLPTS= option, you must also use the PCTLPRE= option to provide a prefix for the new variable names. For example, to create variables that contain the th, th, th, and th percentiles of Length, use the following statements:
proc capability noprint; var length; output pctlpts=20 40 60 80 pctlpre=plen; run;
This creates the variables PLEN20, PLEN40, PLEN60, and PLEN80, whose values are the corresponding percentiles of Length. In addition to specifying name prefixes with the PCTLPRE= option, you can also use the PCTLNAME= option to create name suffixes for the new variables created by the PCTLPTS= option.
specifies prefixes used to create variable names for percentiles requested with the PCTLPTS= option. The PCTLPRE= and PCTLPTS= options must be used together.
The procedure generates new variable names by using the prefix and the percentile values. If the specified percentile is an integer, the variable name is simply the prefix followed by the value. For noninteger percentiles, an underscore replaces the decimal point in the variable name, and decimal values are truncated to one decimal place. For example, the following statements create the variables PWID20, PWID33_3, PWID66_6, and PWID80 for the th, rd, th, and th percentiles of Width, respectively:
proc capability noprint; var width; output pctlpts=20 33.33 66.67 80 pctlpre=pwid; run;
If you request percentiles for more than one variable, you should list prefixes in the same order in which the variables appear in the VAR statement. If combining the prefix and percentile value results in a name longer than 8 characters, the prefix is truncated so that the variable name is 8 characters. For example, the following statements compute the th and th percentiles for Length and Width and save the new variables PLENGT80, PLEN87_5, PWIDTH80, and PWID87_5 in the output data set:
proc capability noprint; var length width; output pctlpts=80 87.5 pctlpre=plength pwidth; run;
provides name suffixes for the new variables created by the PCTLPTS= option. These suffixes are appended to the prefixes you specify with the PCTLPRE= option, replacing the percentile values that are used as suffixes by default. List the suffixes in the same order in which you specify the percentiles. If you specify suffixes with the PCTLNAME= option and percentile values with the PCTLPTS= option, where , the suffixes are used to name the first percentiles, and the default names are used for the remaining percentiles. For example, consider the following statements:
proc capability; var length width height; output pctlpts = 20 40 pctlpre = pl pw ph pctlname = twenty; run;
The value twenty in the PCTLNAME= option is used for only the first percentile in the PCTLPTS= list. This suffix is appended to the values in the PCTLPRE= option to generate the new variable names pltwenty, pwtwenty, and phtwenty, which contain the th percentiles for Length, Width, and Height, respectively. Since a second PCTLNAME= suffix is not specified, variable names for the th percentiles for Length, Width, and Height are generated using the prefixes and percentile values. Thus, the output data set contains the variables pltwenty, pl40, pwtwenty, pw40, phtwenty, and ph40.
Copyright © SAS Institute, Inc. All Rights Reserved.