Skip to content

Home / Statistical Tools / Control Charts / Xbar-R / Math Details

Math Details

This page gives the exact formulas Quantum XL uses to build an Xbar-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.

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\)
\(\bar{x}_i\) mean of subgroup \(i\), the value plotted on the Xbar panel
\(R_i\) range of subgroup \(i\), the value plotted on the Range panel
\(\bar{\bar{x}}\) grand mean, the center line of the Xbar panel
\(\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}\), \(\text{UCL}_i\), \(\text{LCL}_i\) center line, upper and lower control limits at subgroup \(i\)

Plotted statistics

\[ \bar{x}_i = \frac{1}{n_i}\sum_{j=1}^{n_i} x_{ij}, \qquad R_i = \max_{j} x_{ij} - \min_{j} x_{ij} \]

The mean goes on the Xbar panel and the range on the Range panel. Both 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 no range.

Center line of the Xbar panel

\[ \bar{\bar{x}} = \frac{\displaystyle\sum_{i \in \mathcal{B}}\;\sum_{j=1}^{n_i} x_{ij}}{\displaystyle\sum_{i \in \mathcal{B}} n_i} \]

The center line is the mean of the individual observations, not the mean of the subgroup means. The distinction only matters when the subgroups differ in size, and then it matters:

\[ \bar{\bar{x}} \;=\; \frac{1}{n_{\text{sub}}}\sum_{i} \bar{x}_i \quad \text{only when every } n_i \text{ is the same} \]

A larger subgroup supplies more observations and therefore carries more weight in the center line. Averaging the plotted points on the Xbar 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 Xbar 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

The range constants are looked up at each subgroup's own size, so they appear in the sigma estimate, in the Range panel's center line, and in its limits.

The range constants describe the distribution of the range \(R\) of \(n\) independent standard normal observations:

\[ d_2(n) = \mathrm{E}[R], \qquad d_3(n) = \sqrt{\mathrm{Var}(R)}, \qquad d_4(n) = \operatorname{median}(R) \]

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

Xbar-R 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). Both panels are built from it.

Rbar (average range), the default:

\[ \hat{\sigma}_{\text{within}} = \frac{\sum_{i=1}^{n_{\text{sub}}} f_i\, \dfrac{R_i}{d_2(n_i)}}{\sum_{i=1}^{n_{\text{sub}}} f_i}, \qquad f_i = \left(\frac{d_2(n_i)}{d_3(n_i)}\right)^{2} \]

\(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:

\[ \hat{\sigma}_{\text{within}} = \sqrt{\frac{\sum_{i=1}^{n_{\text{sub}}} (n_i - 1)\, s_i^2}{\sum_{i=1}^{n_{\text{sub}}} (n_i - 1)}} \]

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:

\[ \hat{\sigma}_{\text{within}}^{\,\text{unbiased}} = \frac{1}{c_4(\nu + 1)}\sqrt{\frac{\sum_{i} (n_i - 1)\, s_i^2}{\nu}} \]

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.

Control limits on the Xbar panel

Every limit on the chart has the same form, a center line plus or minus \(k\) standard deviations of the plotted statistic. For a chart of subgroup means that standard deviation is the standard error of a mean, so the subgroup size enters point by point and the limits are written per point:

Every quantity that divides by a subgroup size, or looks a constant up at a subgroup size, becomes a per-point quantity as soon as the sizes differ. On a chart of subgroup means the standard error uses each subgroup's own size \(n_i\):

\[ \sigma_i = \frac{\hat{\sigma}_{\text{within}}}{\sqrt{n_i}}, \qquad \text{UCL}_i = \text{CL} + k\,\sigma_i, \qquad \text{LCL}_i = \text{CL} - k\,\sigma_i \]

The band is narrow where a subgroup is large and wide where it is small, so the limits are drawn as a staircase instead of a straight pair of lines, with one step per change of size. Each point is judged against its own limits, and its zone lines are placed from its own limits. The center line does not move: it stays at the grand mean, which is the mean of the individual observations, so larger subgroups already carry more weight in it.

The within sigma itself is a single chart-wide value. It is estimated once from all of the subgroups, with the size differences already accounted for inside the estimator, and it is not re-estimated per point.

Full details: Varying Subgroup Size Limits and Control Limits and Zones.

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.

Center line and limits on the Range 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 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:

\[ D_3 = \max\!\left(0,\; 1 - k\,\frac{d_3}{d_2}\right), \qquad D_4 = 1 + k\,\frac{d_3}{d_2} \]
\[ \text{LCL} = D_3 \times \text{center}, \qquad \text{UCL} = D_4 \times \text{center} \]

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 Range 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:

\[ \text{CL}_i^{R} = d_2(n_i)\,\hat{\sigma}_{\text{within}}, \qquad \text{UCL}_i^{R} = \left(1 + k\,\frac{d_3(n_i)}{d_2(n_i)}\right)\text{CL}_i^{R}, \qquad \text{LCL}_i^{R} = \max\!\left(0,\; 1 - k\,\frac{d_3(n_i)}{d_2(n_i)}\right)\text{CL}_i^{R} \]

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 Range panel's 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 Xbar-R chart the case to expect is a subgroup that ended up with one usable value: its mean is plotted on the Xbar panel with its own limits, and the Range panel shows a gap at that position with no point, no center line, and no limits. 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:

\[ A_i^{+} = \text{CL}_i + \tfrac{2}{3}\left(\text{UCL}_i - \text{CL}_i\right), \qquad B_i^{+} = \text{CL}_i + \tfrac{1}{3}\left(\text{UCL}_i - \text{CL}_i\right) \]
\[ B_i^{-} = \text{CL}_i - \tfrac{1}{3}\left(\text{CL}_i - \text{LCL}_i\right), \qquad A_i^{-} = \text{CL}_i - \tfrac{2}{3}\left(\text{CL}_i - \text{LCL}_i\right) \]

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 Xbar-R chart drawn at the default \(k = 3\) the zone lines sit at one and two standard errors as their labels say. At any other multiplier they are still thirds of the band you asked for, which changes what tests 5 through 8 are testing.

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 grand mean, its own within-subgroup sigma, its own limits on both panels, 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 Range 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 per-point Xbar limits, the stepped Range center line, 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 both panels Out-of-Control Rules

Xbar-R contributes no formula of its own. Every equation above is one of these shared pieces evaluated for a chart of subgroup means beside a chart of subgroup ranges.

See Also

References

  1. Montgomery, D. C. (2013). Introduction to Statistical Quality Control (7th ed.). Wiley.
  2. Wheeler, D. J., and Chambers, D. S. (1992). Understanding Statistical Process Control (2nd ed.). SPC Press.
  3. Duncan, A. J. (1986). Quality Control and Industrial Statistics (5th ed.). Irwin.
  4. Shewhart, W. A. (1931). Economic Control of Quality of Manufactured Product. Van Nostrand.