X-Bar & R Charts for Multiple Variables

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: SHWMULP                                             */
 /*   TITLE: X-Bar & R Charts for Multiple Variables             */
 /* PRODUCT: QC                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: Shewhart Charts, Mean and Range Charts,             */
 /*   PROCS: SHEWHART                                            */
 /*    DATA:                                                     */
 /*                                                              */
 /*     REF: SAS/QC Software:  Examples                          */
 /*    MISC: If you are using a monochrome graphics device,      */
 /*          eliminate the CINFILL option.                       */
 /*                                                              */
 /****************************************************************/

options ps=60 ls=80;

data drumsall;
   length comment $ 16 ;
   label flwidth='Flange Width'
         holdiam='Hole Diameter'
         drmdiam='Drum Diameter';
   input hour flwidth holdiam drmdiam comment & $;
   cards;
 1  1.024  0.515  2.166  .
 1  1.025  0.515  2.167  .
 1  1.023  0.520  2.167  .
 1  1.023  0.518  2.167  .
 1  1.027  0.516  2.166  .
 2  1.024  0.515  2.166  .
 2  1.024  0.515  2.166  .
 2  1.027  0.514  2.167  .
 2  1.022  0.516  2.165  .
 2  1.021  0.514  2.169  .
 3  1.021  0.518  2.170  .
 3  1.026  0.515  2.165  .
 3  1.023  0.514  2.166  .
 3  1.024  0.518  2.167  .
 3  1.023  0.516  2.167  .
 4  1.026  0.518  2.168  Heat Problem
 4  1.028  0.514  2.167  .
 4  1.023  0.515  2.168  .
 4  1.029  0.515  2.168  .
 4  1.036  0.515  2.169  .
 5  1.024  0.515  2.165  .
 5  1.024  0.514  2.167  .
 5  1.025  0.514  2.165  .
 5  1.024  0.515  2.166  .
 5  1.025  0.516  2.168  .
 6  1.022  0.514  2.165  .
 6  1.025  0.515  2.165  .
 6  1.023  0.515  2.166  .
 6  1.023  0.514  2.165  .
 6  1.019  0.515  2.167  .
 7  1.022  0.515  2.164  .
 7  1.024  0.515  2.166  .
 7  1.021  0.515  2.168  .
 7  1.024  0.515  2.166  .
 7  1.025  0.515  2.167  .
 8  1.024  0.516  2.165  .
 8  1.021  0.519  2.164  .
 8  1.021  0.514  2.165  .
 8  1.019  0.518  2.167  .
 8  1.021  0.515  2.166  .
 9  1.023  0.516  2.167  New Operator
 9  1.022  0.515  2.167  .
 9  1.026  0.516  2.166  .
 9  1.023  0.515  2.165  .
 9  1.022  0.514  2.166  .
10  1.023  0.515  2.166  New Operator
10  1.022  0.516  2.167  .
10  1.028  0.515  2.167  .
10  1.024  0.515  2.166  .
10  1.020  0.514  2.164  .
11  1.025  0.514  2.165  New Operator
11  1.025  0.515  2.168  .
11  1.022  0.515  2.163  .
11  1.023  0.515  2.164  .
11  1.027  0.514   .     .
12  1.024  0.516   .     New Operator
12  1.026  0.517   .     .
12  1.024  0.517  2.167  .
12  1.023  0.516  2.165  .
12  1.021  0.514   .     .
13  1.020  0.515   .     New Operator
13  1.025  0.513  2.166  .
13  1.023  0.516  2.167  .
13  1.026  0.514  2.168  .
13  1.023  0.514  2.165  .
14  1.026  0.517  2.169  New Operator
14  1.024  0.516  2.168  .
14  1.025  0.517   .     .
14  1.024  0.516   .     .
14  1.022  0.516   .     .
15  1.023  0.513  2.166  New Operator
15  1.023  0.514  2.167  .
15  1.025  0.513  2.165  .
15  1.024  0.514   .     .
15  1.025  0.514   .     .
16  1.021  0.515  2.166  New Operator
16  1.025  0.514  2.167  .
16  1.023  0.514  2.169  .
16  1.025  0.515  2.166  .
16  1.020  0.515  2.168  .
17  1.026  0.517  2.166  Bad Circuit
17  1.026  0.516  2.169  .
17  1.021  0.515  2.166  .
17  1.024  0.517  2.166  .
17  1.025  0.517  2.165  .
18  1.023  0.515  2.168  Bad Circuit
18  1.026  0.514  2.168  .
18  1.023  0.515  2.166  .
18  1.019  0.515  2.166  .
18  1.020  0.516  2.167  .
19  1.023  0.516  2.166  Bad Circuit
19  1.022  0.516  2.167  .
19  1.026  0.516  2.166  .
19  1.023  0.516  2.163  .
19  1.022  0.516  2.166  .
20  1.024  0.516  2.166  Bad Circuit
20  1.024  0.517  2.167  .
20  1.028  0.516  2.166  .
20  1.024  0.516  2.167  .
20  1.023  0.516  2.164  .
21  1.021  0.517  2.166  Bad Circuit
21  1.026  0.515  2.166  .
21  1.023  0.515  2.166  .
21  1.024  0.515  2.165  .
21  1.023  0.516  2.165  .
22  1.024  0.515  2.167  Bad Circuit
22  1.024  0.517  2.166  .
22  1.027  0.516  2.166  .
22  1.022  0.517  2.167  .
22  1.021  0.519  2.164  .
23  1.024  0.516  2.165  Bad Circuit
23  1.023  0.516  2.167  .
23  1.025  0.519  2.167  .
23  1.024  0.516  2.168  .
23  1.025  0.516  2.167  .
24  1.022  0.520  2.165  Bad Circuit
24  1.025  0.514  2.166  .
24  1.023  0.517  2.168  .
24  1.023  0.519  2.166  .
24  1.019  0.519  2.164  .
25  1.024  0.514  2.167  Bad Circuit
25  1.024  0.519  2.165  .
25  1.025  0.519  2.166  .
25  1.024  0.520  2.166  .
25  1.025  0.520  2.166  .
;

symbol1 v=dot h=.8 c=red ;
title 'Analysis of Plastic Drum Molding Process';

proc shewhart data=drumsall;
   xrchart (flwidth holdiam drmdiam)*hour /
      table(ex)
      tableid
      tableout
      outlabel = (comment)
      ypct1    = 70
      cconnect = red
      cinfill  = gray
      novangle;
   id comment;
   label flwidth='Avg Flange Width'
         holdiam='Avg Hole Diameter'
         drmdiam='Avg Drum Diameter'
         hour='Hour';
run;

goptions reset=all;