Computes the quantities required for a Bland-Altman agreement analysis.
Usage
blandAltmanData(x, ...)
# Default S3 method
blandAltmanData(x, y, conf.level = 0.95, na.rm = FALSE, ...)
# S3 method for class 'formula'
blandAltmanData(x, data = NULL, conf.level = 0.95, na.rm = FALSE, ...)Arguments
- x
numeric vector or formula
- ...
further arguments passed to or from other methods
- y
numeric vector
- conf.level
confidence level for the intervals reported for the bias and the limits of agreement
- na.rm
logical; if
TRUE, incomplete observation pairs are removed before computation- data
optional data frame used with the formula interface
Value
an object of class "BlandAltman" with components:
meanpairwise means
diffpairwise differences (
y - x)biasmean difference
loaLowerlower limit of agreement
loaUpperupper limit of agreement
biasCIconfidence interval for the bias
loaLowerCIconfidence interval for the lower LoA
loaUpperCIconfidence interval for the upper LoA
nObsnumber of observations used
conf.levelthe confidence level used
Details
For each observation pair, the arithmetic mean and the difference
(y - x) are calculated. The function further computes the mean
difference (bias), limits of agreement (LoA), and approximate confidence
intervals for the bias and LoA according to Bland and Altman.
The returned object is of class "BlandAltman" and can be plotted
using by a plot() routine residing in the pharos package.
The limits of agreement are the conventional bias +/- 1.96 * sd,
independent of conf.level: the multiplier fixes the nominal
coverage of the interval of differences, whereas conf.level
governs the confidence intervals reported for the bias and for the two
limits. The standard error of a limit uses the approximation
\(\sqrt{3 s_d^2 / n}\) given by Bland and Altman.
References
Bland JM, Altman DG (1986). Statistical methods for assessing agreement between two methods of clinical measurement. Lancet, 327, 307-310.
See also
Other agreement:
normalizeToConfusion(),
raterFrame()
