Dataplot Vol 1 Vol 2

# CONTROL CHART

Name:
... CONTROL CHART
Type:
Graphics Command
Purpose:
Generates the following types of univariate control charts:

1. Mean (or xbar)
2. Range (or R)
3. Standard deviation (or S)

4. Moving average
5. Moving range
6. Moving standard deviation

7. Cumulative sum (or CUSUM)
8. Exponentially weighted moving average (or EWMA)

9. Binomial proportion (or P)
10. Binomial counts (or NP)
11. Poisson counts for constant area and equal sub-group sizes (or C)
12. Poisson counts where area or sub-group sizes are not neccessarily equal (or U)

13. ISO 13528
Description:
A control chart, introduced by Walter Shewart, is a data analysis technique for determining if a measurement process has gone out of statistical control. For continuous data, most of the standard control charts attempt to detect either a change in location or a change in variation. The binomial and Poisson control charts have been developed for the cases when the data consist of proportions or counts rather than a continuous response variable.

For each of the supported control charts, limits have been determined for signaling when a response is "out of control". That is, if the points on the control chart are within the control limits, the data is considered "in control". When a point is outside these control limits, the data is considered "out of control" and the process should be examined to determine the cause.

In developing the control limits, an effort is made to balance quick detection while minimizing "false positives" (i.e., signaling that a process is out of control when it is in fact still in control). Quick detection is desired to minimize the number of potentially bad units produced. Minimizing false positives is desired since shutting down the process can result in unnecessarily lost production (and possibly significant cost).

The mean control chart is the most commonly used control chart for detecting a change in location. The CUSUM and EWMA charts were developed to detect small shifts of location.

The standard deviation control chart and range control chart are the primary control charts for detecting a change in the variability of a process.

Typically, the data for control charts is divided into batches (sub-groups) and the appropriate statistic is computed and plotted for each sub-group. The MOVING control charts are used for the case when the data are not divided into sub-groups.

The ISO control chart is a variant of control charts used in the ISO 13528 standard for proficiency studies for multiple rounds.

There is separate documentation for the mean, standard deviation, range, cusum, ewma, and the various proportion and counts control charts. This documentation may contain more details for that specific type of control chart.

The control chart consists of:

 Vertical axis: the mean, range, standard deviation, or other appropriate statistic for each sub-group; Horizontal axis: sub-group designation.

In addition, horizontal lines are drawn at the mean (i.e., the mean of the means, ranges, standard deviations, or other appropriate statistic) and at the upper and lower control limits.

Syntax 1:
<stat> CONTROL CHART <y> <x>             <SUBSET/EXCEPT/FOR qualification>
where <stat> is one of XBAR (or MEAN), R (or RANGE), S (or SD), CUSUM, or EWMA;
<y> is the response variable;
<x> is a variable containing the sub-group identifications;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

Enter one of MEAN, RANGE, S, CUSUM, or EWMA to specify what type of control chart to generate.

Syntax 2:
MOVING <stat> CONTROL CHART <y>             <SUBSET/EXCEPT/FOR qualification>
where <stat> is one of AVERAGE, RANGE, or SD;
<y> is the response variable;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Syntax 3:
<P/NP> CHART <y> <size> <x>             <SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable containing the number of defectives for each sub-group;
<size> is a variable containing the sample size for each sub-group;
<x> is a variable containing the sub-group identifications;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

If P is specified, then the percentage of defectives is plotted. If NP is specified, then the number of defectives is plotted.

Syntax 4:
C CHART <y> <x>             <SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable containing the number of defectives for each sub-group;
<x> is a variable containing the sub-group identifications;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

The C chart is used for Poisson counts. For the Poisson counts case, you can have either an area of material that is being inspected or a sample size. The C chart is used when the sub-groups have constant area (or equal sample size).

Syntax 5:
U CHART <y> <area> <x>             <SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable containing the number of defectives for each sub-group;
<area> is a variable containing the sample size or area adjustment for each sub-group;
<x> is a variable containing the sub-group identifications;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

The U chart is used for Poisson counts. For the Poisson counts case, you can have either an area of material that is being inspected or a sample size. The U chart is used when the sub-groups have unequal area (or unequal sample size).

Syntax 6:
ISO 13528 CONTROL CHART <y> <x>             <SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable;
<x> is a variable containing the sub-group identifications;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This is a variant of the mean control chart. This chart is constructed as follows:

