Sub topic 5
Rational Subgroups: What Goes in a Sample
Assume you know how to calculate a mean and range and understand that measurements come from a process. Basic probability helps with p and u charts. The main idea in this chapter is how to group observations before calculating a control-chart statistic.
A rational subgroup is a small set of observations collected under conditions that are as similar as practical. Its purpose is to estimate the variation that occurs within one short, consistent period. Differences between subgroups then show how the process changes over time.
For example, a factory may measure five consecutive parts from one machine every hour. The five parts form one subgroup. The next five parts, measured one hour later, form the next subgroup.
Why subgroup construction matters
An X-bar and R chart uses two statistics for each subgroup:
- The subgroup mean shows the location of the process during that sampling period.
- The subgroup range, calculated as maximum minus minimum, estimates short-term spread.
The chart assumes that the range mainly represents common-cause variation within a stable period. The X-bar chart then makes changes between periods easier to see.
If a subgroup mixes different conditions, its range can become misleading. Suppose five parts include parts from two machines. The range may reflect machine-to-machine differences rather than ordinary variation from one machine. The estimated control limits become too wide, and real changes may be hidden.
Conversely, if subgroups contain only unusually similar observations, the estimated range can be too small. The limits become too narrow, producing false alarms.
Practical rules for forming subgroups
Use a subgroup that represents a short, coherent slice of production or service activity.
- Keep the machine, operator, material, method, and measurement system consistent when those factors are part of the process being monitored.
- Collect observations close together in time when you want the range to represent short-term process variation.
- Record the time order of subgroups. The order is essential for interpreting trends and shifts.
- Use a consistent subgroup size when possible. X-bar and R constants depend on that size.
- Do not combine observations merely because they are convenient to collect.
- If conditions deliberately change, create separate streams or stratify the data by condition.
The correct grouping depends on the question. Five consecutive parts from one machine are suitable when you want to detect changes between production periods. Five parts selected randomly from an entire day's production may be unsuitable because the range includes changes that occurred during the day.
Subgroups for attribute data
For a p chart, one subgroup is usually a defined inspection period or batch. Record the number defective and the number inspected. For a u chart, record the number of defects and the number of units examined in that period.
The sample boundary still matters. A daily p-chart sample may be appropriate if the process can change from day to day. If the process changes by shift, a shift-level sample may reveal signals that a daily total would conceal.
| Chart | Subgroup or period data | Within-sample statistic |
|---|---|---|
| X-bar and R | Several measurements under similar conditions | Mean and range |
| p | Defectives and items inspected | Proportion defective |
| u | Defects and units inspected | Defects per unit |
A small calculation
The following code treats each row as a rational subgroup. It calculates the subgroup mean and range, which are the inputs for an X-bar and R chart.
import numpy as np
data = np.array([
[10.1, 10.2, 10.0, 10.1, 10.2],
[10.3, 10.2, 10.4, 10.3, 10.2],
[10.1, 10.0, 10.2, 10.1, 10.0],
])
subgroup_means = data.mean(axis=1)
subgroup_ranges = data.max(axis=1) - data.min(axis=1)
for number, (mean, subgroup_range) in enumerate(
zip(subgroup_means, subgroup_ranges), start=1
):
print(f"Subgroup {number}: mean={mean:.3f}, range={subgroup_range:.3f}")A large subgroup range is not automatically a special cause. First ask whether the subgroup mixed machines, shifts, materials, or other conditions. A signal is meaningful only when the sampling plan supports the chart's assumptions.
Exercise
A team combines three parts from the morning shift and three parts from the evening shift into one subgroup of six. What is the main risk?
Show answer
The range may include shift-to-shift differences, so it no longer estimates only short-term within-period variation.