A calibration stand with a straight reference and differing measurements.
All notes

Continuous improvement

Regression analysis: a process example

Work through linear regression using NIST calibration data. Check the fitted equation, residuals and why a high R squared cannot approve a model.

Regression estimates a relationship between a response and one or more explanatory variables. A straight-line least-squares fit chooses an intercept and slope to minimise the sum of squared residuals.

A residual is the observed response minus the fitted response. It keeps the model's errors visible after the line summarises the relationship.

NIST's regression guide explains the method. The worked example below uses NIST's published calibration data.

Fit the 36 NIST observations

The Norris dataset contains 36 x/y pairs from ozone-monitor calibration. Recalculating ordinary least squares from those rows reproduces NIST's certified results to the displayed precision.

Fitted relationship in the source variable scale

Fitted y = −0.262323 + 1.002117 × x

Residual = observed y − fitted y

Residual standard deviation = 0.884796

R² = 0.999993746

The source does not assign physical units in the data file, so the chart retains x and y. It also supplies no production acceptance tolerance.

NIST Norris calibration dataset / 36 observed pairs

Inspect the fit and its residuals

The fitted values reproduce the published certified statistics. Select a point to inspect its error.

Paired readings / y against x0250500750100002505007501000Source variables; no physical unit suppliedx
Residual / observed y − fitted y-3-101302505007501000Source variables; no physical unit suppliedx

Observation 1: x = 0.2, y = 0.1. Fitted y = -0.0619; residual = 0.1619.

Fitted y = -0.262323 + 1.002117 × x. R² = 0.999993746. Residual standard deviation = 0.884796. No uncertainty band or acceptance tolerance is assumed.

Inspect all 36 source pairs and fitted values
Original NIST row order and supplied x/y values
ObservationxyFitted yResidual
10.20.1-0.06190.1619
2337.4338.8337.8518910.948109
3118.2118.1118.187885-0.087885
4884.6888886.2102141.789786
510.19.29.859057-0.659057
6226.5228.1226.7171361.382864
7666.3668.5667.4481131.051887
8996.3998.5998.1466630.353337
9448.6449.1449.287281-0.187281
10777778.9778.3824450.517555
11558.2559.2559.1192850.080715
120.40.30.1385240.161476
130.60.10.338947-0.238947
14775.5778.1776.8792691.220731
15666.9668.8668.0493830.750617
16338339.3338.4531610.846839
17447.5448.9448.1849530.715047
1811.610.811.362232-0.562232
19556557.7556.9146280.785372
20228.1228.3228.320523-0.020523
21995.8998997.6456040.354396
22887.6888.8889.216565-0.416565
23120.2119.6120.192118-0.592118
240.30.30.0383120.261688
250.30.60.0383120.561688
26556.8557.6557.716321-0.116321
27339.1339.3339.55549-0.25549
28887.2888888.815718-0.815718
29999998.51,000.852378-2.352378
30779778.9780.386678-1.486678
3111.110.210.861174-0.661174
32118.3117.6118.288096-0.688096
33229.2228.9229.422852-0.522852
34669.1668.4670.25404-1.85404
35448.9449.2449.587917-0.387917
360.50.20.238735-0.038735

NIST source observations and certified statistics

All 36 NIST Norris observations, an independently recalculated least-squares line and residuals. The residual panel uses a separate, labelled vertical scale. The calculation reproduces certified benchmark statistics; it does not establish a production acceptance limit or a causal relationship.

At x = 500, the fitted response is approximately 500.796. That is an estimate from the equation within the observed x range of 0.2 to 999.0, not an additional measured row.

Read the errors after reading the fit

The R² value is close to one because the line accounts for nearly all the response variation across this broad range. It does not say that the remaining errors are small enough for a particular use.

The recalculated residuals range from about −2.352 to 1.790. Whether those differences matter requires an operating requirement that the dataset does not provide.

NIST's validation guidance explicitly warns that a high R² is insufficient. Inspect residuals for curvature, changing spread and other departures from the selected model's assumptions. Use the actual acquisition order for time-related checks; a row number alone does not establish a timestamp.

Keep the model within its evidence

Extrapolating beyond the observed range adds assumptions about behaviour the data have not shown. Even an estimate within the range needs a suitable uncertainty calculation before it supports a consequential decision.

The figure shows fitted values and residuals. Confidence and prediction intervals need their own interpretation and assumptions.

The scatter-diagram guide examines the same pairs before fitting. The confidence-interval Note explains why uncertainty belongs to a defined estimate.

Separate estimation from a process change

An observational fit can help estimate a response or plan another study. It does not establish that adjusting x will cause the predicted change in y.

Use the design-of-experiments example when the task is to study controlled changes to settings.

For a model review, keep the equation, residuals, observed range and intended decision together. State the requirement first, then decide whether the remaining prediction error is acceptable for that use.

Sources

NextReinforcement learning in manufacturing

Discuss an operations problem

I work with operations and transformation teams on operational excellence, digital transformation programs, supply chains and industrial AI. Send me the problem you’re working on and the result you need.

Abolfazl ShirkavandImage preview unavailable