The Bland-Altman plot (AKA Tukey mean-difference plot) is a graphical tool to measure agreement between two estimates of a single variables methods.

blandAltman(x1, x2, xlab = "Average", ylab = "Difference", alpha = 0.05)

Arguments

x1

the first estimate

x2

the second estimate

xlab

a label of x-axis on which the mean of the two estimates is plotted

ylab

a label of y-axis on which the difference between the two estimates is plotted

alpha

significance level of the confidence interval

Details

Code taken from http://rstats.tiddlyspot.com/#Bland-Altman and updated slightly.

Value

a list of 'mean' (the of the two estimates), 'diff' (the diff of the estimates, 'se' (the standard error of the differences), and the '1-alpha/2' confidence intervals for the 'mean +/- 2 * SD of diffs' given as 'lower' and 'upper'

References

Bland JM, Altman DG (1986) _Statistical methods for assessing agreement between two methods of clinical measurement.__ Lancet 327 (8476): 30710.

Examples

n<-20 x<-rnorm(n) x1<-x+rnorm(n,0,.1) x2<-x+rnorm(n,0,.1) blandAltman(x1,x2)
#> $mean #> [1] -1.37313405 0.24150845 -2.50498903 0.01874336 0.73821782 1.28131023 #> [7] -1.86628346 -0.21923736 -0.27962931 -0.45391146 -0.46382690 0.62564464 #> [13] 2.06690481 -1.54885308 0.51950689 -1.84221997 -0.73122263 0.06756409 #> [19] 0.50926298 -0.85004165 #> #> $diff #> [1] 0.039811957 0.100207458 -0.125457865 0.098925976 0.144370781 #> [6] -0.285286268 -0.098237873 -0.059365938 -0.094498383 0.039932084 #> [11] 0.007327671 0.041972535 0.044977266 0.160437129 0.008247733 #> [16] -0.068382455 0.036402739 -0.296179443 0.004777528 0.085395213 #> #> $se #> [1] 0.02769502 #> #> $lower #> [1] -0.3395950 -0.1772907 #> #> $upper #> [1] 0.1558285 0.3181328 #>