BA.plot {MethComp}R Documentation

Bland-Altman plot for dataframes

Description

Computes limits of agreement and produces a Bland-Altman plot of differences versus averages for two methods of measurement. The function is just a wrapper allowing a dataframe with columns item, meth and y (and possibly repl) to be used as input to a Bland-Altman plot, using BlandAltman.

Usage

  BA.plot( y1, y2, meth.names = NULL,
           mean.repl = FALSE, comp.levels=1:2, ...)
  

Arguments

y1 Measurements by method 1. Alternatively a dataframe with columns meth, item, y, and possibly repl.
y2 Corresponding measurements by method 2. Ignored if y1 is a dataframe.
meth.names Names for the two methods. Used for annotation of the plot. If not supplied and y1 is a dataframe this is derived from the factor level names of meth.
mean.repl Logical. If there are replicate measurements by each method should the means by item and meth be formed before further ado. WARNING: This will give too narrow limits of agreement.
comp.levels Levels of the meth factor to compare. May be used to switch the order of the methods compared by specifying comp.meth=2:1.
... Further arguments passed on the the BlandAltman function.

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.

Side effect: A Bland-Altman plot is produced using the function BlandAltman.

Author(s)

Bendix Carstensen, Steno Diabetes Center, http://www.biostat.ku.dk/~bxc

References

JM Bland and DG Altman: Statistical methods for assessing agreement between two methods of clinical measurement, Lancet, i, 1986, pp. 307-10

See Also

BlandAltman, MethComp

Examples

data( ox )
str( ox )
# A wrong and a correct plot of the data.
par( mfrow=c(1,2), mar=c(4,4,1,4) )
BA.plot( ox, mean.repl=TRUE , ymax=30 )  # Too narrow limits
BA.plot( ox, mean.repl=FALSE, ymax=30 ) # (Almost) correct limits
# The same illustrating the use of method names
par( mfrow=c(1,2), mar=c(4,4,1,4) )
BA.plot( ox, mean.repl=TRUE , meth.names=c("one","two"), ymax=30 )
BA.plot( ox, mean.repl=FALSE, meth.names=c("one","two"), ymax=30 )

[Package MethComp version 0.1.1 Index]