MCResult.plotDifference: Bland-Altman Plot

View source: R/MCResultMethods.r

MCResult.plotDifferenceR Documentation

Bland-Altman Plot

Description

Draw different Bland-Altman plot modifications (see parameter plot.type).

Usage

MCResult.plotDifference(
  .Object,
  xlab = NULL,
  ylab = NULL,
  ref.line = TRUE,
  ref.line.col = "black",
  ref.line.lty = 1,
  ref.line.lwd = 1,
  bias.line.lty = 1,
  bias.line.lwd = 1,
  bias.line.col = "red",
  bias.text.col = NULL,
  bias.text.cex = 0.8,
  loa.line.lty = 2,
  loa.line.lwd = 1,
  loa.line.col = "red",
  loa.text.col = NULL,
  plot.type = 3,
  main = NULL,
  cex = 0.8,
  digits = 2,
  add.grid = TRUE,
  ylim = NULL,
  ...
)

Arguments

.Object

object of class "MCResult".

xlab

label for the x-axis

ylab

label for the y-axis

ref.line

logical value. If ref.line=TRUE (default), the reference line will be drawn.

ref.line.col

reference line color.

ref.line.lty

reference line type.

ref.line.lwd

reference line width.

bias.line.lty

line type for estimated bias.

bias.line.lwd

line width for estimated bias.

bias.line.col

color of the line for estimated bias.

bias.text.col

color of the label for estimated bias (defaults to the same as bias.line.col.)

bias.text.cex

The magnification to be used for the label for estimated bias

loa.line.lty

line type for estimated limits of agreement.

loa.line.lwd

line width for estimated limits of agreement.

loa.line.col

color of the line for estimated limits of agreement.

loa.text.col

color of the label for estimated limits of agreement (defaults to the same as loa.line.col.)

plot.type

integer specifying a specific Bland-Altman plot modification (default is 3). Possible choices are: 1 - difference plot X vs. Y-X with null-line and mean plus confidence intervals.
2 - difference plot X vs. (Y-X)/X (relative differences) with null-line and mean.
3 - difference plot 0.5*(X+Y) vs. Y-X with null-line and mean plus confidence intervals.
4 - difference plot 0.5*(X+Y) vs. (Y-X)/X (relative differences) with null-line.
5 - difference plot rank(X) vs. Y-X with null-line and mean plus confidence intervals.
6 - difference plot rank(X) vs. (Y-X)/X (relative differences) with null-line and mean.
7 - difference plot sqrt(X*Y) vs. Y/X with null-line and mean plus confidence intervals calculated with help of log-transformation.
8 - difference plot 0.5*(X+Y) vs. (Y-X) / (0.5*(X+Y)) with null-line.

main

plot title.

cex

numeric value specifying the magnification factor used for points

digits

number of decimal places for the difference of means and standard deviation appearing in the plot.

add.grid

logical value. If add.grid=TRUE (Default) gridlines will be drawn.

ylim

limits for the y-axis

...

further graphical parameters

Value

No return value, instead a plot is generated

References

Bland, J. M., Altman, D. G. (1986) Statistical methods for assessing agreement between two methods of clinical measurement. Lancet, i: 307–310.

See Also

plot.mcr, plotResiduals, plotDifference, plotBias, compareFit

Examples

    #library("mcr")
    data(creatinine,package="mcr")
    x <- creatinine$serum.crea
    y <- creatinine$plasma.crea

    # Deming regression fit.
    # The confidence intercals for regression coefficients
    # are calculated with analytical method
    model <- mcreg( x,y,error.ratio=1,method.reg="Deming", method.ci="analytical",
                     mref.name = "serum.crea", mtest.name = "plasma.crea", na.rm=TRUE )

    plotDifference( model ) # Default plot.type=3
    plotDifference( model, plot.type=5)
    plotDifference( model, plot.type=7, ref.line.lty=3, ref.line.col="green3" )

mcr documentation built on Sept. 23, 2024, 5:10 p.m.