Using SPSS to produce a Bland-Altman scatterplot with lines added on representing the mean inter-test difference and its 95% confidence limits
The below is taken from here. A syntax file for SPSS 16 and later which produces a plot and statistics together with details of how to use these to finish things off by editing the plot are given here.
SPSS doesn't perform Bland-Altman analysis (MedCalc and Analyse-it do), but the basic steps are:
- For each data:
- Compute the difference between the two methods being compared - Compute the average of the two methods
- Run descriptives to obtain the mean and SD of the differences (a
- paired t test is also OK for that) and compute the limits of agreement: Mean(diff)+/- 2*SD(diff). Discuss them (too wide?) as the authors indicate in their Lancet paper.
- Compute (by hand) the Coefficient of
- reproducibility:=100*SD(diff)/Mean(averages) (NOT mean of differences, be careful).
- Plot difference (Y axis) vs average (X axis)
Edit the plot and add the three lines (Mean(diff), upper limit & lower limit) as reference lines. Check for departures of the pattern as described in Bland&Altman Lancet paper (bias, heterogeneity proportional to the average...).
- If sample size is big enough, a histogram of the differences is also
- useful.
This is the analysis using SPSS of the data presented by Bland & Altman in their paper (we will ignore the second measure of each method, because the use them to check for repeatability, a different statistical problem, if you are interested, I also have some worked examples using SPSS):
DATA LIST LIST/ subject wright1 wright2 mini1 mini2 (5 F8.0). BEGIN DATA 1 494 490 512 525 2 395 397 430 415 3 516 512 520 508 4 434 401 428 444 5 476 470 500 500 6 557 611 600 625 7 413 415 364 460 8 442 431 380 390 9 650 638 658 642 10 433 429 445 432 11 417 420 432 420 12 656 633 626 605 13 267 275 260 227 14 478 492 477 467 15 178 165 259 268 16 423 372 350 370 17 427 421 451 443 END DATA. VAR LABEL wright1'Wright peak flow meter #1' / wright2'Wright peak flow meter #2' /mini1 'Mini Wright peak flow meter #1' /mini2 'Mini Wright peak flow meter #2'. COMPUTE dif1=wright1-mini1. COMPUTE mean1=MEAN(wright1,mini1). COMPUTE var1 = VARIANCE(wright1,mini1) . EXECUTE . GRAPH /SCATTERPLOT(BIVAR)=mean1 WITH dif1. GRAPH /SCATTERPLOT(BIVAR)=mean1 WITH var1. DESCRIPTIVES VARIABLES=dif1 mean1 /STATISTICS=MEAN STDDEV .
You will get:
N Mean Std.Dev. dif1 17 -2.1176 38.76513 mean1 17 451.4118 113.07578
- CR = 100*38.765/451.4118 = 8.6%
- Lower: d - 2s = -2.1 - (2x38.8) = -79.7 l/min
- Upper: d + 2s = -2.1 + (2x38.8) = 75.5 l/min
Now, edit the first graph and add the 3 reference lines (meanddiff, lower & upper).