Learn R Programming

MethComp (version 1.22.2)

plot.PBreg: Passing-Bablok regression - plot method

Description

A plot method for the "PBreg" class object, that is a result of Passing-Bablok regression.

Usage

"plot"(x, pch=21, bg="#2200aa33", xlim=c(0, max(x$model)), ylim=c(0, max(x$model)), xlab=x$meths[1], ylab=x$meths[2], subtype=1, colors = list(CI = "#ccaaff50", fit = "blue", ref = "#99999955", bars = "gray", dens = "#8866aaa0", ref2 = c("#1222bb99", "#bb221299")), ...)

Arguments

x
an object of class "PBreg"
pch
Which plotting character should be used for the points.
bg
Background colour for the plotting character.
xlim
Limits for the x-axis.
ylim
Limits for the y-axis.
xlab
Label on the x-axis.
ylab
Label on the y-axis.
subtype
a numeric value or vector, that selects the desired plot subtype. Subtype 1 is an x-y plot of raw data with regression line and confidence boundaries for the fit as a shaded area. This is the default. Subtype 2 is a ranked residuals plot. Subtype 3 is the "Cusum" plot useful for assessing linearity of the fit. Plot subtypes 1 through 3 are standard plots from the 1983 paper by Passing and Bablok - see the reference. Plot subtype 4 is a histogram (with overlaid density line) of the individual slopes. The range of this plot is limited to 5 x IQR for better visibility.
colors
A list of 6 elements allowing customization of colors of various plot elements. For plot subtype 1: "CI" is the color of the shaded confidence interval area; and "fit" is the color of fit line. For plot subtypes 2 & 3: "ref" is the color of the horizontal reference line. For plot subtype 4: "bars" is the bar background color, "dens" is the color of the density line, and "ref2" is a vector of two colors for lines indicating the median and confidence limits.
...
other parameters as in "plot", some of which are pre-defined for improved appearance. This affects only the subtype 1 plot.

References

Passing, H. and Bablok, W. (1983), A New Biometrical Procedure for Testing the Equality of Measurements from Two Different Analytical Methods. Journal of Clinical Chemistry and Clinical Biochemistry, Vol 21, 709--720

See Also

PBreg, Deming.

Examples

Run this code
  ## Model data frame generation
  a <- data.frame(x=seq(1, 30)+rnorm(mean=0, sd=1, n=30),
                  y=seq(1, 30)*rnorm(mean=1, sd=0.4, n=30))

  ## Call to PBreg
  x <- PBreg(a)
  print(x)
  par(mfrow=c(2,2))
  plot(x, s=1:4)

  ## Or the same using "Meth" object
  a <- Meth(a, y=1:2)
  x <- PBreg(a)
  print(x)
  par(mfrow=c(2,2))
  plot(x, s=1:4)

Run the code above in your browser using DataLab