1. Use a z-score for the response variable. Since the ISO 13528 standard allows several variants of the z-score (e.g., you may use a reference value rather than the sample mean in computing the z-score), it is assumed that the response variable is already a z-score (i.e., the z-score will not automatically be computed from the raw data).

2. If there is replication, compute a mean for each group. If there is no replication, just use the single data value as the estimate of the mean.

3. Control limits are set at +/-2 and +/- 3.

For the ISO 13528 control chart, the sub-groups are typically the different laboratories. The ISO 13528 control chart is used to identify laboratories that are not consistent with the other laboratories in the proficiency study.

Examples:
MEAN CONTROL CHART Y X
RANGE CONTROL CHART Y X
S CONTROL CHART Y X
MOVING AVERAGE CONTROL CHART Y X
Note:
Control charts were introduced as an alternative to acceptance sampling. In acceptance sampling, some sample of units are inspected after production. Then based on the number of defective units, the entire lot is either accepted or rejected.

One of the motivations for control charts is to detect problems during production rather than after production. That is, if a production problem can be detected early, then this can help minimize the number of defective units produced.

Note:
Dataplot normally sets the control limits automatically. However, you can enter your own control limits if you wish. This is usually based on historical data or specific engineering requirements. User control limits are entered with the commands:

LET TARGET = <value>
LET USL = <value>
LET LSL = <value>

This sets the target value, the upper control limit, and the lower control limit respectively.

Note:
For the mean, range, standard deviation, cusum, and EWMA control charts, the response variable is assumed to follow an approximately normal distribution. This assumption is the basis for calculating the upper and lower control limits.
Note:
You can control the appearance of this chart by setting the switches for the LINE, CHARACTER, SPIKE, and BAR commands appropriately. Specifically, for the mean, range, and standard deviation control charts,

 Trace 1 = the value of the statistic for each sub-group Trace 2 = the mean of the statistic over the sub-groups Trace 3 = the Dataplot calculated upper control limit Trace 4 = the Dataplot calculated lower control limit Trace 5 = the user-specified target value Trace 6 = the user-specified upper control limit Trace 7 = the user-specified lower control limit

For example, some analysts prefer to draw the value of the statistic as a character or spike rather than a connected line. If you include both Dataplot calculated and user-specified limits, you may want to draw them with different colors or different line styles.

For the other control charts, the documentation for the specific control charts provides a similar listing for the mapping of traces to chart features. These may vary somewhat from the above list.

Note:
The control charts documented here are univariate control charts. That is, they monitor a single response variable.

The HOTELLING CONTROL CHART can be used to simultaneously monitor multiple response variables for a shift in location. Although you can monitor multiple response variables with individual mean control charts, this assumes that the response variables are independent. The Hotelling control chart takes the correlation structure into account.

Note:
There have been numerous proposals for signaling when a process is out of control. For the mean, range, and standard deviation control charts, critierion developed by Western Electric have some popularity. These rules are as follow:

1. Any point > 3*$$\sigma$$ or < 3*$$\sigma$$

2. Two of the last threee points > 2*$$\sigma$$
Two of the last threee points < 2*$$\sigma$$

3. Four of the last five points > 1*$$\sigma$$
Four of the last five points < 1*$$\sigma$$

4. Eight consecutive points above the center line or eight consecutive points below the center line

The command

SET CONTROL CHART LIMITS <DEFAULT/WECO/ISO 13528>

can be used to specify the control limits used. DEFAULT uses the standard control chart limits. WECO uses the Western Electric guidlines. ISO 13528 uses the +/-2 and +/-3 limits (this assumes the response variable has been transformed to a z-score).

Note that the if the WECO rules are turned on, the following is done:

1. The standard control limits are drawn (traces 2, 3, and 4).

2. The individual plot points that signal an out of control point according to the WECO rules are drawn using trace 5. So you can control how these points are drawn by setting the attributes for trace 5. This is demonstrated in the Program 3 example below.

The WECO rules have been criticized for generating too many false positives.

Note:
In some situations, you may want to highlight certain points on the control chart. For example, you may want to flag points that are outside the control limits or you may want to flag a particular sub-group (e.g., if a new batch of data is being added to historical data, you may want to emphasize the new data).

