Home / Statistical Tools / Control Charts / R / Math Details
Math Details¶
This page gives the exact formulas Quantum XL uses to build an R chart. Each equation lists what it computes and where it appears on the chart. Every formula on this page is shared with other control charts, so each block is followed by a link to the page that owns it.
An R chart is the Xbar-R chart with only its second panel drawn, so the arithmetic is the Xbar-R arithmetic. The panel of subgroup means is still computed and is simply not plotted.
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 |
| \(x_{ij}\) | the \(j\)th observation in subgroup \(i\) |
| \(R_i\) | range of subgroup \(i\), the value plotted on the Range panel |
| \(\bar{x}_i\) | mean of subgroup \(i\), computed but not plotted on this chart |
| \(\hat{\sigma}_{\text{within}}\) | estimated within-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 |
| \(\mathcal{B}\) | the baseline set of subgroups the estimates are computed from |
| \(\text{CL}_i\), \(\text{UCL}_i\), \(\text{LCL}_i\) | center line, upper and lower control limits at subgroup \(i\) |
Plotted statistic¶
The range of each subgroup is the only value plotted. It is 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 no range.
Control chart constants¶
The range constants are looked up at each subgroup's own size, so they appear in the sigma estimate, in the panel's center line, and in its limits.
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.
Within-subgroup sigma¶
This dialog offers two estimators of \(\hat{\sigma}_{\text{within}}\), and one value is estimated once for the whole chart (once per phase when the chart is split). The whole panel is built from 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.
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.
Sbar is not offered on this chart, so no average of the subgroup standard deviations is formed. The Use unbiased constants (within sigma) checkbox has no effect on Rbar, which always applies \(d_2\); under the pooled estimator it divides by \(c_4(\nu + 1)\) as shown above, where \(c_4(n)\) is the expected value of the sample standard deviation of \(n\) standard normal observations.
Center line and limits¶
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 range 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\).
Applied at each subgroup's own size, they give the panel's center line and limits:
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.
Full details: Varying Subgroup Size Limits and Control Chart Constants.
Two consequences are worth stating plainly. The center line is not the average of the plotted ranges: it is the range 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 \(k\,d_3/d_2\) exceeds \(1\), there is no lower range limit to fall below and the panel can only signal upward.
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 R chart the case to expect is a subgroup that ended up with one usable value: the panel shows a gap at that position with no point, no center line, and no limits. On the full Xbar-R chart that subgroup would still plot a mean on the panel above; here there is no panel above to plot it on. A gap also breaks any run the out-of-control tests were counting.
Sigma zones¶
The zone lines 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.
The four out-of-control tests that read these zones, rules 5 through 8, are greyed out on this variant, because they run on the location panel and this chart does not draw one. The sigma multiplier still moves the drawn band, and therefore rule 1.
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 line 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 within-subgroup sigma, its own center line, its own limits, and its own zone lines, and every out-of-control run counter restarts at the boundary. 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\) in the sigma estimate, and the \(D_3\) and \(D_4\) multiples of the panel | Control Chart Constants |
| Process sigma estimation | the Rbar and pooled estimates of the within-subgroup sigma | Process Sigma Estimation |
| 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, the limit multiples, 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 the Range panel | Out-of-Control Rules |
R contributes no formula of its own. Every equation above is one of these shared pieces evaluated for a chart of subgroup ranges.
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.