BlandAltman plot to assess agreement between two continuous variables
Description
Agreement between two continuous measurements is usually assessed by plotting the difference vs. the mean of the two measurements, the socalled BlandAltman plot. Methods can be used interchangeably if all observations in the BlandAltman lie between the mean +/ two standard deviations, provided that differences in this range were not clinically important. Note that the function automatically only uses pairwise complete observations.
Usage
1 2 
Arguments
x 
Measurements of first method. 
y 
Measurements of second method. 
conf.level 
Confidence level for confidence intervals around limitis of agreement. 
group 
Factor that enables different colors for points (e.g. to mark observations at different timepoints). 
labx 
Character string, label for xaxis. 
laby 
Character string, label for yaxis. 
maintit 
Main title of plot. 
limy 
2d vector containing upper and lower limit for scaling of yaxis. 
plot 
If 
Value
A list containing the following elements:
difference.mean 
Mean difference. 
difference.sd 
Standard deviation of differences. 
difference.se 
Standard error of mean differences. 
upper.agreement.limit 
Upper limit of agreement. 
lower.agreement.limit 
Lower limit of agreement. 
agreement.limit.se 
Standard error of limits of agreement. 
t.value 
tquantile used for computation of limits of agreement. 
Author(s)
Kaspar Rufibach
kaspar.rufibach@gmail.com
References
Bland, J.M. and Altman, D.G. (1986). Statistical methods for assessing agreement between two methods of clinical measurement. Lancet, 1, 307–310.
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14  n < 50
meas1 < rnorm(n, 20, 4)
meas2 < meas1 + rnorm(n, 0.5, 1)
time < sample(c(rep(1, n / 2), rep(2, n / 2)))
BlandAltman(x = meas1, y = meas2, conf.level = 0.95, group = NA, labx =
"mean of measurements", laby = "difference of measurements",
maintit = "Assess agreement between measurement 1 and measurement 2",
limy = NA)
BlandAltman(x = meas1, y = meas2, conf.level = 0.95, group = time, labx =
"mean of measurements", laby = "difference of measurements",
maintit = "Assess agreement between measurement 1 and measurement 2",
limy = NA)
