The Line and the Cloud

View this presentation on a computer

This presentation uses detailed figures and interactive controls. Open it on a computer so you can see and use them properly.

Back to lectures

The Line and the Cloud

A visual guide to regression models
in clinical chemistry

Filip Landgren

Sir Francis Galton
Figure 1. Sir Francis Galton

Sir Francis Galton

1822–1911

Darwin's half-cousin and a Victorian polymath with interests in heredity, meteorology and statistics. He measured parents' and children's heights, entered the frequencies in a grid and found that the contours formed ellipses.

The shape of the ellipse became his measure of association: a narrow ellipse around a line indicates a strong linear association when the axis scales are fixed. This was correlation, almost a decade before Pearson formalised r (1895–96).

Galton's ellipse

Galton 1886, Plate X: ellipse diagram of parents' and children's heights
Figure 2. Plate X from Regression towards Mediocrity in Hereditary Stature (1886).

What is r?

Figure 3. r describes the shape of the cloud, not a line through it

Why is it called regression?

Figure 4. Regression to the mean in two repeated measurements.

Restricting the measurement range

Figure 5. Correlation depends on the measurement range we examine.

Correlation ≠ agreement

Figure 6. High correlation does not mean that two methods give the same results.

What do we need to know?

Loading the measurement data…

Relationship and bias

Deming

Assumed λ = 0.3, constant SD

Differences and dispersion

Mean differenceLoA

Normal approximation, stable dispersion within 0–50

Figure 7c. The same pairs, with estimated bias and individual differences.

Bias at relevant levels

Estimate with 95% CI

Reference levelBias (95% CI)

Illustrative levels, arbitrary units.

Imprecision from replicates

SD or CV at relevant levels, within and between days.

LoA do not replace a precision study.

Does a mean bias of 16 tell us enough?

Figure 8. The difference between the methods increases with the measured value.

OLS: the default we take for granted

Figure 9. OLS minimises the sum of squared vertical residuals.

Deming: measurement error in both methods

Figure 10. Deming accounts for measurement error in both methods. Schematic residuals.

Passing–Bablok: the robust alternative

Figure 11. Passing–Bablok uses ranked pairwise slopes.

What happens when we add outliers?

Figure 12. The same pairs and the same outliers for all three models.

Regression dilution

Figure 13. Measurement error in x attenuates the OLS slope.

Model convergence

Figure 14. OLS, Deming and Passing–Bablok with adjustable correlation.

What regression tells us

Slope ≠ 1: proportional bias

Intercept ≠ 0: constant bias

R² = 1 − SSres / SStot

SSres: the sum of squared vertical distances from the points to the regression line — the variation that remains.

SStot: the sum of squared deviations of the y values from their mean — the total variation.

R² = 0.90 means that 10% of the total sum of squares remains as residual variation.

r measures linear association. R² = r² holds for simple OLS with an intercept.

Can you see a difference?

Figure 15. Anscombe's quartet: four different patterns with the same summary statistics.

Regression models have no eyes

Figure 16. Different point patterns with the same summary statistics.
Ptolemy's geocentric model with epicycles
Figure 17. A geocentric model with epicycles.

All models are geocentric

The same statistical measures can describe very different point clouds.

Ptolemy's epicycles predicted planetary positions with great precision. But the model put the Earth at the centre.

All regression models are geocentric, but not equally geocentric. Assumptions about the error structure determine the slope we get.

A linear relationship?

Figure 18a. Two biochemical markers in an illustrative dataset.

Constant SD or constant CV?

−120124080120160Concentration (units)Residual (units)

Constant SD

Roughly the same absolute dispersion.

−120124080120160Concentration (units)Residual (units)

Constant CV

Dispersion increases with concentration.

Figure 19. Illustrative residuals around a correctly specified linear relationship: the same noise pattern on different scales.

Three approaches, different assumptions

Weighted Deming

Models measurement error in both methods. With constant CV, it uses concentration-dependent variances.

Imprecision data determine the error model. High concentrations should not dominate simply because their absolute variance is larger.

Log scale

Can stabilise proportional dispersion for positive values, but also changes the relationship being modelled.

log y = α + β log x
y = eαxβ

Passing–Bablok

Uses ranked pairwise slopes and is less sensitive to isolated outliers. Does not use measured imprecision data.

When the methods are expected to give the same values, roughly equal measurement-error SDs are assumed.

