X-Bar & s Charts for Subgroup Summary Data

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: SHWMNS                                              */
 /*   TITLE: X-Bar & s Charts for Subgroup Summary Data          */
 /* PRODUCT: QC                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: Shewhart Charts, Mean Charts, s Charts,             */
 /*   PROCS: SHEWHART                                            */
 /*    DATA:                                                     */
 /*                                                              */
 /*     REF: SAS/QC Software:  Examples                          */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/

options ps=50 ls=100 nodate;


data lengstat;
   input day mean std n;
   informat day date7. ;
   format day date5. ;
   label day ='Date of Sample Collection'
         mean='Average Length'
         std ='Standard Deviation of Length'
         n   ='Subgroup Sample Size';
   cards;
02JAN86  115.39  5.67  20
03JAN86  113.68  2.96  20
04JAN86  114.69  5.45  20
05JAN86  114.23  3.50  20
06JAN86  115.45  4.86  20
07JAN86  112.99  2.30  20
08JAN86  113.19  2.15  20
09JAN86  115.41  6.51  20
10JAN86  113.68  4.24  20
11JAN86  114.08  4.25  20
12JAN86  114.34  3.66  20
13JAN86  113.74  3.98  20
14JAN86  114.85  4.48  20
15JAN86  115.02  3.61  20
16JAN86  113.45  3.52  20
17JAN86  114.94  5.65  20
18JAN86  114.23  5.02  20
19JAN86  115.51  5.25  20
20JAN86  113.63  3.17  20
;

data lengstat;
   set lengstat;
   rename mean=lengthx  /* subgroup mean variable               */
          std =lengths  /* subgroup standard deviation variable */
          n   =lengthn; /* subgroup sample size variable        */
run;


title1 '_                              ';
title2 'X and s Charts for Brace Length';

proc shewhart history=lengstat lineprinter;
   xschart length*day='*';
run;

title;