Bland-Altman and Method Comparison Analysis
Operator: Abdulla Al Fahad. How tools are built and checked
Two measurement methods can be strongly correlated and still disagree badly: a correlation coefficient of 0.95 says the readings move together, not that one can replace the other. The question that matters for a new instrument or assay is how far apart the two results for the same sample are likely to be, and whether that gap is small enough for the purpose.
Bland and Altman's answer is to plot the difference between the methods against their mean, report the average difference as the bias, and give limits within which about 95% of differences should fall. This page does that, puts confidence intervals on the bias and on both limits so you can see how well a small study pins them down, and adds Deming and Passing-Bablok regression for the question of whether the disagreement is a constant offset or grows with the level.
It does not decide whether the limits are acceptable. That is a clinical or analytical tolerance which only you can set.
Key features
- Bias and 95% limits of agreement with confidence intervals, on absolute, ratio (log) or percent differences
- A regression of the differences on the means with its slope and p value, to detect bias that changes with level
- Non-parametric limits from the 2.5th and 97.5th percentiles, when there are at least 39 pairs
- Ordinary least squares, Deming regression with an error ratio you set and jackknife intervals, and Passing-Bablok regression with intervals
- Bias with an interval at decision levels you type, taken from the Deming line
- A Bland-Altman chart and a regression chart as SVG or PNG, and CSV or XLSX of every table and the pairs
Differences, limits of agreement and the three regression lines
One row per sample, with one column per method and optionally a column of sample labels. Rows where both results are blank are skipped; a row with one missing result stops the analysis and is named. Decimal commas such as 12,5 are read as decimals. The difference is always Method A minus Method B, so list the new or test method in the position you want to be subtracted from.
Use up to 2,000 pairs. The ratio option takes logarithms and needs both results above 0; the percent option divides each difference by the pair mean and cannot take a pair whose mean is 0.
The regression charts and tables use Method B as the response and Method A as the predictor. Replicate measurements per sample are not modelled; average them or enter one pair per row.
How it works
The limits of agreement are the mean difference plus or minus 1.96 standard deviations of the differences. Following Bland and Altman (1999), the 95% interval of the bias is the mean difference plus or minus t times s over root n, and each limit's interval is the limit plus or minus t times s times the square root of 1/n + 1.96 squared over 2(n - 1), with t on n - 1 degrees of freedom.
Deming regression minimises distances weighted by the ratio of the two methods' error variances; with a ratio of 1 it is orthogonal regression. Its intervals come from a leave-one-out jackknife, which needs no assumption about the shape of the errors. Passing-Bablok takes the median of all pairwise slopes, shifted by the number of slopes below -1 to correct for bias, and gives the interval of the original 1983 paper from the order statistics of those slopes. A slope interval that contains 1 and an intercept interval that contains 0 mean the data are consistent with the methods agreeing.
The slope of the differences on the means is a plain least-squares regression of the difference on the mean. A small p value means the bias depends on the level, and one pair of limits does not describe the range.
Common use cases
- A respiratory nurse sees limits of -78 to +74 l/min and compares them with what matters clinically. If a 75 l/min difference could change a treatment decision, the meters are not interchangeable, whatever the correlation says.
- The same data on the ratio scale give a bias ratio of 0.988 with limits of 0.778 to 1.255, meaning the Wright reading is typically within a quarter either way of the mini reading.
- A laboratory enters decision levels of 200, 400 and 600 and gets the estimated bias of Method B against A from the Deming line: +9.41, +3.58 and -2.24 l/min, with 95% intervals from -79.67 to 98.49 at the low level and -37.74 to 33.26 at the high one. The mini meter reads about 9 l/min above the Wright meter at 200 l/min and about 2 below it at 600.
- Passing-Bablok on the same pairs gives a slope of 1.065 with an interval of 0.837 to 1.397 and an intercept of -24.3 with an interval of -178.0 to 82.9. Both intervals include the line of equality, so with 17 pairs the data cannot rule out agreement.
How to use this tool
- Load the paired results, or press Load PEFR data to start from the classic example.
- Choose the Method A and Method B columns and the sample label column.
- Pick absolute, ratio or percent differences and the Deming error ratio, and optionally type decision levels.
Example
Peak expiratory flow in 17 people, Wright meter against mini Wright meter, first readings (Bland and Altman 1986)
subject,wright_1,wright_2,mini_1,mini_2
1,494,490,512,525
2,395,397,430,415
3,516,512,520,508
... 17 subjectsAgreement on the absolute scale (Method A minus Method B, l/min)
Bias -2.12, 95% CI -22.05 to 17.81
SD of differences 38.77
Lower limit -78.10 (CI -112.85 to -43.34)
Upper limit 73.86 (CI 39.11 to 108.62)
1 of 17 points outside the limits; slope of difference on mean 0.029, p = 0.7495Tips for best results
- Look at the confidence intervals on the limits before the limits themselves. With 17 pairs the lower limit of -78 could be anywhere from -113 to -43; that spread is the real message about how much data you have.
- Switch to the ratio option if the points fan out as the mean increases; if the spread is the same at every level, the absolute scale is the right one.
- Set the Deming error ratio from replicate data if you have it, since an assumed ratio of 1 gives the wrong line when the new method is much more precise than the old.
- A slope p value near 0.05 with a handful of pairs is weak evidence either way; look at the chart rather than the number.
Common pitfalls
Limits of agreement describe how far apart single results are likely to be. They do not tell you which method is right, and a bias of zero with wide limits is still poor agreement.
Ordinary least squares assumes Method A has no error. When both methods have error its slope is too flat, which is why the Deming and Passing-Bablok lines for the same data differ from it.
Common errors and how to fix them
- The log (ratio) option needs both results above 0, but the pair "9" has 0 and 41.
- A ratio with a zero result is undefined. Remove that pair, or use the absolute option.
- Row 14: "n/a" is not a number (a pair needs both results).
- Delete the row or fill in the missing reading; the page does not drop incomplete pairs silently.
- The Deming error ratio has to be a number above 0.
- Enter the ratio of the error variances of B to A, for example 1 for equal precision or 0.5 if B has half the error variance.
Best practices
- Choose the samples to span the clinical range; a narrow range hides level-dependent bias and makes every regression slope unstable.
Reading the Bland-Altman chart
The solid line is the bias and the dashed lines are the limits, each with a shaded band for its 95% interval. About 1 point in 20 should fall outside the limits, and on the example one of 17 does. If the points form a slope, the bias depends on the level; if they fan out, the spread does, and a ratio or percent scale may fit better. A single wide limit-band on one side suggests skewed differences, and the page warns when skewness is above 1 in size.
Frequently asked questions
How do I know the example matches the paper?
The 1986 Lancet paper reports a mean difference of -2.1 l/min and a standard deviation of 38.8 for the first readings of the Wright and mini Wright meters, and the page returns -2.12 and 38.77 from the 17 pairs. The interval of the bias, -22.05 to 17.81, is the one that Bland and Altman's 1999 review works out for the same data.
Why are non-parametric limits missing?
Percentile limits need enough pairs to estimate the 2.5th and 97.5th percentiles; the page needs at least 39 pairs, and with 17 it says so rather than printing the extremes.
Why do the three regression lines differ?
They make different assumptions about error. Least squares assumes only Method B is noisy, Deming allows noise in both with the ratio you set, and Passing-Bablok uses the median of pairwise slopes and ignores the shape of the errors. For the example, with Wright as Method A and the mini meter as Method B, the slopes are 0.917 for least squares, 0.971 for Deming and 1.065 for Passing-Bablok.
Can it handle repeated measurements on each subject?
Not directly. Entering several rows for the same person treats them as independent pairs and makes the limits too narrow; average each person's results first, or enter one pair per person.