Sub topic 4
Bias, linearity and stability studies
This chapter covers the three location properties of a measurement system. They describe whether readings are centered on the truth: at one size, across the range, and over time. It assumes you can compute a mean and standard deviation, you know what a t-test and a simple linear regression do, and you can read a control chart. Repeatability and reproducibility, which describe spread, come in the next chapter.
Location errors versus spread errors
A measurement system can fail in two ways. Its readings can scatter too much, or they can be centered in the wrong place. The three studies here address the second failure, which is a systematic error.
- Bias is the difference between the average of repeated readings and a reference value for the same part. The reference value comes from a higher-accuracy instrument or a calibrated standard.
- Linearity is how much bias changes across the working range of the gage.
- Stability is how much bias, or the readings themselves, change over time when the same part is measured repeatedly.
| Property | Question | Data needed | Usual analysis |
|---|---|---|---|
| Bias | Is the average reading equal to the reference? | One reference part, 10 to 30 readings | One-sample t-test, confidence interval |
| Linearity | Is the bias the same at small and large sizes? | 5 or more reference parts spanning the range, about 10 or more readings each | Regression of bias on reference value |
| Stability | Does the gage hold its calibration over time? | One master part, measured at regular intervals | Control chart |
Because reference values are central to all three studies, the study is only as good as the reference. As a guide, the reference should be about ten times more accurate than the gage under study. If it is not, the "bias" you find mixes the gage error with the reference error.
Bias study
Design
- Choose a reference part whose value has been established, for example by a calibration lab, and whose size is near the middle of the working range.
- Have one trained operator measure it at least 10 times, and preferably 30. Measure it as you would in normal use: remove and reposition it between readings, so that setup variation is included.
- Randomize the timing of readings if you can, and record the readings in order.
Analysis
Let the readings be x₁ … xₙ and the reference value be μ_ref.
- Bias = x̄ − μ_ref
- Standard error = s / √n
- t = bias / standard error, with n − 1 degrees of freedom
If the confidence interval for the bias contains zero, or equivalently if the p-value is above the chosen α (often 0.05), you cannot claim the bias differs from zero. This is not the same as proving the gage is unbiased. With few readings the interval is wide, and a large bias can hide inside it. A bias that is statistically significant can also be too small to matter in practice, so compare the bias with the tolerance or the process variation as well as with zero.
import numpy as np
from scipy import stats
def bias_study(readings, reference, alpha=0.05):
"""One-sample bias study for repeated readings of one reference part."""
x = np.asarray(readings, dtype=float)
n = x.size
bias = x.mean() - reference
se = x.std(ddof=1) / np.sqrt(n)
t = bias / se
p = 2 * stats.t.sf(abs(t), df=n - 1)
half = stats.t.ppf(1 - alpha / 2, df=n - 1) * se
return {
"bias": bias,
"t": t,
"p_value": p,
"ci": (bias - half, bias + half),
}
rng = np.random.default_rng(7)
readings = 5.00 + 0.04 + rng.normal(0, 0.05, size=30) # true bias of +0.04
print(bias_study(readings, reference=5.00))Common causes of bias
- Worn or damaged instrument, or a master that has itself worn
- A gage calibrated at the wrong size, or calibrated against a wrong master
- An instrument built for a different range or environment than the one it is used in
- Operator technique that differs from how the reference was set, such as different clamping force
Linearity study
A gage can be accurate at the center of its range and wrong at the ends. A linearity study checks this.
Design
- Select at least five parts whose reference values cover the full operating range of the gage.
- Measure each part about 10 or more times, in random order, with a single operator if you only want the gage effect.
- For each reading, compute bias = reading − reference value.
Analysis
Fit a straight line of bias against reference value: bias = a + b × reference.
- The slope b is the change in bias per unit change in size. A slope of zero means the bias is constant across the range.
- The intercept a is the bias at a reference value of zero. It matters only as a model parameter, since you rarely measure at zero.
- The p-value for the slope tests whether the slope differs from zero.
In the AIAG convention, linearity is |b| × process variation, and %linearity is 100 × |b|. Always check the individual bias at each reference size as well as the fitted line. A linear model can hide a curved pattern, for example bias that is zero in the middle and large at both ends. Plot bias against reference value, with the average bias per size and the individual points, and look at it before you trust the slope.
import numpy as np
from scipy import stats
def linearity_study(reference, readings):
"""Regress bias on reference value. Both arrays have one entry per reading."""
ref = np.asarray(reference, dtype=float)
y = np.asarray(readings, dtype=float)
bias = y - ref
fit = stats.linregress(ref, bias)
sizes = np.unique(ref)
avg_bias = {float(s): float(bias[ref == s].mean()) for s in sizes}
return {
"slope": fit.slope,
"intercept": fit.intercept,
"slope_p_value": fit.pvalue,
"pct_linearity": 100 * abs(fit.slope),
"average_bias_by_size": avg_bias,
}
rng = np.random.default_rng(3)
ref = np.repeat([2.0, 4.0, 6.0, 8.0, 10.0], 12)
reading = ref + 0.05 + 0.01 * (ref - 6.0) + rng.normal(0, 0.05, size=ref.size)
print(linearity_study(ref, reading))Reading the result
- A small slope with a large p-value suggests no meaningful linearity problem.
- A small p-value with a tiny slope is statistically significant but may be unimportant. Judge it by how much bias builds up across the range compared with the tolerance.
- Different bias at each size, with no straight-line pattern, points to a nonlinear problem such as a poorly calibrated scale.
- A common cause of linearity error is a gage calibrated at only one or two points.
Stability study
Stability asks whether the gage gives the same answer next month as today. A bias or linearity study is a snapshot. A stability study is a film.
Design
- Pick a master part, or a stable reference part, whose characteristic does not change with handling or time.
- At a regular interval (each shift, day or week), measure it 3 to 5 times and record the average, or record a single reading if that matches routine checks.
- Keep this up long enough to see real drift. Twenty or more subgroups is a sensible minimum for setting control limits.
- Plot the results on an X-bar and R chart, or on an individuals chart if you take one reading per interval.
Analysis
A stable measurement system gives a chart that is in statistical control: no points beyond the limits and no non-random patterns. Typical signals include:
- A point beyond a control limit, which suggests a sudden shift such as a dropped gage or a new calibration.
- A run of eight or more points on one side of the center line, which suggests a shift in level.
- A steady trend upward or downward, which suggests wear or thermal drift.
The control limits describe the usual variation of the gage, and they do not compare the readings with a specification. A gage that is stable but biased still needs a bias study.
import numpy as np
def individuals_chart(values, run_length=8):
"""Individuals chart with moving-range limits and two simple signals."""
x = np.asarray(values, dtype=float)
center = x.mean()
mr_bar = np.abs(np.diff(x)).mean()
ucl = center + 2.66 * mr_bar
lcl = center - 2.66 * mr_bar
beyond = np.where((x > ucl) | (x < lcl))[0]
side = np.sign(x - center)
run_signal = []
for i in range(run_length - 1, x.size):
window = side[i - run_length + 1 : i + 1]
if np.all(window == 1) or np.all(window == -1):
run_signal.append(i)
return {"center": center, "ucl": ucl, "lcl": lcl,
"beyond_limits": beyond.tolist(), "run_signals": run_signal}
rng = np.random.default_rng(11)
stable = rng.normal(25.00, 0.03, size=30)
drift = stable + np.linspace(0, 0.12, 30) # slow upward drift
print(individuals_chart(drift))The constant 2.66 is 3 / d₂ with d₂ = 1.128, which is the standard factor for moving ranges of size two.
Common causes of instability
- Wear, contamination or damage to the gage or the master
- Temperature and humidity changes, or electrical warm-up effects
- Loss of calibration between calibration dates
- A change in cleaning, fixturing or the operator's habits
Practical gotchas
- Measuring the wrong thing. If the reference part is not representative of production parts in material, finish or shape, the bias you find may not apply to production.
- Hidden spread. A bias study with few readings and a noisy gage will have a wide confidence interval. Do the repeatability work before concluding that bias is acceptable.
- Corrections. If a bias is stable and well characterized, you can correct readings for it. A drifting bias cannot be corrected this way. It has to be fixed, or the gage recalibrated more often.
- Order of work. Fix bias, linearity and stability problems before running a gage R&R study. R&R measures spread, and a gage with a drifting mean gives misleading spread estimates.
Exercise
A technician measures a 25.000 mm reference gauge block 30 times with a micrometer. The mean reading is 25.012 mm and the standard deviation is 0.010 mm. Compute the bias, the standard error and the t statistic, and say whether the bias is statistically significant at α = 0.05 (the critical t value for 29 degrees of freedom is about 2.045).
Show answer
Bias = 25.012 − 25.000 = 0.012 mm. Standard error = 0.010 / √30 ≈ 0.00183 mm. t = 0.012 / 0.00183 ≈ 6.57, which exceeds 2.045, so the bias is statistically significant. The 95% confidence interval is about 0.012 ± 2.045 × 0.00183, or roughly 0.008 to 0.016 mm, which excludes zero. Whether 0.012 mm matters in practice depends on the tolerance.
Exercise
A linearity study fits bias = 0.02 + 0.015 × reference, with a slope p-value of 0.001. The gage range is 0 to 10 units. Compute %linearity and the bias at reference values of 2 and 10. Is the p-value alone enough to reject the gage?
Show answer
%linearity = 100 × |0.015| = 1.5%. The predicted bias at 2 is 0.02 + 0.03 = 0.05, and at 10 it is 0.02 + 0.15 = 0.17. The low p-value shows the slope is real, but it does not say whether the effect is large. You should compare a bias of 0.17 at the top of the range with the tolerance or process variation before deciding the gage is unacceptable.
Exercise
A stability chart for a master part shows all points inside the control limits, but nine consecutive points lie above the center line. What does this suggest, and what would you check?
Show answer
The run of nine on one side of the center is a non-random pattern that suggests a shift in the gage's level, even though no point exceeds a limit. Check for events around that time, such as a recalibration, a temperature change, a repair, a new master, or a change in the setup or fixture. After correcting the cause, restart the chart.