BlandAltman {MethComp}R Documentation

Bland-Altman plot of differences versus averages.

Description

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.

Usage

  BlandAltman(x, y,
            x.name = NULL,
            y.name = NULL,
           maintit = "",
               cex = 1,
               pch = 16,
        col.points = "black",
         col.lines = "blue",
              limx = NULL,
              limy = NULL,
              ymax = NULL,
              eqax = FALSE,
              xlab = NULL,
              ylab = NULL,
             print = TRUE,
          conf.int = FALSE,
          reg.line = FALSE,
            digits = 2,
              mult = FALSE,
             alpha = 0.05,
               ... )

Arguments

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.
limy y-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 intervals for the mean difference and the limits of agreement be plotted too?
reg.line If TRUE, the regression line of x-y on (x+y)/2 is drawn. If numerical the regression equation is printed with the given number of digits after the decimal points.
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.
mult Logical. Should data be log-transformed and reporting be on a multiplicative scale?
alpha 1 minus confidence level used when computing confidence intervals and limits of agreement. If omitted the standard value of 2 is used instead of the t(1-alpha/2) quantile.
... Further arguments passed on the the plot() function making the plot.

Value

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.

Author(s)

Bendix Carstensen bxc@steno.dk, http://www.biostat.ku.dk/~bxc based on work by Jaro Lajovic,jaro.lajovic@mf.uni-lj.si, 2004.

References

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.

See Also

BA.plot, MethComp.

Examples

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 )

[Package MethComp version 0.3.0 Index]