Median and Range Charts-Specifying Axis Labels
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: SHWMR3 */
/* TITLE: Median and Range Charts-Specifying Axis Labels */
/* 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 Detergent;
input Lot @;
do i=1 to 5;
input Weight @;
output;
end;
drop i;
datalines;
1 17.39 26.93 19.34 22.56 24.49
2 23.63 23.57 23.54 20.56 22.17
3 24.35 24.58 23.79 26.20 21.55
4 25.52 28.02 28.44 25.07 23.39
5 23.25 21.76 29.80 23.09 23.70
6 23.01 22.67 24.70 20.02 26.35
7 23.86 24.19 24.61 26.05 24.18
8 26.00 26.82 28.03 26.27 25.85
9 21.58 22.31 25.03 20.86 26.94
10 22.64 21.05 22.66 29.26 25.02
11 26.38 27.50 23.91 26.80 22.53
12 23.01 23.71 25.26 20.21 22.38
13 23.15 23.53 22.98 21.62 26.99
14 26.83 23.14 24.73 24.57 28.09
15 26.15 26.13 20.57 25.86 24.70
16 25.81 23.22 23.99 23.91 27.57
17 25.53 22.87 25.22 24.30 20.29
18 24.88 24.15 25.29 29.02 24.46
19 22.32 25.96 29.54 25.92 23.44
20 25.63 26.83 20.95 24.80 27.25
21 21.68 21.11 26.07 25.17 27.63
22 26.72 27.05 24.90 30.08 25.22
23 31.58 22.41 23.67 23.47 24.90
24 28.06 23.44 24.92 24.64 27.42
25 21.10 22.34 24.96 26.50 24.51
26 23.80 24.03 24.75 24.82 27.21
27 25.10 26.09 27.21 24.28 22.45
28 25.53 22.79 26.26 25.85 25.64
;
ods graphics off;
title 'Median and Range Charts for Detergent Box Weight';
proc shewhart data=Detergent;
mrchart Weight*Lot / split = '/';
label Lot = 'Detergent Lot Number'
Weight = 'Median in pounds/Range';
run;
data Detsum;
input Lot WeightM WeightR;
WeightN = 5;
datalines;
1 22.56 9.54
2 23.54 3.07
3 24.35 4.65
4 25.52 5.05
5 23.25 8.04
6 23.01 6.33
7 24.19 2.19
8 26.27 2.18
9 22.31 6.08
10 22.66 8.21
11 26.38 4.97
12 23.01 5.05
13 23.15 5.37
14 24.73 4.95
15 25.86 5.58
16 23.99 4.35
17 24.30 5.24
18 24.88 4.87
19 25.92 7.22
20 25.63 6.30
21 25.17 6.52
22 26.72 5.18
23 23.67 9.17
24 24.92 4.62
25 24.51 5.40
26 24.75 3.41
27 25.10 4.76
28 25.64 3.47
;
title 'Median and Range Charts for Detergent Box Weight';
proc shewhart history=Detsum;
mrchart Weight*Lot / split = '/';
label Lot = 'Detergent Lot Number'
WeightM = 'Median (pounds)/Range';
run;
proc shewhart data=Detergent;
mrchart Weight*Lot / outtable=Dtable
nochart;
run;
title 'Median and Range Charts for Detergent Box Weight';
proc shewhart table=Dtable;
mrchart Weight*Lot / split = '/';
label Lot = 'Detergent Lot Number'
_submed_ = 'Median (pounds)/Range';
run;
title 'Median and Range Charts for Detergent Box Weight';
proc shewhart data=Detergent;
mrchart Weight*Lot / haxis = axis1
vaxis = axis2
vaxis2 = axis3;
axis1 label=(c=bib f=simplex 'Detergent Lot Number' );
axis2 label=(c=vilg f=simplex 'Median Weight' j=c 'of Sample' );
axis3 label=(c=vilg f=simplex 'Range of' j=c 'Sample' );
run;