Chapter Contents |
Previous |
Next |
MRCHART Statement |
See SHWMR2 in the SAS/QC Sample Library |
A brewery monitors its bottling process to ensure that each bottle is filled with the proper amount of beer. The following data set contains the amount of beer recorded in fluid ounces for 23 batches:
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 ;
A batch is regarded as a rational subgroup. Five bottles of beer are supposed to be tested in each batch. However, in batch 6 and batch 17 only four bottles are tested, and in batch 21 only three bottles are tested. The following statements request median and range charts, shown in Output 36.1.1, for the beer amounts:
title 'Median and Range Charts for Beer Amount'; symbol v=dot c=rose; proc shewhart data=beer; mrchart amount*batch / cframe = vipb cinfill = ywh cconnect = rose coutfill = salmon; run;Output 36.1.1: Median and Range Charts with Varying Sample Sizes
Note that the central line on the range chart and the control limits on both charts vary with the subgroup sample size. The subgroup sample size legend displays the minimum and maximum subgroup sample sizes.
The SHEWHART procedure provides various options for working with unequal subgroup sample sizes. For example, you can use the LIMITN= option to specify a fixed (nominal) sample size for the control limits, as illustrated by the following statements:
title 'Median and Range Charts for Beer Amount'; symbol v=dot c=rose; proc shewhart data=beer; mrchart amount*batch / limitn = 5 cframe = vipb cinfill = ywh cconnect = rose coutfill = salmon; run;
The resulting charts are shown in Output 36.1.2.
Output 36.1.2: Control Limits Based on Fixed Sample Sizesymbol v=dot c=rose; proc shewhart data=beer; mrchart amount*batch / limitn = 5 alln nmarkers cframe = vipb cinfill = ywh cconnect = rose coutfill = salmon; run;
The NMARKERS option requests special symbols that identify points for which the subgroup sample size differs from the nominal sample size. In Output 36.1.3, the median amount for batch 21 exceeds the upper control limits, indicating that the process is not in control. This illustrates the approximate nature of fixed control limits used with subgroup samples of varying sizes.
Output 36.1.3: Displaying All Subgroups Regardless of Sample SizeFor details, see "Methods for Estimating the Standard Deviation". The following statements estimate using both methods:
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;The estimates are saved as values of the variable _STDDEV_ in the data set BLIMITS, which is listed in Output 36.1.4. The bookkeeping variable _INDEX_ identifies the estimate. Output 36.1.4: The Data Set BLIMITS
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.