Learn R Programming

MethComp (version 1.30.2)

plot.MethComp: Summarize conversion equations and prediction intervals between methods.

Description

plot.MethComp plots the conversion function with prediction limits; always using the original scale of measurements. It also sets the options "MethComp.wh.cmp" indicating which two methods are plotted and "MethComp.pl.type" indicating whether a plot of methods against each other or a Bland-Altman type plot of differences versus averages. By default the conversion lines are plotted.

Usage

# S3 method for MethComp
plot(
  x,
  wh.comp = 1:2,
  pl.type = "conv",
  dif.type = "lin",
  sd.type = "const",
  axlim = range(x$data$y, na.rm = TRUE),
  diflim = axlim - mean(axlim),
  points = FALSE,
  repl.conn = FALSE,
  col.conn = "gray",
  lwd.conn = 1,
  grid = TRUE,
  N.grid = 10,
  col.grid = grey(0.9),
  lwd = c(3, 1, 1),
  col.lines = "black",
  col.points = "black",
  pch.points = 16,
  eqn = is.null(attr(x, "Transform")),
  col.eqn = col.lines,
  font.eqn = 2,
  digits = 2,
  mult = FALSE,
  alpha = NULL,
  ...
)

Value

MethComp returns a MethComp object, which is a list with three elements, Conv, a three-way array giving the linear conversion equations between methods, VarComp, a two-way array classified by methods and variance components and data, a copy of the original Meth object supplied --- see the description under BA.est.

A MethComp object has an attribute Transform, which is either NULL, or a named list with elements trans and inv, both of which are functions. The first is the transformation applied to measurements before analysis; the results are all given on the transformed scale. The second is the inverse transformation; this is only used when plotting the resulting relationship between methods.

The methods print, plot, lines and points return nothing.

Arguments

x

A MethComp object.

wh.comp

Numeric or character of length 2. Which two methods should be plotted.

pl.type

Character. If "conv" it will be a plot of two methods against each other, otherwise it will be a plot of the 1st minus the 2nd versus the average; a Bland-Altman type plot.

dif.type

Character. If "lin" (the default) a linear relationship between methods is allowed. Otherwise a constant difference is assumed and LoA can be indicated on the plot.

sd.type

Should the estimated dependence of the SD (from DA.reg be used when plotting prediction limits?

axlim

The extent of the axes of the measurements.

diflim

The extent of the axis of the differences.

points

Logical. Should the points be included in the plot.

repl.conn

Logical. Should replcate measurements be connected; this assumes linked replicates.

col.conn

Color of the lines connecting replicates.

lwd.conn

Width of the connection lines.

grid

Should there be a grid? If numerical, gridlines are drawn at these locations.

N.grid

Numeric. How many gridlines? If a vector of length>1, it will be taken as the position of the gridlines.

col.grid

Color of the gridlines.

lwd

Numerical vector of length 3. Width of the conversion line and the prediction limits.

col.lines

Color of the conversion lines.

col.points

Color of the points.

pch.points

Plot character for points.

eqn

Logical. Should the conversion equation be printed on the plot.

col.eqn

Color of the conversion formula

font.eqn

font for the conversion formula

digits

The number of digits after the decimal point in the conversion formulae.

mult

Logical. Should ratios be plotted on a log-scale instead of differences on a linear scale? See description of the argument for BA.plot.

alpha

1 minus the confidence level for the prediction interval. If not given, the prediction interval is constructed as plus/minus twice the SD.

...

Further arguments.

Author

Bendix Carstensen, Steno Diabetes Center, bendix.carstensen@regionh.dk .

Details

lines.MethComp and points.MethComp adds conversion lines with prediction limits and points to a plot.

See Also

BA.est AltReg MCmcmc

Examples

Run this code

data( ox )
BA.ox <- BA.est( ox, linked=TRUE )
print( BA.ox )
if (FALSE) {
AR.ox <- AltReg( ox, linked=TRUE  )
print( AR.ox )
plot( AR.ox ) }

Run the code above in your browser using DataLab