Sub topic 2
Rational subgroups: what goes in a sample
This chapter assumes you know the mean, range, and standard deviation, and that you can read measurements in time order. The code uses Python and NumPy.
A rational subgroup is a set of measurements taken close together in time under the same conditions. Variation within a subgroup should come only from common causes. Differences between subgroups can then reveal special causes, such as a new operator, a tool change, or a shift change.
Build subgroups so the spread inside each one reflects short-term noise. Five parts from one machine cycle make one subgroup. One part per hour over five hours makes five subgroups of size one.
- Keep subgroup members close in time and in conditions.
- Make sure the differences you care about can show up between subgroups, not within them.
Choosing a chart: a decision path
Start with your data type and subgroup structure:
- Counted defective items with varying sample sizes: use a p chart.
- Counted defects per unit: use a u chart.
- Measured values in subgroups of 2 to 10: use an X-bar and R chart.
- Measured values, one per period: use an I-MR chart.
I-MR charts: one measurement at a time
An I-MR chart plots each individual value and the moving range, the absolute difference between consecutive values. The limits use the average moving range, MR̄:
- Individuals chart: center line at the mean x̄, limits at x̄ ± 2.66 × MR̄.
- Moving range chart: upper limit at 3.267 × MR̄, no lower limit.
import numpy as np
x = np.array([10.2, 9.8, 10.1, 10.4, 9.9, 10.0, 10.3, 9.7, 10.1, 10.2])
mr = np.abs(np.diff(x))
x_bar, mr_bar = x.mean(), mr.mean()
print("I chart LCL, CL, UCL:", x_bar - 2.66 * mr_bar, x_bar, x_bar + 2.66 * mr_bar)
print("MR chart CL, UCL:", mr_bar, 3.267 * mr_bar)X-bar and R charts: means and ranges of subgroups
For each subgroup, compute the mean (X-bar) and the range (R, the maximum minus the minimum). The grand mean X̿ is the average of the subgroup means, and R̄ is the average range. For subgroups of size 5, the constants are A2 = 0.577, D3 = 0, and D4 = 2.114:
- X-bar chart: X̿ ± A2 × R̄.
- R chart: limits from D3 × R̄ to D4 × R̄.
import numpy as np
data = np.array([
[5.02, 4.98, 5.01, 5.00, 4.99],
[5.03, 5.00, 4.97, 5.01, 5.02],
[4.99, 5.01, 5.00, 5.04, 4.98],
])
xbars = data.mean(axis=1)
ranges = data.max(axis=1) - data.min(axis=1)
xbarbar, rbar = xbars.mean(), ranges.mean()
print("X-bar LCL, CL, UCL:", xbarbar - 0.577 * rbar, xbarbar, xbarbar + 0.577 * rbar)
print("R LCL, CL, UCL:", 0.0 * rbar, rbar, 2.114 * rbar)Exercise
A process has 12 hourly readings, one per hour. Which chart should you use, and why?
Show answer
An I-MR chart, because each period gives one measured value and there are no subgroups.