Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
PCHART Statement

Example 38.4: Creating a Chart with Revised Control Limits

See SHWPEX4 in the SAS/QC Sample Library

The following statements create a SAS data set named CIRC_ONE, which contains the number of failing circuits for 30 batches produced by the circuit manufacturing process introduced in the "Getting Started" section:

   data circ_one;
     input batch fail @@;
     datalines;
    1   7   2   6   3   6   4   9    5   2
    6  11   7   8   8   8   9   6   10  19
   11   7  12   5  13   7  14   5   15   8
   16  13  17   7  18  14  19  19   20   5
   21   7  22   5  23   7  24   5   25  11
   26   4  27   6  28   3  29  11   30   3
   ;

A p chart is used to monitor the proportion of failing circuits. The following statements create the chart shown in Output 38.4.1:

   title 'Proportion of Circuit Failures';
   symbol v=dot c=salmon;
   proc shewhart data=circ_one;
   pchart fail*batch / subgroupn = 500
                       outlimits = faillim1
                       outindex  = 'Trial Limits'
                       cframe    = lib
                       cinfill   = bwh
                       cconnect  = salmon
                       coutfill  = yellow;
run;

Output 38.4.1: A p Chart for Circuit Failures
pex4a.gif (6090 bytes)

Batches 10 and 19 have unusually high proportions of failing circuits. Subsequent investigation identifies special causes for both batches, and it is decided to eliminate these batches from the data set and recompute the control limits. The following statements create a data set named FAILLIM2 that contains the revised control limits:

   proc shewhart data=circ_one;
      where batch^=10 and batch^=19;
      pchart fail*batch / subgroupn= 500
                          nochart
                          outindex ='Revised Limits'
                          outlimits= faillim2;
   run;

   data faillims;
      set faillim1 faillim2;
   run;

The data set FAILLIMS, which contains the true and revised control limits, is listed in Output 38.4.2.

Output 38.4.2: Listing of the Data Set FAILLIMS
 
Proportion of Circuit Failures

_VAR_ _SUBGRP_ _INDEX_ _TYPE_ _LIMITN_ _ALPHA_ _SIGMAS_ _LCLP_ _P_ _UCLP_
fail batch Trial Limits ESTIMATE 500 .005620297 3 0 0.0156 0.032226
fail batch Revised Limits ESTIMATE 500 .005942336 3 0 0.0140 0.029763

The following statements create a p chart displaying both sets of control limits:

   title 'p Chart with Revised Limits for Failed Circuits';
   symbol v=dot c=salmon;
   proc shewhart data=circ_one limits=faillims;
      pchart fail*batch / subgroupn  = 500
                          readindex  = 'Revised Limits'
                          vref       = 0.0156 0.032226
                          vreflabels = ('Trial P' 'Trial UCL')
                          vreflabpos = 3
                          lvref      = 15
                          nolegend
                          cframe     = lib
                          cinfill    = bwh
                          coutfill   = yellow
                          cconnect   = salmon;
      label fail  = 'Fraction Failed'
            batch = 'Batch Index';
   run;

The READINDEX= option is used to select the revised limits displayed on the p chart in Output 38.4.3. See "Displaying Multiple Sets of Control Limits". The VREF=, VREFLABELS=, and VREFLABPOS= options are used to display and label the trial limits. You can also pass in the values of the trial limits with macro variables. For an illustration of this technique, see Example 32.6.

Output 38.4.3: p Chart with Revised Limits
pex4c.gif (6393 bytes)

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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