an optionwith outliers

What do we actually do when we ‘weight’ a regression model?

The CV is the same, but SD increases with the level.

On the left are schematic residuals with an expected SD of five per cent of the level. The shaded band shows plus and minus one expected SD. Two highlighted points at levels 20 and 200 have residuals of 2 and 20, with SDs of 1 and 10. On the right, the areas of the diagonally hatched squares represent these residuals' contributions to the sum for the same fixed line. Without weighting, the contributions are 4 and 400. The next click weights them by inverse error variance: the large square shrinks to one hundredth of its area. The weights are 1 and 0.01, giving contributions of 4 and 4. The weight w_i is 1 divided by sigma_i squared. The model minimises Q, the sum of w_i times e_i squared; e_i denotes the residual and sigma_i the expected SD. The squares use the same area scale before and after weighting. The points do not move. The figure shows their contributions to the criterion, not their individual influence on the slope or their clinical importance. Dispersion increases with the level 20 0 −20 20 200 Level Deviation from the line 2 units = 2 SD 20 units = 2 SD Expected dispersion: ±1 SD Contributions for the same line Square area shows the contribution Without weighting Low level High level 4 400 Weighted using SD 1 × 22 = 4 0.01 × 202 = 4 wi = 1 / σi2 Minimise Q = ∑i wiei2 e: residual σ: expected SD

Ten times the SD means one hundredth of the weight.

Figure 20. The same relative deviation: different contributions before weighting, equal afterwards. Schematic example in arbitrary units.

Why model choice matters

  • r measures association, not agreement, bias or interchangeability.
  • OLS does not account for measurement error in x. Classical independent measurement error in x attenuates the slope.
  • Deming models error in both axes, with an error ratio and weighting that need to reflect the methods' imprecision.
  • Passing–Bablok is less sensitive to isolated outliers, but does not use measured imprecision data. When the methods are expected to give the same values, a central assumption is roughly equal measurement-error SDs.
  • When measurement error is small relative to the measurement range, the models converge. The error structure determines the choice, not the r value.

How we assess the new method

  1. Plot the data. Relationships, differences, outliers and measurement range.
  2. Examine the error structure. SD, CV and imprecision in both methods.
  3. Choose a model. Check linearity and the relevant assumptions.
  4. Estimate bias and uncertainty at clinically relevant levels.
  5. Compare with predefined requirements. Is the evidence sufficient?

Set the acceptance criteria before the study.

References

  • CLSI EP09c, 3rd ed. 2018. Measurement Procedure Comparison and Bias Estimation Using Patient Samples. Ch. 6.2 (regression choice), app. B (weighted Deming), app. G (r and the x range), app. I (Passing–Bablok), app. K (CIs for bias).
  • Linnet K. Performance of Deming regression analysis in case of misspecified analytical error ratio. Clin Chem 1998;44:1024–31.
  • Linnet K. Necessary sample size for method comparison studies based on regression analysis. Clin Chem 1999;45:882–94.
  • Stöckl D, Dewitte K, Thienpont LM. Validity of linear regression in method comparison studies. Clin Chem 1998;44:2340–6.
  • Passing H, Bablok W. J Clin Chem Clin Biochem 1983;21:709–20 (Part I) and 1984;22:431–45 (Part II).
  • Baumdicker F, Hölker U. Stat Probab Lett 2020;164:108801.
  • Galton F. Regression towards mediocrity in hereditary stature. J Anthropol Inst 1886;15:246–63.
  • Anscombe FJ. Am Stat 1973;27:17–21.
  • Matejka J, Fitzmaurice G. Same stats, different graphs. CHI 2017.
  • Bland JM, Altman DG. Measuring agreement in method comparison studies. Stat Methods Med Res 1999;8:135–160.
  • NIST Dataplot. Passing Bablok Fit.
  • NIST/SEMATECH e-Handbook. Weighted least squares regression, sections 4.4.3.2 and 4.4.5.2.
  • CLSI EP05 and EP15. Studies and verification of imprecision.
  • McElreath R. Statistical Rethinking, 2nd ed. 2020, ch. 4.
‘The task is not so much to see what no one has yet seen, as to think what no one has yet thought about what everyone sees.’

Arthur Schopenhauer, Parerga und Paralipomena (1851)

Filip Landgren

filip.landgren@gmail.com
https://klinkemipedia.se