u Chart Examples
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: SHWUCHR */
/* TITLE: u Chart Examples */
/* PRODUCT: QC */
/* SYSTEM: ALL */
/* KEYS: Shewhart Charts, u Charts, */
/* PROCS: SHEWHART */
/* DATA: */
/* */
/* REF: SAS/QC Software: Usage and Reference, Version 6, */
/* First Edition, Volume 1 and Volume 2 */
/* */
/****************************************************************/
data Fabric;
input Roll Defects @@;
datalines;
1 12 2 11 3 9 4 15
5 7 6 6 7 5 8 10
9 8 10 8 11 14 12 5
13 9 14 13 15 7 16 5
17 8 18 11 19 7 20 12
;
title 'Number of Fabric Defects';
proc print data=Fabric(obs=5) noobs;
run;
ods graphics off;
title 'u Chart for Fabric Defects';
proc shewhart data=Fabric;
uchart Defects*Roll / subgroupn = 30;
run;
proc shewhart data=Fabric;
uchart Defects*Roll / subgroupn = 30
outlimits = Fablim
nochart;
run;
options ls=80;
title 'Control Limits Data Set FABLIM';
proc print data=Fablim noobs;
run;
options ls=76;
proc shewhart data=Fabric;
uchart Defects*Roll / subgroupn = 30
outtable = Fabtab
nochart;
run;
title 'Number of Defects Per Square Meter and Control Limits';
proc print data=Fabtab noobs;
run;
title 'u Chart for Fabric Defects';
proc shewhart table=Fabtab;
uchart Defects*Roll / subgroupn=30;
run;
data Fabric2;
input Roll Defects @@;
datalines;
21 9 22 9 23 12 24 7 25 14
26 5 27 4 28 13 29 6 30 7
31 11 32 10 33 7 34 11 35 8
36 8 37 3 38 10 39 9 40 13
;
options nogstyle;
goptions ftext=swiss;
symbol color = vig h = .8;
title 'u Chart for Fabric Defects';
proc shewhart data=Fabric2 limits=Fablim;
uchart Defects*Roll / subgroupn = 30
cframe = steel
cinfill = ligr
cconnect = vig
coutfill = yellow;
run;
options gstyle;
data Shirts;
input Box AvgdefU @@;
AvgdefN=10;
datalines;
1 0.4 2 0.7 3 0.5 4 1.0 5 0.3
6 0.2 7 0.0 8 0.4 9 0.4 10 0.6
11 0.2 12 0.7 13 0.3 14 0.1 15 0.3
16 0.6 17 0.6 18 0.3 19 0.7 20 0.3
21 0.0 22 0.1 23 0.5 24 0.6 25 0.4
;
title 'Average Number of Shirt Flaws';
proc print data=Shirts(obs=5) noobs;
run;
ods graphics on;
title 'Total Flaws per Box of Shirts';
proc shewhart history=Shirts;
uchart Avgdef*Box / odstitle=title;
run;
data Shirts2;
input Box Flaws nShirts @@;
datalines;
1 3 10 2 8 10 3 15 25 4 20 25
5 9 25 6 1 10 7 1 10 8 21 50
9 3 10 10 7 10 11 1 10 12 21 25
13 9 25 14 3 25 15 12 50 16 18 50
17 7 10 18 4 10 19 8 10 20 4 10
;
title 'Number of Shirt Flaws per Box';
proc print data=Shirts(obs=5) noobs;
run;
proc shewhart data=Shirts2;
uchart Flaws*Box / subgroupn = nShirts
outhistory = Shirthist
nochart;
run;
title 'Average Defects Per Tee Shirt';
proc print data=Shirthist(obs=5) noobs;
run;