The 2012/02 version added the HIGHLIGHT option. This is demonstrated in the Program 2 example below.

Default:
None
Synonyms:
XBAR CONTROL CHART for MEAN CONTROL CHART
STANDARD DEVIATION CONTROL CHART for S CONTROL CHART
Related Commands:
 XBAR CHART = Generate a mean control chart. R CHART = Generate a range control chart. S CHART = Generate a standard deviation control chart. CUSUM CONTROL CHART = Generates a mean cusum control chart. EWMA CONTROL CHART = Generates a ewma control chart. HOTELLING CONTROL CHART = Generates a Hotelling control chart. MOVING AVERAGE CHART = Generates a moving average control chart. MOVING RANGE CHART = Generates a moving range control chart. MOVING SD CHART = Generates a moving sd control chart. C CHART = Generates a C control chart. U CHART = Generates a U control chart. P CHART = Generates a P control chart. NP CHART = Generates an Np control chart. CHARACTERS = Sets the types for plot characters. LINES = Sets the types for plot lines. SPIKES = Sets the on/off switches for plot spikes. BARS = Sets the on/off switches for plot bars. PLOT = = Generates a data or function plot. LAG PLOT = Generates a lag plot. 4-PLOT = Generates a 4-plot for univariate analysis. ANOP PLOT = Generates an ANOP plot.
References:
Walter Shewart (1931), "Economic Control of Quality of Manufactured Product", Van Nordstrom.

Kaoru Ishikawa (1982), "Guide to Quality Control," Asian Productivity Organization, (Chapter 7).

Thomas Ryan (1989), "Statistical Methods for Quality Improvement", Wiley.

Douglas Montgomery (2001), "Introduction to Statistical Quality Control", Fourth Edition, Wiley.

ISO 13528 (2005), "Statistical Methods for use in proficiency testing by interlaboratory comparisons," First Edition, 2005-09-01.

Applications:
Quality Control
Implementation Date:
Pre-1987
1988/01: Support for P, PN, U, and C charts
1990/07: Support for user specified control limits
1997/03: Support for CUSUM and EWMA charts
1997/03: Support for moving average, moving range and moving sd charts
2012/01: Support for highlighting option
2012/01: Support for WECO and ISO 13528 control limits
2012/02: Support for ISO 13528 control chart
Program 1:

SKIP 25
.
MULTIPLOT CORNER COORDINATES 2 2 98 98
MULTIPLOT SCALE FACTOR 2
MULTIPLOT 2 2
TITLE CASE ASIS
CASE ASIS
TITLE OFFSET 2
LINE BLANK SOLID DASH DASH DOTT DOTT
CHARACTER CIRCLE
CHARACTER FILL ON
CHARACTER HW 1 0.75
.
YLIMIT 0.5 0.6
MAJOR YTIC MARK NUMBER 6
Y1TIC MARK LABEL DECIMAL 2
XLIMITS 0 100
X1TIC MARK OFFSET 0 20
TITLE Raw Data
PLOT Y
.
YLIMIT
MAJOR YTIC MARK NUMBER
Y1TIC MARK LABEL DECIMAL
XLIMITS 0 40
X1TIC MARK OFFSET 0 0
TITLE Mean Control Chart
MEAN CONTROL CHART Y X
.
TITLE Range Control Chart
RANGE CONTROL CHART Y X
.
TITLE SD Control Chart
STANDARD DEVIATION CONTROL CHART  Y X
.
END OF MULTIPLOT
MOVE 50 98
JUSTIFICATION CENTER
TEXT Control Charts for Magnification Standard for SEMs (CROARK3.DAT)
MOVE 50 2
TEXT Batch
DIRECTION VERTICAL
MOVE 2 50
TEXT Distance (Micrometers)
DIRECTION HORIZONTAL

Program 2:

SKIP 25
LET N = SIZE Y
LET TAG = 0 FOR I = 1 1 N
LET TAG = 1 SUBSET Y > 0.58
.
SET WRITE DECIMALS 3
LABEL CASE ASIS
CASE ASIS
TITLE Magnification Standard for SEMs
Y1LABEL Distance (Micrometers)
XLIMITS 0 40
X3LABEL AUTOMATIC
LINE SOLID SOLID DASH DASH BLANK
CHARACTER BLANK BLANK BLANK BLANK CIRCLE
CHARACTER FILL ON ALL
CHARACTER HW 1 0.75 ALL
CHARACTER COLOR RED ALL
.
HIGHLIGHT MEAN CONTROL CHART Y X TAG
.

