u Charts-Varying Number of Inspection Units

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: SHWUEX3                                             */
/*   TITLE: u Charts-Varying Number of Inspection Units         */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Shewhart Charts, u Charts,                          */
/*   PROCS: SHEWHART                                            */
/*    DATA:                                                     */
/*                                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*                                                              */
/****************************************************************/

data Fabrics2;
   input Roll Defects Squaremeters @@;
   datalines;
 1  7 30.0   2 11 27.6   3 15 30.4   4  6 34.8   5 11 26.0
 6 15 28.6   7  5 28.0   8 10 30.2   9  8 28.2  10  3 31.4
11  3 30.3  12 14 27.8  13  3 27.0  14  9 30.0  15  7 32.1
16  6 34.8  17  7 26.5  18  5 30.0  19 14 31.3  20 13 31.6
21 11 29.4  22  6 28.6  23  6 27.5  24  9 32.6  25 11 31.7
;

title 'Number of Fabric Defects';
proc print data=Fabrics2(obs=5) noobs;
run;

ods graphics on;
title 'u Chart for Fabric Defects per Square Meter';
proc shewhart data=Fabrics2;
   uchart Defects*Roll / subgroupn = Squaremeters
                         outlimits = Fablimits
                         odstitle  = title
                         markers;
run;

title 'Control Limits for Fabric Defects';
proc print data=Fablimits noobs;
run;

ods graphics off;
symbol1 c=blue v=circle;
symbol2 c=vig;
symbol3 c=salmon;
title 'u Chart for Fabric Defects per Square Meter';
proc shewhart data=Fabrics2;
   uchart Defects*Roll / subgroupn = Squaremeters
                         outlimits = Fablimits2
                         limitn    = 30
                         alln
                         nmarkers;
run;

title 'Fixed Control Limits for Fabric Defects';
proc print data=Fablimits2 noobs;
run;