HP Forums
Shewhart X-Bar Chart (Quality Chart) - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: HP Prime Software Library (/forum-15.html)
+--- Thread: Shewhart X-Bar Chart (Quality Chart) (/thread-8901.html)



Shewhart X-Bar Chart (Quality Chart) - Eddie W. Shore - 08-25-2017 06:17 PM

Introduction and Calculation

The program XCHART generates five variables that describe the parameters of a Shewhart X-bar chart for quality control purposes. Two limits, upper and lower, are determined, set 3 deviations from the mean, set the boundaries in which a process can vary and still allow the process to be in control.

The samples are arranged in a matrix. Each row is a sample, with each column is a data point of those samples. For example, a 15 x 10 matrix represents 15 samples of with the sample size of 10.

The five parameters calculated are:

MM: Grand Mean. The mean of all the sample means.

Sample mean = Σx / n

RM: Range Mean. The mean of all ranges of all samples.

Range = max(sample) – min(sample)

MD: Mean Deviation. The mean of all the standard deviation of all samples.

Sample Deviation = √( (Σx^2 – (Σx)^2/n) / (n – 1)

L, U: Lower and Upper limit of the x-bar chart. How it is calculated is dependent on the sample size (number of columns).

If the size ≤ 25, then:

U = MM + a2 * RM
L = MM – a2 * RM

Code:
EXPORT XCHART(mat)
BEGIN
// 2017-08-25 EWS
// Quality control
// {grand mean, range mean,
// std.dev mean, LCL, UCL}

// Grand mean
LOCAL MM:=mean(mean(TRN(mat)));

// Average range
LOCAL RM,C,R,I,L,cl;
// sample size: columns
C:=colDim(mat);
// number of samples
R:=rowDim(mat);

FOR I FROM 1 TO R DO
cl:=row(mat,I);
RM:=RM+(MAX(cl)-MIN(cl));
END;
RM:=RM/R;

// Average deviation
LOCAL MD:=mean(stddev(TRN(mat)));


// Estimate LCL,UCL

LOCAL U,L;
IF C≤25 THEN
// a2 list for sample size 2-25
LOCAL a;
LOCAL a2:={1.88,1.023,.729,
.577,.483,.419,.373,.337,.308,
.285,.266,.249,.235,.223,
.212,.203,.194,.187,.18,.173,
.167,.162,.157,.153};
a:=a2(C-1);
L:=MM-a*RM;
U:=MM+a*RM;
ELSE
// c4 (C>25)
LOCAL c4:=√(2/(C-1))*((C/2-1)!/
((C-1)/2-1)!);
U:=MM+3*MD/(c4*√C);
L:=MM-3*MD/(c4*√C);
END;
// Results
RETURN {MM,RM,MD,L,U};
END;

Sources:

Aczel, Amir D. and Sounderpandian, Jayavel. Complete Business Statistics McGraw-Hill Irwin: Boston. 2006. ISBN 13: 978-0-07-286882-1

“6.3.2. What Are Variables Control Charts?” Engineering Statistics Handbook.
http://www.itl.nist.gov/div898/handbook/pmc/section3/pmc32.htm
Retrieved August 24, 2017

Six Sigma Improvement with Minitab “Appendix 2: Factors for control charts” Published on line June 22, 2011. http://onlinelibrary.wiley.com/doi/10.1002/9781119975328.app2/pdf Retrieved August 24, 2017