Orthogonal (Deming) regression for comparing two instruments

Updated

Orthogonal regression, also called Deming regression, fits a straight line when both variables are measured with error. Its usual job in a plant or lab is a method comparison: you measure the same parts with two instruments and ask whether the new one agrees with the reference, has a constant offset, or reads proportionally high or low. Ordinary least squares is the wrong tool for that, because it assumes the x values are exact.

When to use it

  • You want to replace a reference instrument with a faster or cheaper one and need to show they agree.
  • Two labs, two gages or two methods measure the same samples and you want to describe the relation between them.
  • Both readings have measurement error of a size you can estimate, for example from repeatability studies.

If the x variable is set without error (a dial setting, a known standard), use an ordinary fitted line plot. To judge agreement part by part, pair this analysis with a measurement agreement plot. To check one gage against reference standards, see gage linearity and bias.

How it works

Ordinary least squares minimizes the vertical distances from the points to the line. When x also has error, that pulls the slope toward zero, an effect called attenuation or regression dilution. Deming regression instead minimizes distances measured at an angle set by the error variance ratio:

λ = σ²(error of Y) / σ²(error of X)

Some programs define the ratio the other way round, so check which variable goes on top. With λ = 1 the distances are perpendicular to the line, which is orthogonal regression in the strict sense. As λ grows, the fit approaches ordinary least squares of Y on X.

With Sxx = Σ(xᵢ − x̄)², Syy = Σ(yᵢ − ȳ)² and Sxy = Σ(xᵢ − x̄)(yᵢ − ȳ):

b₁ = [Syy − λSxx + √((Syy − λSxx)² + 4λSxy²)] / (2Sxy) b₀ = ȳ − b₁x̄

Get λ from data, not from a guess: run a repeatability study on each instrument (several readings of the same parts) and take the ratio of their variances.

For confidence intervals this article uses the jackknife: refit the line n times, each time leaving out one part, compute the standard error from the spread of those n estimates, and use t with n − 1 degrees of freedom. This is a common choice in method comparison because it does not depend on the errors being exactly normal. Approximate normal-theory formulas also exist and give similar results with enough data.

Two questions settle agreement:

  • Does the intercept interval contain 0? If not, there is a constant bias.
  • Does the slope interval contain 1? If not, there is a proportional bias: the difference between methods grows with the size of the reading.

Example

A paint shop wants to release panels with a handheld magnetic-induction gauge instead of cutting cross-sections for the microscope. The lab picks 20 panels chosen to span the whole working range and measures each with both methods. Repeatability studies gave standard deviations of 1.0 µm for the microscope and 2.0 µm for the handheld gauge, so λ = 2.0² / 1.0² = 4.

Panel12345678910
Microscope (µm)67.669.050.936.623.643.842.922.521.979.8
Handheld (µm)73.172.348.538.521.244.245.818.922.682.4
Panel11121314151617181920
Microscope (µm)57.934.146.178.172.870.342.548.260.822.5
Handheld (µm)63.032.448.979.275.971.547.652.267.525.1
Coating thickness, handheld gauge versus microscope20406080Handheld gauge (µm)20406080Microscope (µm)
Coating thickness, handheld gauge versus microscope

The Deming fit with λ = 4:

TermEstimateJackknife SE95% CI
Intercept−1.6231.713−5.208 to 1.963
Slope1.07190.03121.0066 to 1.1372

The intercept interval contains 0, so there is no evidence of a constant offset. The slope interval lies above 1: the handheld gauge reads about 7% high, proportionally. From the fitted line, the expected difference (handheld minus microscope) is 0.54 µm at 30 µm, 1.97 µm at 50 µm and 3.41 µm at 70 µm.

For comparison, ordinary least squares of handheld on microscope gives a slope of 1.0684, and the strict orthogonal fit (λ = 1) gives 1.0769. The differences are small here because the panels cover a range (standard deviation 19 µm) far wider than the measurement error. With panels from a narrow production range, the least-squares slope would fall further below the truth.

How to read the results

  • Intercept near 0 and slope near 1 means the methods agree over the range tested.
  • Slope different from 1 means a proportional bias. Here, at the 60 µm upper specification limit, the gauge reads about 2.7 µm high, so panels near that limit would be rejected that the microscope would pass. A correction (divide by 1.072, after removing the intercept) or a new calibration fixes it.
  • Intercept different from 0 means a constant offset, often a zeroing or a substrate effect.
  • Wide intervals mean too few parts or too narrow a range. Extend the range before concluding that the methods agree.
  • Check the scatter of the points too. The line describes average agreement. Whether single readings agree well enough depends on the spread around the line, which a measurement agreement plot shows directly.

Common mistakes

  • Using ordinary least squares. It assumes the reference is exact and biases the slope toward zero.
  • Guessing λ. The slope depends on it. Measure both repeatabilities on the same kind of parts.
  • Reading a high correlation as agreement. Two methods can correlate at 0.99 (here 0.993) and still differ by 7%. Correlation measures association, not agreement.
  • Choosing parts from normal production only. A narrow range makes the slope uncertain. Select parts across the full range on purpose.
  • Testing the slope against 0. The question is whether it equals 1, not whether it differs from 0.

Frequently asked questions

What is the difference between Deming regression and orthogonal regression?

Orthogonal regression is the special case λ = 1, where both variables have the same error variance and distances are measured perpendicular to the line. Deming regression allows any ratio. Many programs use the two names for the same tool.

What if I do not know the error variance ratio?

Run a short repeatability study on each method. If that is impossible, λ = 1 is a common default when the two methods are of similar quality, but report the assumption and check how much the slope changes for other plausible values.

Can I use a paired t-test instead?

A paired t-test on the differences tests only a constant offset. It cannot detect a proportional bias, where the differences grow with the reading, as in this example.

How many parts do I need?

At least 20 to 40, spread evenly over the whole range in which the instruments will be used. More parts narrow the intervals; a wider range narrows them faster.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab