Resources

Median and Range Charts-Unequal Subgroup Sizes

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: SHWMR2                                              */
/*   TITLE: Median and Range Charts-Unequal Subgroup Sizes      */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Shewhart Charts, Median and Range Charts,           */
/*   PROCS: SHEWHART                                            */
/*    DATA:                                                     */
/*                                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*                                                              */
/****************************************************************/

data Beer;
   input Batch size @;
   do i=1 to size;
      input Amount @@;
      output;
   end;
   drop i size;
   label Batch  ='Batch Number';
   datalines;
 1  5  12.01 11.97 11.93 11.98 12.00
 2  5  11.88 11.98 11.93 12.03 11.92
 3  5  11.93 11.99 12.00 12.03 11.95
 4  5  11.98 11.94 12.02 11.90 11.97
 5  5  12.02 12.02 11.98 12.04 11.90
 6  4  11.98 11.98 12.00 11.93
 7  5  11.93 11.95 12.02 11.91 12.03
 8  5  12.00 11.98 12.02 11.89 12.01
 9  5  11.98 11.93 11.99 12.02 11.91
10  5  11.97 12.02 12.05 12.01 11.97
11  5  12.02 12.01 11.97 12.02 11.94
12  5  11.93 11.83 11.99 12.02 12.01
13  5  12.01 11.98 11.94 12.04 12.01
14  5  11.98 11.96 12.02 12.00 12.00
15  5  11.97 11.99 12.03 11.95 11.96
16  5  11.99 11.95 11.96 12.03 12.01
17  4  11.99 11.97 12.03 12.01
18  5  11.94 11.96 11.98 12.03 11.97
19  5  11.97 11.87 11.90 12.01 11.95
20  5  11.96 11.94 11.96 11.98 12.05
21  3  12.06 12.07 11.98
22  5  12.01 11.98 11.96 11.97 12.00
23  5  12.00 12.02 12.03 11.99 11.96
;

ods graphics on;
title 'Median and Range Charts for Beer Amount';
proc shewhart data=Beer;
   mrchart Amount*Batch / odstitle=title;
run;

title 'Median and Range Charts for Beer Amount';
proc shewhart data=Beer;
   mrchart Amount*Batch / limitn=5 odstitle=title;
run;

title 'Median and Range Charts for Beer Amount';
proc shewhart data=Beer;
   mrchart Amount*Batch / limitn   = 5
                          odstitle = title
                          alln
                          nmarkers;
run;

proc shewhart data=Beer;
   mrchart Amount*Batch / outindex  = 'Default'
                          outlimits = Blim1
                          nochart;
   mrchart Amount*Batch / smethod   = mvlue
                          outindex  = 'MVLUE'
                          outlimits = Blim2
                          nochart;
run;

data Blimits;
   set Blim1 Blim2;
run;

title 'The Data Set Blimits';
proc print data=Blimits noobs;
run;