LET TAG = 0 FOR I = 1 1 N
LET TAG = 1 SUBSET Y > 0.58
LIMITS
XLIMITS 0 100
XTIC MARK OFFSET 0 10
HIGHLIGHT MOVING MEAN CONTROL CHART Y TAG

Program 3:

LET X = SEQUENCE 1 10 1 50
LET Y = NORMAL RANDOM NUMBERS FOR I = 1 1 500
LET Y2 = Y
LET Y2 = 7*Y  FOR I = 351 1 425
LET Y = Y2
.
SET WRITE DECIMALS 3
LABEL CASE ASIS
CASE ASIS
Y1LABEL Normal Random Numbers
TITLE AUTOMATIC
LINE SOLID SOLID DASH DASH BLANK
CHARACTER BL BL BL BL CIRCLE
CHARACTER FILL ON ALL
CHARACTER HW 0.5 0.375 ALL
CHARACTER COLOR RED ALL
XLIMITS 0 50
XTIC MARK OFFSET 1 2
.
SET CONTROL CHART LIMITS WECO
MEAN CONTROL CHART Y X

Program 4:

skip 25
skip 0
let n = size y
. let z = zscore y roundid
let z = zscore y
let matid = sequence 1 1 3 for i = 1 1 n
.
label case asis
y1label z-score
x1label batch
xlimits 0 35
x1tic mark offset 0 2
y1tic mark offset 0.2 0.2
title case asis
title offset 2
title ISO 13528 Control Chart
line      solid solid dash  dash  dash  dash  blank
character blank blank blank blank blank blank blank
character hw 1 0.75 all
character fill on all
.
iso 13528 control chart z roundid

.
line      blank solid dash  dash  dash  dash  blank blank blank
character circl blank blank blank blank blank 1     2     3
highlight iso 13528 control chart z roundid matid

Program 5:

. Read data: Year is essentially the round and there are 10
.            materials.
skip 25
read turner.dat labid z year quart matid matave
skip 0
.
. Note that we want to generate the control chart treating
. laboratory as the "group-id" variable.  Generate a separate
. plot for each material.
.
case asis
label case asis
title case asis
title offset 2
line blank solid solid solid solid solid blank
line color black black blue blue red red black
character circle blank blank blank blank blank blank
character hw 1 0.75 all
character fill on all
.
multiplot corner coordinates 2 2 98 98
multiplot scale factor 3
multiplot 3 4
.
xlimits 0 90
major xtic mark number 4
ylimits -4 4
major ytic mark number 5
let nmat = unique matid
loop for k = 1 1 nmat
title Material ^k
iso 13528 control chart z labid subset matid k
end of loop
end of multiplot
.
justification center
move 50 98
text ISO 13528 Control Chart for TURNER.DAT
move 50 2
text Laboratory
direction vertical
move 2 50
text Z-Score

Program 6:

. Step 1:   Read the data
.
dimension 40 columns
skip 25
read turner.dat labid z year quarter matid matave
let roundid = year
skip 0
.
. Step 2:   Set plot control settings
.
case asis
label case asis
title case asis
title offset 2
.
y1label z-score
x1label Laboratory ID
xlimits 0 90
x1tic mark offset 2 0
ytic mark offset 0.2 0.2
.
line      blank solid solid solid solid solid blank
line color black black blue blue red red black
character circle blank blank blank blank blank blank
character hw 1 0.75
character fill on
.
. Step 3:   Generate 13528 Control Charts
.
title ISO 13528 Control Chart - Combine Materials
iso 13528 control chart z labid

.
line      solid solid dash  dash  dash  dash  blank
character blank blank blank blank blank blank circle
title ISO 13528 Control Chart - Show Individual Materials
iso 13528 control chart z labid

.
line blank all
line      solid solid dash  dash  dash  dash
character blank blank blank blank blank blank 1 2  3 4 5 6 7 8 9 10
title ISO 13528 Control Chart - Identify Materials
highlight iso 13528 control chart z labid matid


NIST is an agency of the U.S. Commerce Department.

Date created: 02/10/2015
Last updated: 02/10/2015