Process monitoring
Rational Subgrouping for X̄-R Charts: How the Choice of Subgroup Sets the Limits
An X̄-R chart takes its limits from the variation inside the subgroups, so the limits are only as good as the choice of what goes into a subgroup. This guide explains what a subgroup is for, the two ways to get the choice wrong, and works one example in which the same capping machine, sampled two ways over the same 25 hours, gives limits about twice as wide in one plan as in the other, and only the narrower plan catches a real shift. Both plans can be checked in the site's Subgroup Control Chart Calculator.
Quick answer
The range inside each subgroup sets the limits for the differences between subgroups. That works only if the values in a subgroup were taken under essentially the same conditions, so that they differ by routine variation alone. If a subgroup mixes sources that differ systematically, such as the heads of a multi-head filler or the cavities of a mold, those differences go into the ranges, which can inflate the limits, crowd the subgroup means toward the center line and let real shifts pass inside the limits. If instead each subgroup is taken under one condition while the conditions change between subgroups, the limits leave no room for that change and the chart can signal the differences between conditions. The remedy in both cases is to change how the data are grouped, not the formulas. In the worked example, one cap from each of four heads per hour gives an estimated sigma 2.06 times that of four consecutive caps from one head, and only the second plan flags the hour in which every head ran high.
What a subgroup is for
An X̄-R chart asks two questions. The R chart asks whether the variation inside the subgroups is consistent; the X̄ chart asks whether the subgroups differ from one another by more than that variation would explain. Donald Wheeler, writing in Quality Digest, describes it this way: within-subgroup variation sets the limits, the average chart looks for differences between subgroups, and the range chart checks for consistency within them.
The NIST/SEMATECH e-Handbook gives the arithmetic. With subgroups of n values, the average range R̄ estimates sigma as R̄/d₂, and the X̄ limits are X̿ ± A₂R̄ with A₂ = 3/(d₂√n); the range chart has limits D₃R̄ and D₄R̄. Nothing in those formulas knows how the subgroups were formed. Whatever is inside the subgroups becomes the yardstick.
Wheeler cites Shewhart's criterion for forming subgroups: put values together only when you judge they were collected under essentially the same conditions. He sets out two conditions for a rational subgroup. The values in each subgroup should be logically homogeneous, and the variation within subgroups should be the right basis for judging the variation between them; it is not when sources of variation that are larger are present between subgroups but absent within them.
Two ways to get it wrong
Wheeler illustrates both errors with one data set: a patient's peak flow readings taken four times a day, morning and evening, before and after medication.
- Mixing conditions inside each subgroup. Making each day a subgroup of four puts readings taken under different conditions into one range. Wheeler writes that the limits will be far too wide and that the averages and ranges will sit close to their central lines. He calls this stratification.
- Grouping across the conditions you want to compare. Making each time slot a subgroup puts readings from different days but the same condition together. The limits then reflect only the day-to-day variation, make no allowance for the differences between conditions, and the chart will show them as out of control. Wheeler calls this inappropriate unless documenting those differences is the purpose.
In both cases, he writes, the remedy is to change the subgrouping, not the computations.
Minitab's documentation ties the first error to one of its tests for special causes. Test 7, fifteen points in a row within one sigma of the center line, detects control limits that are too wide, and Minitab notes that too-wide limits are often caused by stratified data, where a systematic source of variation is present within each subgroup. When it is unclear which tests apply to a variables chart, Minitab suggests trying Tests 1, 2 and 7 while the limits are being established, and says Test 7 is no longer needed once the limits are set and used as known values; it is offered on the X̄ chart but not on the R chart. The control chart run rules guide gives the chance of Test 7's pattern for independent normal points with known mean and sigma, 0.326 % for any one window of fifteen points.
Worked example: one capper, two sampling plans
The data below are synthetic. They represent the removal torque, in N·m, of caps from a four-head capping machine over 25 hours. The heads differ systematically: they were set to average 0.45 and 0.15 N·m below and 0.15 and 0.45 N·m above 12.00 N·m, and within each head the caps vary with a standard deviation of 0.20 N·m. In hour 17 every head was made to run 0.45 N·m high, to represent a real shift. Values were drawn from normal distributions and rounded to 0.01 N·m. Two sampling plans were drawn from the same generator, hour by hour:
- Plan A: each hour, one cap from each of the four heads. This is a common plan, because it covers every head.
- Plan B: each hour, four consecutive caps from head 1.
The random seed was the first, counting up from 1, for which plan A shows no point outside its X̄ or R limits and fires Test 7, and plan B flags hour 17 alone; that was seed 1.
Plan A: one cap from each head per hour
| Hour | Head 1 | Head 2 | Head 3 | Head 4 | X̄ | R |
|---|---|---|---|---|---|---|
| 1 | 11.61 | 11.84 | 11.93 | 12.52 | 11.9750 | 0.91 |
| 2 | 11.69 | 12.27 | 12.11 | 12.10 | 12.0425 | 0.58 |
| 3 | 11.41 | 12.01 | 11.79 | 12.56 | 11.9425 | 1.15 |
| 4 | 11.37 | 11.71 | 12.39 | 12.25 | 11.9300 | 1.02 |
| 5 | 11.37 | 11.89 | 11.96 | 12.68 | 11.9750 | 1.31 |
| 6 | 11.22 | 11.89 | 12.38 | 12.20 | 11.9225 | 1.16 |
| 7 | 11.19 | 11.62 | 12.20 | 12.53 | 11.8850 | 1.34 |
| 8 | 11.56 | 11.74 | 12.27 | 12.59 | 12.0400 | 1.03 |
| 9 | 11.48 | 12.02 | 12.03 | 12.43 | 11.9900 | 0.95 |
| 10 | 11.63 | 11.91 | 12.26 | 12.49 | 12.0725 | 0.86 |
| 11 | 11.19 | 11.77 | 11.97 | 12.33 | 11.8150 | 1.14 |
| 12 | 11.26 | 12.00 | 12.55 | 12.81 | 12.1550 | 1.55 |
| 13 | 11.49 | 11.92 | 12.10 | 12.28 | 11.9475 | 0.79 |
| 14 | 11.59 | 12.01 | 11.89 | 12.29 | 11.9450 | 0.70 |
| 15 | 11.28 | 11.59 | 12.10 | 12.13 | 11.7750 | 0.85 |
| 16 | 11.72 | 11.71 | 11.90 | 12.49 | 11.9550 | 0.78 |
| 17 | 12.37 | 12.55 | 12.67 | 12.90 | 12.6225 | 0.53 |
| 18 | 11.74 | 11.73 | 12.00 | 12.40 | 11.9675 | 0.67 |
| 19 | 11.98 | 12.25 | 12.05 | 11.91 | 12.0475 | 0.34 |
| 20 | 11.01 | 11.67 | 11.78 | 12.37 | 11.7075 | 1.36 |
| 21 | 11.70 | 11.98 | 12.38 | 12.40 | 12.1150 | 0.70 |
| 22 | 11.78 | 12.19 | 11.99 | 12.36 | 12.0800 | 0.58 |
| 23 | 11.85 | 11.84 | 12.28 | 12.57 | 12.1350 | 0.73 |
| 24 | 11.18 | 11.74 | 12.30 | 12.20 | 11.8550 | 1.12 |
| 25 | 11.40 | 12.00 | 11.90 | 12.18 | 11.8700 | 0.78 |
Plan B: four consecutive caps from head 1 per hour
| Hour | Cap 1 | Cap 2 | Cap 3 | Cap 4 | X̄ | R |
|---|---|---|---|---|---|---|
| 1 | 11.64 | 11.20 | 11.89 | 11.51 | 11.5600 | 0.69 |
| 2 | 11.43 | 11.56 | 11.34 | 11.57 | 11.4750 | 0.23 |
| 3 | 11.95 | 11.50 | 11.47 | 11.14 | 11.5150 | 0.81 |
| 4 | 11.55 | 11.24 | 11.43 | 11.41 | 11.4075 | 0.31 |
| 5 | 11.53 | 11.07 | 11.65 | 11.78 | 11.5075 | 0.71 |
| 6 | 11.40 | 12.05 | 11.70 | 11.53 | 11.6700 | 0.65 |
| 7 | 11.31 | 11.44 | 11.37 | 11.28 | 11.3500 | 0.16 |
| 8 | 11.63 | 11.81 | 11.59 | 11.55 | 11.6450 | 0.26 |
| 9 | 11.25 | 11.38 | 11.52 | 11.63 | 11.4450 | 0.38 |
| 10 | 11.53 | 11.52 | 11.26 | 11.69 | 11.5000 | 0.43 |
| 11 | 11.53 | 11.92 | 11.66 | 11.71 | 11.7050 | 0.39 |
| 12 | 11.67 | 11.95 | 11.24 | 11.44 | 11.5750 | 0.71 |
| 13 | 11.67 | 11.98 | 11.49 | 11.67 | 11.7025 | 0.49 |
| 14 | 11.78 | 11.53 | 11.59 | 11.65 | 11.6375 | 0.25 |
| 15 | 11.93 | 11.45 | 11.64 | 11.60 | 11.6550 | 0.48 |
| 16 | 11.54 | 11.16 | 11.11 | 11.59 | 11.3500 | 0.48 |
| 17 | 11.48 | 12.05 | 11.99 | 12.08 | 11.9000 | 0.60 |
| 18 | 11.61 | 11.39 | 11.29 | 11.71 | 11.5000 | 0.42 |
| 19 | 11.39 | 11.40 | 11.55 | 11.53 | 11.4675 | 0.16 |
| 20 | 11.65 | 11.41 | 11.38 | 11.33 | 11.4425 | 0.32 |
| 21 | 11.59 | 11.70 | 11.43 | 11.87 | 11.6475 | 0.44 |
| 22 | 11.43 | 11.82 | 11.98 | 11.69 | 11.7300 | 0.55 |
| 23 | 11.39 | 11.69 | 11.73 | 11.31 | 11.5300 | 0.42 |
| 24 | 11.79 | 11.67 | 11.54 | 11.25 | 11.5625 | 0.54 |
| 25 | 11.51 | 11.40 | 11.59 | 11.36 | 11.4650 | 0.23 |
Each table, pasted into the Subgroup Control Chart Calculator as an X̄-R chart with one row of four values per hour, gives:
| Quantity | Plan A (across heads) | Plan B (within head 1) |
|---|---|---|
| Center line X̿ | 11.9907 | 11.5578 |
| Average range R̄ | 0.9172 | 0.4444 |
| Estimated sigma R̄/d₂ | 0.4455 | 0.2159 |
| X̄ limits | 11.3224 to 12.6590 | 11.2340 to 11.8816 |
| R chart limits | 0 to 2.0931 | 0 to 1.0141 |
| Subgroup means outside the X̄ limits | None | Hour 17 (11.9000) |
Reading the two charts
Plan A's sigma includes the head-to-head differences. The heads' set averages span 0.90 N·m, and every plan A subgroup contains one cap from each head, so each range reflects the differences between heads as well as the variation within a head; the plan A ranges run from 0.34 to 1.55 N·m. The estimated sigma, 0.4455 N·m, is 2.06 times plan B's 0.2159 and more than twice the 0.20 N·m the caps from any one head actually vary by. The X̄ limits are 2.06 times as wide.
Plan A's means sit close to the center line. With one sigma of the X̄ chart at A₂R̄/3 = 0.2228 N·m, 23 of the 25 hourly means lie within one sigma of the center line, and hours 1 to 15 and 2 to 16 each form a run of fifteen within one sigma, so Test 7 signals at hours 15 and 16. That is the pattern Wheeler and Minitab describe for stratified data.
Plan A misses the shift; plan B catches it. In hour 17 plan A's mean is 12.6225 N·m, 0.0365 N·m below its upper limit of 12.6590. Plan B's mean in the same hour is 11.9000 N·m, above its upper limit of 11.8816. No other subgroup mean or range falls outside its limits on either chart.
Plan B has its own limit: it watches only head 1. A problem confined to heads 2, 3 or 4 would not reach it, and the head-to-head differences that plan A mixes into its ranges are not measured at all. Plan B shows what a rational subgroup does for the limits; it is not by itself a complete sampling plan for a four-head machine.
Choosing subgroups when there are several heads or cavities
The free sources above set out the principle but do not prescribe a plan for multi-stream processes. The options below follow from that principle; which one fits depends on what each stream costs to sample and which differences matter.
- One chart per head. Take the subgroup from consecutive parts of one head, and keep a chart for each head. Each chart's limits then reflect that head's own variation, and a change on any head can show on its chart.
- Rotate the head. Sample one head per hour in turn, and chart each head's subgroups separately. This costs a quarter of the sampling of four charts, at the price of seeing each head once every four hours.
- Watch the head differences separately. If the differences between heads matter, compare the head averages directly, for example with a designed comparison or a periodic study, instead of letting them sit inside the ranges of a combined chart.
Whatever the plan, write down what goes into a subgroup and why before the data are collected, and keep the same rule for the life of the chart.
X̄-R or X̄-s
The choice of statistic matters much less than the choice of subgroup. The e-Handbook notes that the range is quite satisfactory up to subgroups of about ten and that subgroup standard deviations are preferable for larger ones; it tabulates the efficiency of the range relative to s/c₄ as 0.975 at n = 4, 0.955 at n = 5 and 0.850 at n = 10. For plan B, the X̄-s chart in the calculator gives X̄ limits of 11.2404 to 11.8752, against 11.2340 to 11.8816 from the range, and flags the same hour. Run on plan A, the standard deviation gives similarly wide limits, 11.3342 to 12.6472 against 11.3224 to 12.6590 from the range, because both measure the same mixed subgroups.
Common mistakes
- Taking one part from each head, cavity or nozzle and calling it a subgroup. It is convenient and it covers every stream, but the stream differences go into R̄ and can make the chart insensitive to shifts.
- Reading points that hug the center line as excellent control. On an X̄-R chart, fifteen means in a row within one sigma usually say the limits are too wide.
- Fixing the limits instead of the subgroups. Narrowing limits by hand, or switching from R to s, leaves the yardstick contaminated.
- Treating signals from inappropriate subgroups as process changes. If each subgroup holds one condition and the conditions alternate, the chart can signal the differences between conditions rather than a change within either condition.
- Changing the subgrouping rule partway through. Limits set under one rule do not apply to subgroups formed under another.
Using the tools with this guide
The Subgroup Control Chart Calculator computes X̄-R and X̄-s limits from pasted subgroups and lists the subgroups outside them; it applies single-point tests only, so Test 7 and the other run rules are checked by hand, with the zone lines one third and two thirds of the way to each limit. Which control chart for which data covers when a subgroup chart is the right chart, Control chart constants lists d₂, A₂, D₃, D₄ and c₄, and Control chart run rules covers Test 7 and the other tests.
Sources and further reading
- Wheeler, D. J., What Is a Rational Subgroup?, Quality Digest, October 1997 — the two conditions for a rational subgroup, stratification and inappropriate subgrouping, and the remedy.
- Wheeler, D. J., Good Limits From Bad Data (Part III), Quality Digest, May 1997 — Shewhart's criterion for subgroups and what the average and range charts each check.
- Minitab Support: Using tests for special causes in control charts — Test 7 and stratified data, and which tests apply to which charts.
- NIST/SEMATECH e-Handbook of Statistical Methods, Section 6.3.2.1, Shewhart X-bar and R and S Control Charts — the X̄-R and X̄-s limits and the efficiency of the range.
- Montgomery, D. C., Introduction to Statistical Quality Control, 7th ed., Wiley, 2013, Chapter 5 (rational subgroups and the choice between charts).
- Kitstead Labs guides: Which control chart for which data, Control chart constants, Control chart run rules.