Resources

p Charts-Specifying Std Average Proportion

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: SHWPEX2                                             */
/*   TITLE: p Charts-Specifying Std Average Proportion          */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Shewhart Charts, p Charts,                          */
/*   PROCS: SHEWHART                                            */
/*    DATA:                                                     */
/*                                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*                                                              */
/****************************************************************/

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


ods graphics off;
title1 'p Chart for Failing Circuits';
title2 'Using Data in CIRCUITS and Standard Value P0=0.02';
proc shewhart data=Circuits;
   pchart Fail*Batch / subgroupn = 500
                       p0        = 0.02
                       psymbol   = p0
                       wneedles  = 3
                       nolegend;
   label Batch = 'Batch Number'
         Fail  = 'Fraction Failing';
run;

data Climits;
   length _var_ _subgrp_ _type_ $8;
   _p_      = 0.02;
   _subgrp_ = 'Batch';
   _var_    = 'Fail';
   _type_   = 'STANDARD';
   _limitn_ = 500;
run;

proc shewhart data=Circuits limits=Climits;
   pchart Fail*Batch / subgroupn = 500
                       psymbol   = p0
                       nolegend
                       needles;
   label batch ='Batch Number'
         fail  ='Fraction Failing';
run;