Home / Shared Math Details / Control Chart Math / Out-of-Control Rules
Out-of-Control Rules¶
This page defines the out-of-control rules Quantum XL applies to a control chart: the exact condition each rule tests, the parameters and defaults it carries, which points it marks, and how the zone lines the rules read are placed. One rule engine serves every chart, so the rule definitions here are shared; what differs between charts is which rules are offered, which are on by default, and which panels they run on.
Notation¶
| Term | Description |
|---|---|
| \(v_i\) | the value plotted at point \(i\) (a subgroup mean, a range, a proportion, a count, and so on) |
| \(\text{CL}_i\) | the center line at point \(i\) |
| \(\text{UCL}_i, \text{LCL}_i\) | the upper and lower control limits drawn at point \(i\) |
| \(k\) | the chart's sigma multiplier (number of standard deviations), default \(3\) |
| \(k^{*}\) | an independent sigma multiple for Rule 1, used only by the Levey-Jennings 1-2s test |
| \(\sigma_{1,i}\) | one sigma of the plotted statistic at point \(i\), recovered from the limit spacing |
| \(A_i^{+}, A_i^{-}\) | the upper and lower outer zone lines at point \(i\) (the boundary between Zone A and Zone B) |
| \(B_i^{+}, B_i^{-}\) | the upper and lower inner zone lines at point \(i\) (the boundary between Zone B and Zone C) |
| \(N\) | a rule's count threshold |
| \(M\) | a rule's window length (rules 5 and 6 only) |
| \(s_j\) | the sign of the step from point \(j-1\) to point \(j\) (Rule 4 only) |
| \(\Phi\) | the standard normal cumulative distribution function |
| \(F^{-1}\) | the inverse cumulative distribution function of the chart's own distribution (G and T charts) |
| \(d\) | one third of the sigma multiplier, taken in probability space (G and T charts) |
The zone names Zone A, Zone B, and Zone C are defined on Control Limits and Zones. The symbols \(A_i^{\pm}\) and \(B_i^{\pm}\) used here are the lines that separate those zones, held per point so they follow stepped limits.
Which Points a Rule Marks¶
Rule 1 tests one point at a time. Every other rule tests a run, a window, or a pair of points, and a rule of that kind flags only the point that completes the pattern plus each later point that extends it. The earlier points of the run are never marked. A run of twelve points on one side of the center line, tested against a threshold of nine, therefore marks points nine through twelve and leaves points one through eight unmarked.
The Rule Set¶
Nine rules exist, numbered 1 through 9. Rules 1 through 8 are the Shewhart special-cause tests; Rule 9 is offered on the G chart only. The Levey-Jennings chart uses a different set of six rules, described in The Westgard Set below, five of which are these same tests under their clinical names plus one test (R-4s) that no other chart offers.
| Rule | What it tests | Parameters | Default |
|---|---|---|---|
| 1 | one point beyond a control limit | none (the chart's own \(k\)) | the drawn limits |
| 2 | \(N\) consecutive points on the same side of the center line | \(N\) | \(9\) |
| 3 | \(N\) consecutive increases, or \(N\) consecutive decreases | \(N\) | \(6\) |
| 4 | \(N\) consecutive steps that alternate up and down | \(N\) | \(14\) |
| 5 | \(N\) of \(M\) consecutive points beyond an outer zone line, same side | \(N\), \(M\) | \(2\) of \(3\) |
| 6 | \(N\) of \(M\) consecutive points beyond an inner zone line, same side | \(N\), \(M\) | \(4\) of \(5\) |
| 7 | \(N\) consecutive points inside both inner zone lines | \(N\) | \(15\) |
| 8 | \(N\) consecutive points outside the inner zone lines, either side | \(N\) | \(8\) |
| 9 | \(N\) consecutive plotted values of exactly zero | \(N\) | \(4\), and off |
A threshold box left blank uses the default from this table. On the variable charts a supplied threshold is applied only when it is greater than zero, so a blank or zero box also falls back to the default.
The G and T charts require \(N \ge 2\) for rules 2, 3, 4, and 9. The attribute charts accept \(N \ge 1\), but a threshold of \(1\) makes a rule fire on nearly every point and is not a useful setting.
Sigma Zones: Three Conventions¶
Rules 5 through 8, and the Westgard R-4s test, are the only rules that read the zone lines. Those lines are not placed the same way on every chart family, and the difference changes what those rules test.
Variable Charts¶
On the variable charts the band that is actually drawn is cut into thirds on each side, and the sigma multiplier \(k\) does not enter the calculation:
Each side is measured from its own limit, so an asymmetric band gives asymmetric zone lines, and a manual band is divided the same way as a calculated one. On the range, standard deviation, and moving range panels the zone lines are built from the unclamped lower limit and then floored at zero, so when the drawn lower limit has been clamped to zero the lower zone lines are not thirds of the band that appears on the chart.
Attribute Charts and Z-MR¶
On the attribute charts and on the Z-MR chart, one sigma of the plotted statistic is recovered from the upper half of the band and the zone lines are placed at one and two of those units:
Because \(k\) divides out, these lines sit at a true one and two sigma for any \(k\). They are mirrored downward from the upper half band rather than measured from the lower limit, so when the lower control limit has been floored at zero a lower zone line can fall below it, and can even be negative. If the upper limit or the center line is unavailable, or \(k\) is not positive, all four zone lines are left blank and no zone rule can fire. The Z-MR chart always uses \(k = 3\) for this construction.
G and T Charts¶
On the G and T charts, limits and zones are not placed at a fixed distance from the center line at all. Thirds of \(k\) are taken in standard normal probability space,
seven probabilities are formed with the standard normal CDF \(\Phi\), and each is pushed through the chart's own inverse CDF \(F^{-1}\) (an interpolated geometric distribution for the G chart, a three-parameter Weibull for the T chart):
The distribution being inverted is asymmetric, so these lines are not equal distances above and below the center line, and the spacing between them is uneven. The zone rules are not offered on these charts.
Effect of the Sigma Multiplier¶
Because the variable-chart zone lines are thirds of the drawn band, they move with the sigma multiplier: the inner line sits at \(k/3\) sigma and the outer line at \(2k/3\) sigma.
| Sigma multiplier \(k\) | Inner zone line | Outer zone line |
|---|---|---|
| \(2\) | \(0.667\) sigma | \(1.333\) sigma |
| \(3\) (default) | \(1\) sigma | \(2\) sigma |
| \(3.5\) | \(1.167\) sigma | \(2.333\) sigma |
At the default \(k = 3\) the lines land on exactly one and two sigma, which is the arrangement the rule names assume. At any other multiplier the four zone rules test a different distance on a variable chart: Rule 5 becomes "beyond \(2k/3\) sigma", rules 6 and 8 become "beyond \(k/3\) sigma", and Rule 7 becomes "within \(k/3\) sigma". Rule 1 is unaffected, because it reads the drawn limits, and rules 2, 3, 4, and 9 are unaffected, because they read only the center line or the order of the plotted values.
On the attribute charts and Z-MR the multiplier divides out of the zone calculation, so the four zone rules keep their stated meaning at any \(k\). On the G and T charts the zone rules are not offered at all.
Rule Definitions¶
Rule 1: One Point Beyond a Control Limit¶
Point \(i\) is flagged when the plotted value falls outside the limits drawn at that point:
Both comparisons are strict, so a point sitting exactly on a control limit is not flagged. The test uses the limits as drawn, which means it follows stepped limits, manual limits, and transformed data with no special handling. The rule has no threshold of its own: its width is the chart's sigma multiplier \(k\), chosen with the control limits.
The engine also supports an independent multiple \(k^{*}\) for this rule. When one is supplied, one sigma of the plotted statistic is recovered separately for each side from the drawn limits,
and the test is applied at \(k^{*}\) of those units instead:
Recovering each side on its own means an asymmetric band gives an asymmetric per-side sigma. The only chart that uses an independent multiple is Levey-Jennings, whose 1-2s warning is this same test at \(k^{*} = 2\). On every other chart Rule 1 tests the drawn limits.
On a CUSUM chart this is the only rule available, and the signal is raised when an accumulator exceeds the decision interval rather than by comparing a plotted point with a limit line. On the multivariate charts (T-squared and generalized variance) it is likewise the only rule, raised when the statistic exceeds its upper limit; those charts have no zone lines.
Rule 2: Points on the Same Side of the Center Line¶
Point \(i\) is flagged when the \(N\) points ending at \(i\) all lie strictly on one side of the center line:
A point exactly on the center line belongs to neither side and ends both runs. Default \(N = 9\).
Rule 3: Consecutive Increases or Decreases¶
Point \(i\) is flagged when every step in the \(N\) steps ending at \(i\) moves the same way:
\(N\) counts steps between points, not points, so the pattern spans \(N+1\) points. With the default \(N = 6\) the seventh point of a monotone run is the first one flagged. Both comparisons are strict: two equal consecutive values end both runs.
Rule 4: Alternating Up and Down¶
Write the direction of the step into point \(j\) as
Point \(i\) is flagged when the \(N\) steps \(s_{i-N+1}, \ldots, s_i\) are all non-zero and each one has the opposite sign to the step before it. A tie between two consecutive points gives \(s_j = 0\) and ends the alternation. The pattern spans \(N+1\) points, so with the default \(N = 14\) the fifteenth point of a zigzag is the first one flagged.
Rule 5: N of M Beyond an Outer Zone Line¶
Every window of \(M\) consecutive points is examined. The window starting at \(t\) fires on the upper side when at least \(N\) of its points sit beyond the upper outer zone line,
and on the lower side when at least \(N\) of its points satisfy \(v_j < A_j^{-}\). Both sides are counted in the same pass, so one window can fire on both. Only the points of a firing window that are themselves beyond the zone line are flagged; a point that lies inside the band is not flagged just because it sits in a firing window. Each point is compared with its own zone lines, so stepped zones need no special treatment, and both comparisons are strict. Defaults \(N = 2\), \(M = 3\).
Rule 6: N of M Beyond an Inner Zone Line¶
This rule has the same window structure as Rule 5 and reads the inner zone lines instead. The window starting at \(t\) fires on the upper side when
and on the lower side when at least \(N\) of its points satisfy \(v_j < B_j^{-}\). Again only the points actually beyond the zone line are flagged, and the comparisons are strict. Defaults \(N = 4\), \(M = 5\).
Rule 7: Points Inside the Inner Zone Lines¶
Point \(i\) is flagged when the \(N\) points ending at \(i\) all sit inside both inner zone lines:
Unlike rules 5, 6, and 8, this test is not strict on either side, so a point lying exactly on an inner zone line counts as inside. Default \(N = 15\).
A long run close to the center line is a signal because it is too good for the limits that were calculated, and usually means the limits are too wide for the current process: subgroups that mix two different sources of variation, or a sigma estimate inflated by an earlier unstable period.
Rule 8: Points Outside the Inner Zone Lines¶
Point \(i\) is flagged when the \(N\) points ending at \(i\) all sit outside the inner zone lines, on either side:
The condition is evaluated point by point, so the run may switch sides: the test is "outside the inner zone lines", not "outside on one particular side". Both comparisons are strict. Default \(N = 8\).
Rule 9: Consecutive Zeros¶
Point \(i\) is flagged when the \(N\) points ending at \(i\) are all exactly zero:
The comparison is an exact equality against zero, which suits a plotted statistic that counts whole opportunities between events. Default \(N = 4\), and the rule is off unless it is turned on.
This rule is offered on the G chart only, where the plotted value counts opportunities between events and a stretch of zeros means events happening back to back. No other chart exposes it.
Westgard R-4s¶
For each consecutive pair of points, R-4s fires when one point of the pair is beyond the upper outer zone line and the other is beyond the lower one, so that the pair straddles the center line with a span greater than four sigma:
Both points of a firing pair are flagged. Two points beyond the same outer zone line do not fire this rule; that pattern is 2-2s. R-4s has no parameters.
R-4s is offered on the Levey-Jennings chart only. It is the one rule in the product that no Shewhart rule number corresponds to.
Which Rules Each Chart Offers¶
Availability and the on/off default are set per chart family. A rule that is not offered on a chart cannot be turned on there.
| Chart | Rules offered | On by default |
|---|---|---|
| Xbar-R, Xbar-S, I-MR, I-MR-R/S, Z-MR | 1 through 8 | all eight |
| EWMA, CUSUM | 1 only | 1 |
| T-squared, generalized variance | 1 only | 1 |
| p, np, c, u, Laney P', Laney U' | 1, 2, 3, 4 | 1 only |
| T | 1, 2, 3, 4 | 1 only |
| G | 1, 2, 3, 4, 9 | 1 only |
| Levey-Jennings | the six Westgard rules | all six |
On the attribute and rare-event charts rules 2, 3, and 4 are present in the dialog with their thresholds ready (\(9\), \(6\), and \(14\)) but unchecked, so a chart of those families flags only points beyond the control limits until more rules are turned on. On the variable charts all eight available rules start checked.
The Westgard Set¶
The Levey-Jennings chart replaces the numbered rules with the six Westgard multi-rule tests. They run on the same engine, so five of them are tests already defined above with different names and different thresholds.
| Westgard rule | What it tests | Parameters |
|---|---|---|
| 1-2s | one point beyond the outer zone line, a warning | sigma multiple \(2\) |
| 1-3s | one point beyond the control limits | none |
| 2-2s | \(2\) of \(2\) consecutive points beyond the same outer zone line | \(N = 2\), \(M = 2\) |
| R-4s | a consecutive pair straddling the center, one point beyond each outer zone line | none |
| 4-1s | \(4\) of \(4\) consecutive points beyond the same inner zone line | \(N = 4\), \(M = 4\) |
| 10x | \(10\) consecutive points on one side of the mean | \(N = 10\) |
All six are on by default. 1-2s is Rule 1 applied at \(k^{*} = 2\), 1-3s is Rule 1 at the drawn limits, 2-2s is Rule 5, 4-1s is Rule 6, and 10x is Rule 2. Rules 7, 8, and 9 are not part of the Westgard set and never run on this chart. The Levey-Jennings dialog offers the sigma multiplier like every other variable chart, and it defaults to \(k = 3\). At that default the thirds-of-the-band zone lines fall on a true one and two sigma, so the Westgard names mean exactly what they say. Changing the multiplier moves the zone lines with it, which leaves the names inaccurate: at \(k = 2\), for example, the line the 1-2s rule tests against sits at \(0.667\) sigma rather than \(1\) sigma. Leave the multiplier at \(3\) if you want the Westgard rules to carry their standard meaning.
Which Panels Are Checked¶
Every panel of every chart is checked, including the dispersion panels. On a two-panel or three-panel variable chart the range, standard deviation, and moving range panels each run the rules over their own plotted values, against their own center line and limits.
Rules 5 through 8 are restricted to the location panel (Xbar or Individuals), because they are statements about a symmetric distribution around the center line and the dispersion statistics are not symmetric. Rules 1 through 4 run on every panel.
| Panel | Rules that can run |
|---|---|
| Xbar or Individuals (location) | all rules offered by the chart |
| Range, standard deviation, moving range | 1, 2, 3, 4 |
| Z-MR moving range | 1, 2, 3 |
| Single-panel charts (attribute, G, T, EWMA, CUSUM) | all rules offered by the chart |
The Z-MR moving range panel is the one exception to the general dispersion-panel set: the alternating rule does not run there.
When a chart is drawn with the location panel hidden, the rows for rules 5 through 8 are grayed out in the dialog but keep whatever setting they had, so the choice survives switching the panel view back.
Missing Values, Splits, and Phases¶
A blank row keeps its position on the chart: it is plotted as a gap, and the points after it do not shift left. Each rule handles that gap in its own way.
| Rule | Effect of a blank point |
|---|---|
| 1 | the point is skipped and is never flagged |
| 2 | both same-side counts reset, so the gap breaks the run |
| 3 | both counts reset when either the current or the previous point is blank |
| 4 | the alternation count resets when any of the three points forming the two steps is blank |
| 5 and 6 | every window containing the blank point is discarded, so the gap blocks all \(M\) windows that overlap it |
| 7, 8, and 9 | the run count resets, so the gap breaks the run |
| R-4s | the pair containing the blank point is skipped |
A gap therefore breaks a run rather than bridging it.
Two other situations remove a point's limits, and they are not the same as a gap:
- A subgroup with no usable observation has no plotted value either, so it is a gap and the table above applies.
- An incomplete set of manual limits is rejected for the whole panel, and the panel is replaced by an error message instead of a chart, so no rule is evaluated or reported for it.
Turning the control limit type off is different again, and is covered separately below.
Runs reset at every split and phase boundary. Each split section and each phase is analyzed on its own, so no run count and no \(M\) window carries across a boundary: a run of eight points that crosses a boundary is treated as the end of one run and the start of another, and cannot combine into a longer one. This applies on both engine paths, the one used by the variable charts and the one used by the attribute and rare-event charts.
When the Limits Are Turned Off¶
Setting the control limit type to None does not have the same effect on every chart.
- On the attribute and rare-event charts the center line is still drawn while the limits and the zone lines are removed. Rule 1 and the zone rules cannot fire, because the values they compare against are gone, but rules 2, 3, 4, and 9 need only the center line or the order of the plotted values, so they still fire and still color points.
- On the variable charts nothing is flagged at all. The limits, the zone lines, and the whole rule result are removed together.
What the Chart Reports¶
Each rule that fires on a point sets its own bit in a single mask held for that point, and the bits are combined with a logical OR. There is no priority order and no first-rule-wins: when several rules fire on the same point, every one of them is recorded. The chart then draws the point in one of two colors, red when the mask is not zero and the normal marker color otherwise.
The software does not report which rule fired. There is no per-rule color, no per-rule marker shape, and no label naming the rule. A red point means that at least one enabled rule fired there, and nothing more. Identifying the particular rule is done by reading the pattern around the point against the rule definitions.
Used by¶
- Attribute charts, rules 1 through 4: p, np, c, u, Laney P', and Laney U'.
- Rare-event charts, rules 1 through 4 plus Rule 9 on the G chart: G Chart and T Chart.
- Z-MR Chart: rules 1 through 8 on the Z panel, rules 1 through 3 on the moving range panel.
- The variable charts (Xbar-R, Xbar-S, I-MR, I-MR-R/S, Levey-Jennings, EWMA, CUSUM) and the multivariate charts use the same engine; their math pages are planned.
See Also¶
References¶
- Nelson, L. S. (1984). The Shewhart control chart: tests for special causes. Journal of Quality Technology, 16(4), 237-239.
- Nelson, L. S. (1985). Interpreting Shewhart Xbar control charts. Journal of Quality Technology, 17(2), 114-116.
- Western Electric Company (1956). Statistical Quality Control Handbook. Western Electric Company, Indianapolis, IN.
- Montgomery, D. C. (2013). Introduction to Statistical Quality Control, 7th ed. Wiley.
- Wheeler, D. J., and Chambers, D. S. (1992). Understanding Statistical Process Control, 2nd ed. SPC Press.
- Champ, C. W., and Woodall, W. H. (1987). Exact results for Shewhart control charts with supplementary runs rules. Technometrics, 29(4), 393-399.
- Westgard, J. O., Barry, P. L., Hunt, M. R., and Groth, T. (1981). A multi-rule Shewhart chart for quality control in clinical chemistry. Clinical Chemistry, 27(3), 493-501.
- Levey, S., and Jennings, E. R. (1950). The use of control charts in the clinical laboratory. American Journal of Clinical Pathology, 20, 1059-1066.
- Benneyan, J. C. (2001). Number-between g-type statistical quality control charts for monitoring adverse events. Health Care Management Science, 4(4), 305-318.