| BlandAltman {MethComp} | R Documentation |
For two vectors of equal length representing measurements of the same quantity by two different methods, the differences are plotted versus the average. The limits of agreement (prediction limits for the differences) are plotted, optionally with c.i.s.
BlandAltman(x, y,
x.name = NULL, y.name = NULL, maintit = "",
cex = 1, pch = 16, col.points = "black", col.lines = "blue",
limx=NULL, ymax=NULL, eqax=FALSE, xlab=NULL, ylab=NULL,
print = TRUE, conf.int = TRUE,
digits = 2, alpha = 0.05, mult=FALSE,
... )
x |
Numerical vector of measurements by 1st method. |
y |
Numerical vector of measurements by 2nd method. Must of same
length as x. |
x.name |
Label for the 1st method (x). |
y.name |
Label for the 2nd method (y). |
maintit |
Main title for the plot |
cex |
Character expansion for the points. |
pch |
Plot symbol for points. |
col.points |
Color for the points. |
col.lines |
Color for the lines indicating limits of agreement. |
limx |
x-axis limits. |
ymax |
Scalar. The y-axis will extend from -ymax to +ymax. |
eqax |
Logical. Should the range on x- and y- axes be the same? |
xlab |
x-axis label. |
ylab |
y-axis label. |
print |
Logical: Should the limits of agreement and the c.i.s of these be printed? |
conf.int |
Logical: Should confidence inetrvals for the mean difference and the limits of agreement be plotted too? |
digits |
How many decimal places should be used when printing limits of agreement? Used both for the printing of results and for annotation of the plot. |
alpha |
1 minus confidence level used when computing confidence intervals and limits of agreement. |
mult |
Logical. Should data be log-transformed and reporting be on a multiplicative scale? |
... |
Further arguments passed on the the plot() function making the plot. |
A list with 2 elements:
lim.agree |
A matrix of limits of agreement as rows and estimate and c.i. as columns. |
p.value |
P-value for the hypothesis that the mean difference is 0. Usually a lame thing to use. |
Jaro Lajovic,jaro.lajovic@mf.uni-lj.si, 2004; modified 2007 by Bendix Carstensen bxc@steno.dk, http://www.biostat.ku.dk/~bxc.
JM Bland and DG Altman: Statistical methods for assessing agreement between two methods of clinical measurement, Lancet, i, 1986, pp. 307-310.
JM Bland and DG Altman. Measuring agreement in method comparison studies. Statistical Methods in Medical Research, 8:136-160, 1999.
data( ox ) par( mfrow=c(1,2) ) # Wrong to use mean over replicates mtab <- with( ox, tapply( y, list(item, meth), mean ) ) CO <- mtab[,"CO"] pulse <- mtab[,"pulse"] BlandAltman( CO, pulse ) # (almost) Right to use replicates singly oxw <- to.wide( ox ) CO <- oxw[,"CO"] pulse <- oxw[,"pulse"] BlandAltman( CO, pulse, mult=TRUE ) BlandAltman( CO, pulse, eqax=TRUE )