blandAltman | R Documentation |
Agreement between two continuous measurements is usually assessed by plotting the difference vs. the mean of the two measurements, the so-called Bland-Altman plot. Methods can be used interchangeably if all observations in the Bland-Altman lie between the mean +/- two standard deviations, provided that differences in this range were not clinically important. Note that the function requires pairwise observations.
blandAltman(
x,
y,
conf.level = 0.95,
group = NULL,
xlab = "average of measurements",
ylab = "difference of measurements",
main = "",
ylim = NULL,
plot = TRUE
)
x |
Measurements of first method. |
y |
Measurements of second method. Must have the same length as |
conf.level |
Confidence level for confidence intervals around the limits of agreement. The default value is 0.95. |
group |
Factor that enables different colors for points (e.g. to group observations by observation date). |
xlab |
Label for x-axis. |
ylab |
Label for y-axis. |
main |
Title of the plot. |
ylim |
Vector of length 2 containing upper and lower limits of the y-axis. |
plot |
If |
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 |
|
Kaspar Rufibach, kaspar.rufibach@gmail.com
Bland, J.M. and Altman, D.G. (1986). Statistical methods for assessing agreement between two methods of clinical measurement. Lancet, 1, 307–310.
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,
xlab = "mean of measurements", ylab = "difference of measurements",
main = "Assess agreement between measurement 1 and measurement 2")
blandAltman(x = meas1, y = meas2, conf.level = 0.95, group = time,
xlab = "mean of measurements", ylab = "difference of measurements",
main = "Assess agreement between measurement 1 and measurement 2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.