Method · Statistics Library

X-bar-R chart (subgroup means and ranges)

The X-bar-R chart is the classic pairing for small rational subgroups: the top X-bar chart tracks subgroup means (is the process centered?) while the bottom R chart tracks subgroup ranges (is the process's spread stable?), using the subgroup range to estimate variation.

Topic indexA reference reading outside the guided chapter sequence

Understand the idea

When you can pull a small handful of units made under the same conditions (five parts off the line in the same hour, say), you get two pieces of information from each 'rational subgroup': where its average sits, and how spread out its members are. The X-bar chart plots the averages over time to catch the process drifting off target; the R chart plots each subgroup's range (biggest minus smallest) to catch the process becoming more erratic.

There is an important dependency between the two: the X-bar chart's control limits (the upper and lower lines marking how far the plotted values normally wander) are built using the AVERAGE range across all subgroups, so if the spread itself is unstable, the X-bar limits built on top of it cannot be trusted either. That is why you check the R chart first. But here is the subtlety many people miss: a clean R chart does NOT automatically mean the X-bar limits are fine. A pure shift in where the process is CENTERED leaves the ranges completely untouched while still contaminating the grand average the X-bar limits are built around, so 'check the R chart first' clears one problem, not both.

As with any first-built chart, these are TRIAL limits: they were computed from the very data they are judging, so a genuine problem subgroup in that data distorts the limits meant to catch it. The standard practice is to find and remove subgroups with an identified assignable cause (a specific, findable reason such as a worn tool or a new batch of material), recompute, and repeat until what remains looks stable; only then are the limits ready to monitor future production.

An X-bar R chart is a means and ranges chart: the X-bar part, the classic Shewhart X-bar chart, plots each subgroup's average, and the R part plots each subgroup's range.

Practitioner explanation

KernelStats computes the grand mean x-double-bar (mean of subgroup means) and R-bar (mean of subgroup ranges), with X-bar limits x-double-bar +/- A2*R-bar and R-chart limits CL=R-bar, UCL=D4*R-bar, LCL=D3*R-bar, using the standard tabulated SPC constants A2/D3/D4/d2 indexed by subgroup size n. Subgroups come from a Subgroup column (text or numeric: batch, hour, shift, machine) or, with that column left blank, from a 'Subgroup size' of 2 or more that cuts consecutive rows into fixed-size subgroups; the size field is blank by default, one of the two is required, and when both are given the column wins and the card says the size was ignored, the same rule on every Quality form. Because every constant is indexed by n, ALL charted subgroups must share the SAME size: a blank or non-numeric cell is dropped and the card lists the table rows it dropped, a subgroup left with fewer than two usable readings is excluded and named (a range needs two points), a trailing chunk that never filled a whole subgroup is dropped and named as your most recent readings, and subgroups that are still of unequal size are refused with a message naming the short subgroups and the rows behind them rather than silently charted with a mismatched constant. Above the tabulated subgroup-size ceiling, the card refuses and directs the analyst to the X-bar-S chart, which does not share this limitation.

Only Rule 1 (beyond 3-sigma) and Rule 2 (a run of 8 on one side of center) are applied, and Rule 2 is applied ONLY to the X-bar panel; the R panel uses Rule 1 alone. KernelStats deliberately does not implement the full Western Electric/Nelson rule set (zone rules, 2-of-3 beyond 2-sigma, and similar), which is stated plainly: a clean chart here means 'no Rule-1 or Rule-2 signal', not 'no pattern of any kind'; a slow drift that never crosses 3 sigma and never strings together 8 consecutive points on one side passes both tests undetected.

The masking effect from trial (Phase I) limits is described specifically for this chart: one unusually high subgroup pulls the grand mean up, which shifts BOTH X-bar limits upward, and can push an entirely ordinary low subgroup below the now-elevated LCL, flagging a problem it does not actually have. If that same bad subgroup is also more variable, it inflates R-bar too, widening every limit and potentially hiding smaller, genuine signals elsewhere in the series. KernelStats documents the standard iterative Phase-I cleaning procedure (find assignable causes, remove, recompute, repeat) but does not automate it; it is a workflow the analyst carries out.

When to use it

Consider it when

Rational subgroups of a small, constant size (typically n <= 10) can be formed (several consecutive units made under the same conditions), and both the process mean and its short-term spread need monitoring.

Use caution when

Subgroup size exceeds about 10 (the range becomes a less efficient estimator of spread than the standard deviation; use X-bar-S instead), subgroups cannot be made a constant size, or there is no natural way to group readings into rational subgroups at all (use an I-MR chart on individual readings).

Formulas and symbols

X-bar chart limits

CL=xˉˉ,UCL/LCL=xˉˉ±A2RˉCL = \bar{\bar x}, \qquad UCL/LCL = \bar{\bar x} \pm A_2 \bar R

x-double-bar the grand mean of subgroup means; R-bar the mean of subgroup ranges; A2 the tabulated SPC constant for subgroup size n.

R chart limits

CL=Rˉ,UCL=D4Rˉ,LCL=D3RˉCL = \bar R, \qquad UCL = D_4 \bar R, \qquad LCL = D_3 \bar R

D3, D4 the tabulated SPC constants for subgroup size n; LCL is 0 for n <= 6.

Estimated process sigma

σ^=Rˉd2\hat\sigma = \dfrac{\bar R}{d_2}

d2 the tabulated bias-correction constant for subgroup size n.

Assumptions and checks

  • Independence of observations. Autocorrelated subgroup means make the X-bar chart's limits wrong: with positive autocorrelation the means wander more from subgroup to subgroup than the within-subgroup range predicts, so the limits are too tight and false alarms multiply, while negative autocorrelation can mask a real shift or alternating pattern.

    In KernelStats: Ljung-Box lag-1 test on the subgroup means, reported directly on the card as an 'Independence & rational ordering' check; not testable on fewer than 8 subgroups or a zero-variance series, which the card states honestly rather than fabricating a verdict.

  • Normality (of residuals, not of the raw data). X-bar chart limits assume the subgroup means are normal; with reasonably sized subgroups the Central Limit Theorem makes this fairly robust even when individual values are non-normal, but small subgroups (n = 2-3) of strongly skewed data can still distort the true false-alarm rate, and the companion R chart's own limits assume the underlying individual values are normal.

    In KernelStats: Not checked by KernelStats: no normality test is run on the subgroup means or the raw data.

Alternatives

  • X̄-S Chart (Means & Std Devs). Subgroup size exceeds about 10, or you simply want the more statistically efficient standard-deviation-based estimate of within-subgroup spread that uses every observation rather than just the min and max.
  • I-MR Chart (Individuals & Moving Range). There is no natural way to form rational subgroups: readings arrive one at a time.

Worked example

Scenario

25 hourly subgroups of 5 shaft-diameter measurements each, one subgroup containing a known tooling malfunction.

Result

x-double-bar = 25.002mm, R-bar = 0.018mm, X-bar limits 25.002 +/- 0.577 x 0.018 = [24.992, 25.012], R-chart UCL = 0.038mm; the malfunction subgroup's mean falls just above the X-bar UCL while its range stays well within the R-chart limits.

Interpretation

The signal appears only on the X-bar panel, meaning the malfunction shifted where the process was centered without making it any more erratic within that hour, which is why a clean R chart cannot be read as a clean process: checking only the R chart would have missed this.

Common misconceptions

Misconception

If the R chart is clean (in control), the X-bar chart's limits can automatically be trusted too.

Correction

A clean R chart only confirms that within-subgroup SPREAD is stable, which is a necessary but not sufficient condition. A pure shift in process CENTERING leaves subgroup ranges completely unaffected (each subgroup is still equally spread out, just shifted) while still distorting the grand mean the X-bar limits are built around. Checking the R chart first rules out one contamination source, not both.

Misconception

The limits computed on the very first X-bar-R chart you build are the final limits to use going forward.

Correction

Phase I limits are computed from the SAME subgroups they judge, so an assignable-cause subgroup already present in that data distorts the very limits meant to catch it (the masking effect: it can pull the grand mean and widen the range enough to hide genuine problems elsewhere or manufacture false flags on ordinary subgroups). The standard practice is to identify and remove such subgroups, recompute, and repeat until the retained data is stable; only those final limits should monitor future production.

Read more: Misconception: control limits and specification limits are the same thing

References

  1. NIST/SEMATECH e-Handbook of Statistical Methods, §6.3.2 Shewhart control charts, NIST/SEMATECH (2012), §6.3.2.
  2. Introduction to Statistical Quality Control, Montgomery, D. C. (2019), §6.4.