Home / Statistical Tools / Control Charts / I-MR-R/S / Math Details
Math Details¶
This page gives the exact formulas Quantum XL uses to build an I-MR-R/S chart. Each equation lists what it computes and where it appears on the chart. Almost every formula here is shared with other control charts, so each shared block is followed by a link to the page that owns it. What is not shared is the way the three panels are wired to two different sigma estimates, and that is the part of this chart most easily misread.
Notation¶
| Term | Description |
|---|---|
| \(i\) | subgroup index, in plotted order |
| \(n_i\) | number of usable observations in subgroup \(i\) |
| \(n_{\text{sub}}\) | number of subgroups entering an estimate |
| \(n^{*}\) | modal (most common) subgroup size |
| \(x_{ij}\) | the \(j\)th observation in subgroup \(i\) |
| \(\bar{x}_i\) | mean of subgroup \(i\), the value plotted on the Individuals panel |
| \(R_i\), \(s_i\) | range and sample standard deviation of subgroup \(i\), the value plotted on the bottom panel |
| \(\bar{\bar{x}}\) | grand mean, the center line of the Individuals panel |
| \(L\) | moving range length, fixed at \(2\) on this chart |
| \(MR_{\bar{x},j}\), \(\overline{MR}_{\bar{x}}\) | moving range of \(L\) consecutive subgroup means, and their average |
| \(m\) | number of moving ranges |
| \(\hat{\sigma}_{\bar{x}}\) | estimated standard deviation of the subgroup means |
| \(\hat{\sigma}_{\text{within}}\) | estimated within-subgroup standard deviation |
| \(\hat{\sigma}_{\text{between}}\) | estimated between-subgroup standard deviation |
| \(k\) | sigma multiplier (number of standard deviations), default \(3\) |
| \(d_2(n)\), \(d_3(n)\) | expected value and standard deviation of the range of \(n\) standard normal observations |
| \(c_4(n)\), \(c_5(n)\) | expected value and standard deviation of the sample standard deviation of \(n\) standard normal observations |
| \(\mathcal{B}\) | the baseline set of subgroups the estimates are computed from |
| \(\text{CL}\), \(\text{UCL}_i\), \(\text{LCL}_i\) | center line, upper and lower control limits at subgroup \(i\) |
| \(\text{CL}_{MR}\) | center line of the moving range panel |
Which sigma draws which panel¶
| Panel | Plots | Sigma behind its lines | Do the lines step with subgroup size? |
|---|---|---|---|
| Individuals Chart | \(\bar{x}_i\) | \(\hat{\sigma}_{\bar{x}}\) | no, they are flat |
| Moving Range Chart | \(MR_{\bar{x},j}\) | \(\hat{\sigma}_{\bar{x}}\) | no, they are flat |
| Range Chart or S Chart | \(R_i\) or \(s_i\) | \(\hat{\sigma}_{\text{within}}\) | yes |
The top two panels treat one subgroup mean as one observation, so no subgroup size enters their limits. The bottom panel is the only one on which unequal subgroup sizes produce a staircase. Which of the two bottom panels is drawn follows the Estimate Sigma selection: a range panel under Rbar or the pooled standard deviation, a standard deviation panel under Sbar.
Plotted statistics¶
The mean goes on the Individuals panel, and the range or the standard deviation on the bottom panel. All of them are computed from every subgroup, whatever the baseline selection is, because the baseline governs the limits and never what is plotted. A subgroup with a single usable value has a mean but neither a range nor a standard deviation.
Center line of the Individuals panel¶
The center line is the mean of the individual observations, not the mean of the plotted subgroup means. The distinction only matters when the subgroups differ in size, and then it matters:
A larger subgroup supplies more observations and therefore carries more weight in the center line. Averaging the plotted points on the Individuals panel by hand will not reproduce the drawn center line on a chart with mixed subgroup sizes.
A supplied historical mean replaces \(\bar{\bar{x}}\) after it has been computed, so the baseline still decides which subgroups fed the estimate that was discarded.
Used by: the center line of the Individuals panel, the Center row of the summary table, and the center of the band the out-of-control tests measure runs against.
Control chart constants¶
Two families of constants appear on this chart. The range constants are evaluated at the moving range length \(L\) on the middle panel, and at each subgroup's own size \(n_i\) on a Range bottom panel. The standard deviation constants appear only when the bottom panel is an S Chart.
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.
\(c_4(n)\) is the expected value of the sample standard deviation of \(n\) independent standard normal observations, so \(s/c_4(n)\) is an unbiased estimate of \(\sigma\). \(\Gamma\) is the gamma function. Quantum XL evaluates the formula directly (a log-gamma form is used for large \(n\); the value approaches \(1\) as \(n\) grows and is taken as \(1\) for extremely large \(n\)).
\(c_5(n)\) is the standard deviation of the sample standard deviation of \(n\) standard normal observations, computed from \(c_4\).
Full details: Control Chart Constants.
Standard deviation of the subgroup means¶
This is the estimate the top two panels are drawn from, and it is not one of the three radio buttons in the Estimate Sigma group. It is always formed the same way, from the moving ranges of the subgroup means:
Each \(MR_{\bar{x},j}\) is the maximum minus the minimum of \(L\) consecutive subgroup means, and \(\overline{MR}_{\bar{x}}\) is their average. Only subgroups whose size equals the modal (most common) size \(n^{*}\) contribute, and a subgroup of any other size breaks the chain of consecutive means in the same way a missing value breaks the chain on an individuals chart. The modal size must also account for more than half of the subgroups; when it does not, \(\hat{\sigma}_{\bar{x}}\) cannot be computed, and neither can the between or within-and-between sigma.
The aggregate is always the average moving range. The median moving range of the subgroup means cannot be selected: the individuals methods apply to individual observations, and subgrouped data always uses the average here, whichever individuals method a dialog happens to show.
Full details: Process Sigma Estimation.
Two consequences are specific to this chart. The set of means the limits are estimated from is not the set of means that is plotted: every subgroup with a mean is plotted, while only the modal-size subgroups feed \(\hat{\sigma}_{\bar{x}}\). And when no size accounts for more than half of the subgroups, \(\hat{\sigma}_{\bar{x}}\) does not exist, so the Individuals and Moving Range panels are drawn with their points and with no center line and no limits.
Control limits on the Individuals panel¶
The spread used here is the standard deviation of the subgroup means themselves. It is not \(\hat{\sigma}_{\text{within}}/\sqrt{n_i}\), which is what an Xbar panel uses, and it is not a moving range of individual measurements, which is what an Individuals panel on an I-MR chart uses. Because no \(n_i\) appears, all three lines are flat across the whole chart even when the subgroup sizes differ.
There is no flooring and no capping on this panel. A subgroup mean can legitimately be any value, so both limits are drawn wherever the arithmetic puts them.
Full details: Control Limits and Zones.
The moving range of the means panel¶
The moving range itself is built the same way every moving range in the product is built, with the window sliding along the sequence of subgroup means:
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.
On this chart \(L\) is fixed at \(2\), so \(MR_{\bar{x},t} = \lvert \bar{x}_t - \bar{x}_{t-1} \rvert\) and exactly one position, the first, is left unplotted at the start of the chart and of each phase.
The distinction between the sequence that is plotted and the sequence that is estimated from is set out in the shared table:
The construction above is always the same. What differs between charts is the sequence the window slides along:
| Moving range series | Sequence the window runs over | What it feeds |
|---|---|---|
| Individual observations | the observations in worksheet order | the plotted moving range panel of an Individuals and Moving Range chart, and the average or median moving range within sigma |
| All subgroup means | every subgroup that has a mean, in worksheet order | the plotted moving range panel of an Individuals, Moving Range, and R or S chart |
| Modal-size subgroup means | only subgroups whose size equals the modal size \(n^{*}\); a subgroup of any other size empties its slot | \(\hat{\sigma}_{\bar{x}}\), the standard deviation of the subgroup means, which sets the individuals and moving range limits on that chart and drives the between-subgroup decomposition |
| Deviations from the part mean | each value minus the mean of its part, over the whole chart, over one part, or over one run, depending on the selected sigma scope | the sigma estimate of a Z-MR chart |
| Standardized values | the \(z\) values inside one run, never crossing a run boundary | the plotted moving range panel of a Z-MR chart |
| Successive absolute differences | consecutive raw values, window length fixed at \(2\), with no unbiasing constant applied | the objective minimized when a Box-Cox transformation is fitted for an individuals chart |
The second and third series matter separately: whenever subgroup sizes are unequal, the moving ranges that are plotted (built from every subgroup mean) are not the same set of numbers as the moving ranges that set the limits (built from the modal-size means only).
The panel's lines then follow the general moving range form below. Read \(\hat{\sigma}\) in it as \(\hat{\sigma}_{\bar{x}}\), the standard deviation of the subgroup means, and not as the within-subgroup sigma:
A moving range panel is a dispersion chart, so its lines come from the within sigma and the range constants evaluated at the moving range length \(L\), never at a subgroup size:
All three lines are level across the chart, because \(L\) is the same at every point. The lower limit is floored at zero, since a range cannot be negative; at the default \(k = 3\) and \(L = 2\) the unfloored multiplier is negative, so the lower limit is exactly \(0\) and only the upper limit can be exceeded. The zone lines are placed from the unfloored lower limit and are then floored at zero themselves.
The center line depends on how the within sigma was estimated. With the average moving range, \(\hat{\sigma} = \overline{MR}/d_2(L)\), so \(\text{CL}_{MR} = \overline{MR}\) exactly. With the median moving range, \(\hat{\sigma} = \widetilde{MR}/d_4(L)\), so \(\text{CL}_{MR} = d_2(L)\,\widetilde{MR}/d_4(L)\), which is deliberately not the median of the moving ranges. When no within sigma can be estimated, the center line and both limits are undrawn and the points plot without a band.
Full details: Moving Ranges.
So on this chart the center line is \(\text{CL}_{MR} = d_2(L)\,\hat{\sigma}_{\bar{x}}\), and because the aggregation on subgrouped data is always the average moving range, that equals \(\overline{MR}_{\bar{x}}\) exactly. The median form in the block above cannot be reached from this dialog. At the fixed \(L = 2\) and the default \(k = 3\) the lower limit is zero, so this panel can only signal upward.
Within-subgroup sigma¶
The three radio buttons in the Estimate Sigma group estimate \(\hat{\sigma}_{\text{within}}\), and one value is estimated once for the whole chart (once per phase when the chart is split). This estimate draws the bottom panel and feeds the between-subgroup decomposition. It does not draw the two panels above it.
Rbar (average range), the default:
\(R_i\) is the range of subgroup \(i\), \(n_i\) its size, and \(n_{\text{sub}}\) the number of subgroups with at least two observations. Each subgroup's unbiased range estimate \(R_i/d_2(n_i)\) is combined with the minimum-variance weights \(f_i\) (subgroups whose range estimate is more precise get more weight). The unbiased-constants setting has no effect on this estimator: \(d_2\) is always applied.
This is not the textbook \(\overline{R}/d_2\) estimator. When every subgroup has the same size \(n\) all of the weights are equal and the expression collapses to \(\overline{R}/d_2(n)\), the familiar average range over \(d_2\). When the subgroup sizes differ it does not: each subgroup is weighted by the precision of its own range, so a hand calculation of \(\overline{R}/d_2\) from a mixed-size data set will not reproduce the reported value.
Sbar (average standard deviation):
With Use unbiased constants (within sigma) checked (the default):
\(s_i\) is the sample standard deviation of subgroup \(i\) (with the \(n_i - 1\) denominator) and \(h_i\) the minimum-variance weight. With the unbiased-constants box unchecked, the estimate is the plain average of the subgroup standard deviations:
The unchecked form applies no \(c_4\) at all and weights every subgroup equally, so with unequal subgroup sizes a subgroup of two observations counts as much as a subgroup of twenty five.
Pooled standard deviation:
When Use unbiased constants (within sigma) is checked (the default), the pooled estimate is divided by \(c_4(\nu + 1)\), where \(\nu = \sum_i (n_i - 1)\) is the pooled degrees of freedom:
Full details, including the degrees of freedom each estimator carries: Process Sigma Estimation.
This is the only chart that offers all three. The Use unbiased constants (within sigma) checkbox has no effect on Rbar, which always applies \(d_2\), which is why it is greyed out at the default setting; under Sbar it switches the estimator entirely, and under the pooled estimator it divides by \(c_4(\nu + 1)\), as shown in the blocks above.
Center line and limits on the bottom panel¶
A dispersion panel does not sit at a fixed distance from a center line: its limits are multiples of its own center line, and those multiples are built from the constants and the sigma multiplier.
A dispersion panel (a range, moving range, or standard deviation chart) places its limits at multiples of its own center line, and those multiples are built from the constants above with the chart's sigma multiplier \(k\). For a range or moving range panel:
A standard deviation panel is built the same way from the \(c\) constants, at \(1 - k\,c_5/c_4\) and \(1 + k\,c_5/c_4\) times its center line. Those two multiples are the ones conventionally tabulated as \(B_3\) and \(B_4\); Quantum XL computes them directly from \(c_4\) and \(c_5\) rather than reading a named factor. In both cases the lower multiple is floored at \(0\), because neither a range nor a standard deviation can be negative, and \(k\) is the multiplier the chart is drawn with rather than a fixed \(3\).
Under Rbar or the pooled standard deviation the bottom panel is a Range Chart:
On a range panel the center line is a function of the subgroup size, so the center line steps as well as the limits:
The multipliers in parentheses are the \(D_4\) and \(D_3\) factors evaluated at \(n_i\). The lower limit is floored at zero, because a range cannot be negative; the zone lines are placed from the unfloored lower limit and then floored themselves.
A moving range panel uses this same form with the moving range length \(L\) in place of \(n_i\). That length is a single setting rather than a property of each point, so those three lines come out flat.
Under Sbar the bottom panel is an S Chart instead:
On a standard deviation panel the center line is a function of the subgroup size, so the center line steps as well as the limits:
The multipliers in parentheses are the \(B_4\) and \(B_3\) factors evaluated at \(n_i\). The lower limit is floored at zero, because a standard deviation cannot be negative; the zone lines are placed from the unfloored lower limit and then floored themselves.
This panel has one extra behavior: its center line steps only while unbiased constants are in use. With the within-sigma unbiasing option cleared the center line is the flat \(\hat{\sigma}_{\text{within}}\) at every point, while the limits still step, so the band becomes visibly asymmetric about a straight center line.
Full details: Varying Subgroup Size Limits and Control Chart Constants.
Two consequences are worth stating plainly. This panel's center line is not the average of the plotted ranges or of the plotted standard deviations: it is the value expected from a subgroup of size \(n_i\) given the estimated within-subgroup sigma, which is why it steps when the subgroup sizes differ. And the lower limit is floored at zero, so on small subgroups, where the lower multiple would be negative, there is no lower limit to fall below and the panel can only signal upward.
Between-subgroup sigma¶
This chart is the only one that lets you supply a between-subgroup mean and standard deviation, so the decomposition behind those two boxes belongs here. It starts from the same \(\hat{\sigma}_{\bar{x}}\) that draws the top two panels:
The between-subgroup standard deviation starts from \(\hat{\sigma}_{\bar{x}}\), the standard deviation of the subgroup means, and removes the part of it that within-subgroup variation already explains:
The result is floored at zero, so the between sigma is reported as zero whenever the subgroup means vary no more than within-subgroup variation alone would explain. When that floor is reached the within-and-between sigma equals the within sigma exactly.
Full details: Process Sigma Estimation.
Because the three quantities are tied together by those two equations, supplying one of them redefines another. A supplied within sigma back-solves the between sigma from the data, and a supplied between sigma back-solves \(\hat{\sigma}_{\bar{x}}\), which moves the limits on the Individuals and Moving Range panels. A supplied sigma of any kind carries no degrees of freedom, so it gets no confidence interval in the capability output.
When a point is left blank¶
A point is plotted only when its statistic exists:
- A range or a standard deviation needs at least two observations. When \(n_i < 2\) the dispersion point is left unplotted and receives no center line, no limits, and no zones, so the panel shows a break at that position.
- A mean needs at least one observation. A subgroup with no observations at all is unplotted on every panel.
- A subgroup of size one contributes nothing to the within sigma, but it still contributes its value to the grand mean and it still consumes one position of the baseline window used to estimate the limits.
Full details: Varying Subgroup Size Limits.
On an I-MR-R/S chart two cases are worth expecting. A subgroup that ended up with one usable value plots its mean on the Individuals panel and leaves a gap on the bottom panel. And a subgroup whose size differs from the modal size is plotted everywhere it has a statistic, but it is skipped by \(\hat{\sigma}_{\bar{x}}\) and it breaks the chain of consecutive means that estimate feeds on. A gap also breaks any run the out-of-control tests were counting.
Sigma zones¶
The zone lines, and the four out-of-control tests that read them, are placed by cutting the drawn band into thirds on each side. The sigma multiplier does not enter the calculation.
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.
Full details, including what the labels "1 sigma" and "2 sigma" really mean at a multiplier other than \(3\): Control Limits and Zones.
So on an I-MR-R/S chart drawn at the default \(k = 3\) the zone lines on the Individuals panel sit at one and two multiples of \(\hat{\sigma}_{\bar{x}}\) as their labels say. Only that panel matters for the labels in practice, since rules 5 through 8 are the tests that read the zones and they run on the location panel only.
Baseline and split limits¶
Neither of these changes the formulas above; both change which subgroups the sums run over.
Estimate Limits From restricts every estimate to the first \(N\) subgroups and then extends the resulting center lines and limits across the whole chart. On this chart the minimum is 5 subgroups, the window advances past blank subgroups and excluded outliers rather than spending a slot on them, and the plotted values, the minimum, the maximum, and the counts are always computed from all of the data. Formulas: Baseline and Limit Estimation.
Split Control Limits divides the chart into phases and re-runs the whole estimation inside each one, so each phase gets its own grand mean, its own \(\hat{\sigma}_{\bar{x}}\), its own within-subgroup sigma, its own limits on all three panels, and its own zone lines, and every out-of-control run counter restarts at the boundary. The moving range chain restarts at each boundary too, so the first position of every phase on the middle panel is unplotted. A baseline count is reused inside each phase, capped at that phase's length. One transformation is fitted for the whole chart rather than one per phase. Formulas: 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\) and \(d_3\) at the moving range length and at each subgroup size, \(c_4\) and \(c_5\) when the bottom panel is an S Chart, and the \(D_3\), \(D_4\), \(B_3\), \(B_4\) multiples | Control Chart Constants |
| Process sigma estimation | the standard deviation of the subgroup means, the Rbar, Sbar and pooled within estimates, and the between decomposition | Process Sigma Estimation |
| Moving ranges | the construction of the moving range of the means, and the lines on that panel | Moving Ranges |
| Control limits and zones | the general limit form, the zone construction, and the manual and disabled limit types | Control Limits and Zones |
| Varying subgroup size limits | the stepped center line and limits of the bottom panel, and the blanking rules | Varying Subgroup Size Limits |
| Baseline and limit estimation | what Estimate Limits From restricts, and what it does not | Baseline and Limit Estimation |
| Splits and phases | per-phase estimation and the run counters restarting | Splits and Phases |
| Out-of-control rules | flagging out-of-control points on all three panels | Out-of-Control Rules |
What this chart contributes of its own is not an equation but a wiring: the standard deviation of the subgroup means, which is an intermediate quantity everywhere else, is here the sigma that draws the top two panels, while the within-subgroup sigma that draws the bottom panel never touches them.
See Also¶
References¶
- 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.
- Duncan, A. J. (1986). Quality Control and Industrial Statistics (5th ed.). Irwin.
- Shewhart, W. A. (1931). Economic Control of Quality of Manufactured Product. Van Nostrand.