Home / Statistical Tools / Control Charts / Z-MR / Math Details
Math Details¶
This page gives the exact formulas Quantum XL uses to build a Z-MR chart. Each equation lists what it computes and where it appears on the chart. Unlike most control charts, Z-MR has math of its own, so some blocks below are written out here rather than shared. The blocks that are shared are followed by a link to the page that owns them.
Notation¶
| Term | Description |
|---|---|
| \(i\) | row index, in worksheet order. One row is one plotted point |
| \(x_i\) | the raw measurement at row \(i\) |
| \(y_i\) | the measurement on the working scale: \(x_i\) itself, or \(\ln x_i\) under Relative to size |
| \(p\), \(p(i)\) | a part, and the part that row \(i\) belongs to |
| \(r\), \(r(i)\) | a run, and the run that row \(i\) belongs to. A run is a maximal block of consecutive rows with the same part name |
| \(n_p\) | number of usable rows of part \(p\) |
| \(\hat{\mu}_p\) | pooled mean of part \(p\) on the working scale |
| \(\mu_i\) | the mean actually subtracted at row \(i\): an override if one was supplied for that part, otherwise \(\hat{\mu}_{p(i)}\) |
| \(\delta_i\) | the deviation \(y_i - \mu_i\) |
| \(\hat{\sigma}_i\) | the standard deviation actually divided by at row \(i\) |
| \(Z_i\) | the standardized value plotted on the Z panel |
| \(L\) | moving range length, default \(2\), allowed \(2\) to \(100\) |
| \(MR_t\), \(\overline{MR}\), \(\widetilde{MR}\) | a moving range, their average, their median |
| \(m\) | the number of moving ranges in an estimate |
| \(d_2(n)\), \(d_3(n)\), \(d_4(n)\) | expected value, standard deviation, and median of the range of \(n\) standard normal observations |
| \(\text{CL}\), \(\text{UCL}\), \(\text{LCL}\) | center line, upper and lower control limits |
| \(\sigma_1\) | the one-sigma zone width recovered from the limit spacing |
The working scale¶
Three of the four sigma modes work on the measurements as they stand. Relative to size takes the natural logarithm first, and everything downstream is computed on that scale:
Under Relative to size every measurement must be strictly positive, since \(\ln x\) is undefined otherwise. The check is made on the raw data before the outlier exclusions are read, so marking a non-positive value as an outlier does not make the analysis run.
A row whose measurement is blank or non-numeric has no \(y_i\), no \(\delta_i\), and no \(Z_i\). It plots nothing on either panel and it empties a slot in every moving range window that would have contained it.
Parts, runs, and the part mean¶
Rows are grouped two ways at once, and the two groupings do different jobs.
- A part is the set of every row carrying that part name, wherever those rows sit in the sheet.
- A run is a maximal block of consecutive rows carrying the same part name. A part that appears in two separate blocks produces two runs.
The center of the standardization is always the part, never the run:
summed over the rows of part \(p\) that are usable and included in the limit calculation. This is true whichever sigma mode is selected, which is the one thing on this page most easily assumed wrong. Choosing By runs gives each run its own standard deviation, and it still subtracts the part mean pooled across all of that part's runs.
The deviation each estimate is built from follows directly:
Control chart constants¶
The range constants are looked up at the moving range length \(L\), never at a subgroup size, because this chart has no subgroups.
The range constants describe the distribution of the range \(R\) of \(n\) independent standard normal observations:
So \(R/d_2(n)\) is an unbiased estimate of \(\sigma\) from a subgroup range, \(d_3(n)\) scales the spread of a range, and \(\widetilde{R}/d_4(n)\) is the corresponding estimate from a median range. Quantum XL evaluates these from precomputed full-precision tables for \(n = 2\) to \(100\). Outside that range they are undefined, which is why a subgroup size or moving range length above \(100\) produces no estimate and no limits.
Full details: Control Chart Constants.
How the moving ranges are formed¶
Each moving range is the largest minus the smallest of the \(L\) values in a window that ends at the current point, where \(L\) is the moving range length (default \(2\), allowed \(2\) to \(100\)). At the default \(L = 2\) the window holds a pair of neighbors, so \(MR_t = \lvert x_t - x_{t-1} \rvert\). The value is stored against the last point of its window, so \(MR_t\) is plotted at position \(t\).
A moving range is produced only when the window is complete. Three consequences follow:
- The first \(L - 1\) points of a series have no complete window and are left unplotted. At the default \(L = 2\) that is the first point only; at \(L = 5\) the first four points are blank.
- A missing value, or a subgroup with no computable statistic, empties its slot and restarts the window, so the \(L - 1\) points that follow the gap are also unplotted. No moving range spans a gap: the sequence is never closed up around one.
- The number of moving ranges is at most the number of available values minus \(L - 1\), and every gap reduces it further.
Excluding a point as an outlier removes it from the sigma estimate, which drops the moving ranges whose window contained it, but the plotted moving range series is rebuilt from the complete data, so an excluded point does not break the plotted chain.
Full details: Moving Ranges.
A Z-MR chart builds two separate moving range series from the same data, and they are not interchangeable:
| Series | What the window slides along | What it produces |
|---|---|---|
| Estimation series | the deviations \(\delta_i\), over the scope set by the sigma mode | \(\hat{\sigma}\) |
| Plotted series | the standardized values \(Z_i\), inside one run | the points on the Moving Range panel |
Estimating sigma¶
Each estimate is the aggregate of one estimation series, divided by the constant that matches the aggregation method:
where \(\overline{MR}\) is the mean of the \(m\) moving ranges of the series and \(\widetilde{MR}\) is their median, taking the average of the two middle values when \(m\) is even.
What changes between the four sigma modes is only which deviations go into one series, and therefore how many separate estimates the chart carries:
| Mode | One series per | Sequence the window runs along | Estimates produced |
|---|---|---|---|
| Constant | the whole chart | every row in worksheet order | one \(\hat{\sigma}\) for the chart |
| Relative to size | the whole chart | every row in worksheet order, on the logarithmic scale | one \(\hat{\sigma}\) for the chart |
| By parts | part | all rows of that part, concatenated in worksheet order | one \(\hat{\sigma}\) per part |
| By runs | run | the rows of that run only | one \(\hat{\sigma}\) per run |
Two details follow from this table.
- Under Constant and Relative to size a single moving range window may span a part boundary. That is deliberate and it is safe, because each row's own part mean has already been subtracted, so the two neighbors are deviations from their own centers rather than raw values at different levels.
- Under By parts the run boundaries do not exist for estimation: a part's rows are concatenated in worksheet order and the window slides across the join. Under By runs they do exist, and a run shorter than \(L\) contributes no moving range at all, so it yields no estimate.
A moving range enters an estimate only when all \(L\) of its consecutive slots hold a usable, included value. A blank measurement, or a row excluded as an outlier, empties its slot and the sequence is never closed up around it.
The standardized value¶
\(\mu_i\) is the part mean \(\hat{\mu}_{p(i)}\) unless an Override Mean was supplied for that part, and \(\hat{\sigma}_i\) is the estimate the selected mode produced for that row (the chart's, the part's, or the run's) unless an Override Sigma was supplied for that part. The two overrides are read independently, so one of them can be supplied while the other is still estimated.
Under Relative to size an Override Mean is a center in the measurement's own units and its logarithm is taken before it is subtracted, while an Override Sigma is used exactly as entered, as a spread on the logarithmic scale. An Override Sigma must be finite and strictly greater than zero.
Used by: every point on the Z panel, and the sequence the Moving Range panel is built from.
Lines on the Z panel¶
These three numbers are fixed on every Z-MR chart. They do not depend on the data, on the sigma mode, on the part, or on the run, and the sigma multiplier is never consulted: there is no Number of standard deviations (k): box in the Z-MR dialog, and the value \(3\) here is a constant in the calculation rather than a setting. Because the plotted value is already measured in estimated standard deviations, a point at \(Z_i = 3.4\) is exactly 3.4 standard deviations from its own part's mean.
The lines are level across the whole chart. They do not step at a run divider, because there is nothing about a run that could move them.
Center line and limits on the Moving Range panel¶
The plotted moving ranges are formed from the \(Z_i\) values, with the window confined to one run:
The window never crosses a run boundary, so the first \(L - 1\) points of every run are blank, not only the first \(L - 1\) points of the chart. At the default \(L = 2\) that is the first point of each run. A blank \(Z\) anywhere in the window also blanks the point.
Because the plotted values are dimensionless, the panel's lines are constants:
When the plotted moving ranges are taken from standardized values they are dimensionless, so the panel's lines are constants that depend only on the moving range length and the aggregation method. With the average moving range:
With the median moving range:
At the default length \(L = 2\) these give \(1.128\), \(3.686\), and \(0\) for the average form, and \(0.954\), \(3.120\), and \(0\) for the median form. The multiplier is fixed at \(3\) on this panel; there is no sigma multiplier setting to change it. The one-sigma spacing behind the zone lines is \((\text{UCL}_{MR} - \text{CL}_{MR})/3\), which for the average form is \(d_3(L)\), and the lower zone lines are not floored at zero.
Full details: Moving Ranges.
Two consequences are worth stating plainly. The center line of this panel is not the average of the plotted moving ranges, and it is not an average of anything in your data: it is \(d_2(L)\) or \(d_4(L)\), the same number for every Z-MR chart built at that length with that method. And the multiplier in those limits is fixed at \(3\) for the same reason it is fixed on the Z panel.
Sigma zones¶
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.
Full details: Control Limits and Zones.
On the Z panel this arithmetic is as simple as it gets. The upper half band is \(\text{UCL} - \text{CL} = 3 - 0 = 3\), divided by \(k = 3\), so
and the zone lines sit at \(Z = \pm 1\) and \(Z = \pm 2\). Note what \(\sigma_1\) is here: it is one full standard deviation, recovered from the half band, not a third of anything and not a half of anything. Because this chart's band happens to be fixed at \(3\), the numbers land in the same place that the variable charts' cut-into-thirds rule would put them, but the construction is the divided-half-band one, and it stays correct no matter what.
Rules 5, 6, 7 and 8 read these lines, so on the Z panel they keep their textbook meaning exactly.
Which rules run on which panel¶
The Z panel runs whichever of the eight rules you left enabled. The Moving Range panel runs rules 1, 2 and 3 only: the engine clears every rule from 4 upward for that panel before testing it, whatever the dialog has ticked. The dialog's own note warns only that rules 5 through 8 are limited to the Z panel, so Rule 4 remains ticked, remains available, and never fires on the moving range panel.
Rule 1 on the Z panel means \(\lvert Z_i \rvert > 3\). Rule 1 on the Moving Range panel means the plotted moving range is outside the constant band above, which at the default length and the average method is above \(3.686\), the lower limit being zero.
Full details of what each rule tests and which points of a run get marked: Out-of-Control Rules.
Baselines and splits do not apply¶
Neither feature exists on this chart, and neither has a formula here.
- Estimate Limits From is not offered, so every estimate above runs over all of the data. There is no way to freeze the limits on an early period. See Baseline and Limit Estimation, where Z-MR is listed as not applicable.
- Split Control Limits is not offered either. The dividers a finished Z-MR chart draws are part runs, worked out from the part column rather than from any setting, and the limits on both panels are constants, so nothing steps at a divider. See Splits and Phases.
Shared Math Details used here¶
This chart uses shared formulas defined once in Shared Math Details.
| Shared concept | Used here for | Reference |
|---|---|---|
| Control chart constants | \(d_2(L)\), \(d_3(L)\) and \(d_4(L)\) in the sigma estimate and in the moving range panel's lines | Control Chart Constants |
| Moving ranges | how a window is formed, what empties a slot, and the constant lines of a standardized moving range panel | Moving Ranges |
| Process sigma estimation | the average and median moving range estimators | Process Sigma Estimation |
| Control limits and zones | the divided-half-band zone construction | Control Limits and Zones |
| Out-of-control rules | flagging points on both panels | Out-of-Control Rules |
| Baseline and limit estimation | recording that Z-MR does not offer it | Baseline and Limit Estimation |
| Splits and phases | the part-run dividers, which are not split control limits | Splits and Phases |
What Z-MR contributes of its own is the standardization itself: the per-part pooled mean, the four scopes the deviations are collected over, and the fixed band that follows from plotting a standardized value.
See Also¶
References¶
- Wheeler, D. J. (1991). Short Run SPC. SPC Press.
- Wheeler, D. J., and Chambers, D. S. (1992). Understanding Statistical Process Control (2nd ed.). SPC Press.
- Montgomery, D. C. (2013). Introduction to Statistical Quality Control (7th ed.). Wiley.
- Nelson, L. S. (1982). Control charts for individual measurements. Journal of Quality Technology, 14(3), 172-173.