Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
OUTPUT Statement

Saving Percentiles in an Output Data Set

See CAPOUT1 in the SAS/QC Sample Library

The CAPABILITY procedure automatically computes the 1 st, 5 th, 10 th, 25 th, 75 th, 90 th, 95 th, and 99 th percentiles for each variable. You can save these percentiles in an output data set by specifying the appropriate keywords. For example, the following statements create an output data set named PCTLSTR containing the 5 th and 95 th percentiles of the variable STRENGTH:

   proc capability data=belts;
      var strength;
      output out=pctlstr p5=p5str p95=p95str;
   run;
The output data set PCTLSTR is listed in Figure 7.3.

Obs p5str p95str
1 1126.78 1284.34

Figure 7.3: Listing of the Output Data Set PCTLSTR

You can use the PCTLPTS=, PCTLPRE=, and PCTLNAME= options to save percentiles not automatically computed by the CAPABILITY procedure. For example, the following statements create an output data set named PCTLS containing the 20 th and 40 th percentiles of the variables STRENGTH and WIDTH:

   proc capability data=belts;
      var strength width;
      output out=pctls pctlpts  = 20 40
                       pctlpre  = S W
                       pctlname = pct20 pct40;
   run;
The PCTLPTS= option specifies the percentiles to compute (in this case, the 20 th and 40 th percentiles). The PCTLPRE= and PCTLNAME= options build the names for the variables containing the percentiles. The PCTLPRE= option gives prefixes for the new variables, and the PCTLNAME= option gives a suffix to add to the prefix. Note that if you use the PCTLPTS= specification, you must also use the PCTLPRE= specification. For details on these options, see the "Syntax" section.

The preceding OUTPUT statement saves the 20 th and 40 th percentiles of STRENGTH and WIDTH in the variables SPCT20, WPCT20, SPCT40, and WPCT40. The output data set PCTLS is listed in Figure 7.4.

Obs Spct20 Spct40 Wpct20 Wpct40
1 1165.91 1199.26 2.9595 2.995

Figure 7.4: Listing of the Output Data Set PCTLS

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.