Process monitoring

Rational Subgrouping for X̄-R Charts: How the Choice of Subgroup Sets the Limits

Kitstead Labs · Engineering reference · Synthetic worked example

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.

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:

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

Plan A: removal torque of one cap from each of the four heads each hour, with the subgroup mean and range
HourHead 1Head 2Head 3Head 4X̄R
111.6111.8411.9312.5211.97500.91
211.6912.2712.1112.1012.04250.58
311.4112.0111.7912.5611.94251.15
411.3711.7112.3912.2511.93001.02
511.3711.8911.9612.6811.97501.31
611.2211.8912.3812.2011.92251.16
711.1911.6212.2012.5311.88501.34
811.5611.7412.2712.5912.04001.03
911.4812.0212.0312.4311.99000.95
1011.6311.9112.2612.4912.07250.86
1111.1911.7711.9712.3311.81501.14
1211.2612.0012.5512.8112.15501.55
1311.4911.9212.1012.2811.94750.79
1411.5912.0111.8912.2911.94500.70
1511.2811.5912.1012.1311.77500.85
1611.7211.7111.9012.4911.95500.78
1712.3712.5512.6712.9012.62250.53
1811.7411.7312.0012.4011.96750.67
1911.9812.2512.0511.9112.04750.34
2011.0111.6711.7812.3711.70751.36
2111.7011.9812.3812.4012.11500.70
2211.7812.1911.9912.3612.08000.58
2311.8511.8412.2812.5712.13500.73
2411.1811.7412.3012.2011.85501.12
2511.4012.0011.9012.1811.87000.78

Plan B: four consecutive caps from head 1 per hour

Plan B: removal torque of four consecutive caps from head 1 each hour, with the subgroup mean and range
HourCap 1Cap 2Cap 3Cap 4X̄R
111.6411.2011.8911.5111.56000.69
211.4311.5611.3411.5711.47500.23
311.9511.5011.4711.1411.51500.81
411.5511.2411.4311.4111.40750.31
511.5311.0711.6511.7811.50750.71
611.4012.0511.7011.5311.67000.65
711.3111.4411.3711.2811.35000.16
811.6311.8111.5911.5511.64500.26
911.2511.3811.5211.6311.44500.38
1011.5311.5211.2611.6911.50000.43
1111.5311.9211.6611.7111.70500.39
1211.6711.9511.2411.4411.57500.71
1311.6711.9811.4911.6711.70250.49
1411.7811.5311.5911.6511.63750.25
1511.9311.4511.6411.6011.65500.48
1611.5411.1611.1111.5911.35000.48
1711.4812.0511.9912.0811.90000.60
1811.6111.3911.2911.7111.50000.42
1911.3911.4011.5511.5311.46750.16
2011.6511.4111.3811.3311.44250.32
2111.5911.7011.4311.8711.64750.44
2211.4311.8211.9811.6911.73000.55
2311.3911.6911.7311.3111.53000.42
2411.7911.6711.5411.2511.56250.54
2511.5111.4011.5911.3611.46500.23

Each table, pasted into the Subgroup Control Chart Calculator as an X̄-R chart with one row of four values per hour, gives:

Average and range chart results for the two sampling plans from the Subgroup Control Chart Calculator
QuantityPlan A (across heads)Plan B (within head 1)
Center line X̿11.990711.5578
Average range R̄0.91720.4444
Estimated sigma R̄/d₂0.44550.2159
X̄ limits11.3224 to 12.659011.2340 to 11.8816
R chart limits0 to 2.09310 to 1.0141
Subgroup means outside the X̄ limitsNoneHour 17 (11.9000)
Plan A: one cap from each of four heads 11.2 11.4 11.6 11.8 12.0 12.2 12.4 12.6 12.8 1 5 10 15 20 25 UCL 12.6590 +1σ CL 11.9907 −1σ LCL 11.3224 Hour 17: inside UCL Plan B: four consecutive caps from head 1 11.2 11.4 11.6 11.8 12.0 12.2 12.4 12.6 12.8 1 5 10 15 20 25 UCL 11.8816 CL 11.5578 LCL 11.2340 Hour 17: above UCL Mean torque (N·m) Hour
Subgroup means for the same 25 hours under the two sampling plans, on the same torque scale, each with its own center line and control limits. Plan A's limits are 2.06 times as wide and 23 of its 25 means lie within one sigma of its center line; plan B's mean for hour 17 falls above its upper limit.

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.

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

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