MCResult.plot: Scatter Plot Method X vs. Method Y

Description Usage Arguments See Also Examples

View source: R/MCResultMethods.r

Description

Plot method X (reference) vs. method Y (test) with (optional) line of identity, regression line and confidence bounds for response.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
MCResult.plot(x, alpha = 0.05, xn = 20, equal.axis = FALSE, xlim = NULL,
  ylim = NULL, x.lab = x@mnames[1], y.lab = x@mnames[2], add = FALSE,
  draw.points = TRUE, points.col = "black", points.pch = 1,
  points.cex = 0.8, reg = TRUE, reg.col = NULL, reg.lty = 1,
  reg.lwd = 2, identity = TRUE, identity.col = NULL, identity.lty = 2,
  identity.lwd = 1, ci.area = TRUE, ci.area.col = NULL,
  ci.border = FALSE, ci.border.col = NULL, ci.border.lty = 2,
  ci.border.lwd = 1, add.legend = TRUE, legend.place = c("topleft",
  "topright", "bottomleft", "bottomright"), main = NULL, sub = NULL,
  add.cor = TRUE, cor.method = c("pearson", "kendall", "spearman"),
  add.grid = TRUE, ...)

Arguments

x

object of class "MCResult".

alpha

numeric value specifying the 100(1-alpha)% confidence bounds.

xn

number of points (default 20) for calculation of confidence bounds.

draw.points

logical value. If draw.points=TRUE, the data points will be drawn.

xlim

limits of the x-axis. If xlim=NULL the x-limits will be calculated automatically.

ylim

limits of the y-axis. If ylim=NULL the y-limits will be calculated automatically.

x.lab

label of x-axis. Default is the name of reference method.

y.lab

label of y-axis. Default is the name of test method.

equal.axis

logical value. If equal.axis=TRUE x-axis will be equal to y-axis.

add

logical value. If add=TRUE, the plot will be drawn in current graphical window.

points.col

Color of data points.

points.pch

Type of data points (see par()).

points.cex

Size of data points (see par()).

reg

Logical value. If reg=TRUE, the regression line will be drawn.

reg.col

Color of regression line.

reg.lty

Type of regression line.

reg.lwd

The width of regression line.

identity

logical value. If identity=TRUE the identity line will be drawn.

identity.col

The color of identity line.

identity.lty

The type of identity line.

identity.lwd

the width of identity line.

ci.area

logical value. If ci.area=TRUE (default) the confidence area will be drawn.

ci.area.col

the color of confidence area.

ci.border

logical value. If ci.border=TRUE the confidence limits will be drawn.

ci.border.col

The color of confidence limits.

ci.border.lty

The line type of confidence limits.

ci.border.lwd

The line width of confidence limits.

add.legend

logical value. If add.legend=FALSE the plot will not have any legend.

legend.place

The position of legend: "topleft","topright","bottomleft","bottomright".

main

String value. The main title of plot. If main=NULL it will include regression name.

sub

String value. The subtitle of plot. If sub=NULL and ci.border=TRUE or ci.area=TRUE it will include the art of confidence bounds calculation.

add.cor

Logical value. If add.cor=TRUE the correlation coefficient will be shown.

cor.method

a character string indicating which correlation coefficient is to be computed. One of "pearson" (default), "kendall", or "spearman", can be abbreviated.

add.grid

Logical value. If add.grid=TRUE (default) the gridlines will be drawn.

...

further graphical parameters

See Also

plotBias, plotResiduals, plotDifference, compareFit,includeLegend

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(mcr)
 data(creatinine,package="mcr")
 creatinine <- creatinine[complete.cases(creatinine),]
  x <- creatinine$serum.crea
  y <- creatinine$plasma.crea

  m1 <- mcreg(x,y,method.reg="Deming",  mref.name="serum.crea",
                                        mtest.name="plasma.crea", na.rm=TRUE)
  m2 <- mcreg(x,y,method.reg="WDeming", method.ci="jackknife",
                                        mref.name="serum.crea",
                                        mtest.name="plasma.crea", na.rm=TRUE)

  plot(m1,  xlim=c(0.5,3),ylim=c(0.5,3), add.legend=FALSE,
                           main="Deming vs. weighted Deming regression",
                           points.pch=19,ci.area=TRUE, ci.area.col=grey(0.9),
                           identity=FALSE, add.grid=FALSE, sub="")
  plot(m2, ci.area=FALSE, ci.border=TRUE, ci.border.col="red3",
                           reg.col="red3", add.legend=FALSE,
                           draw.points=FALSE,add=TRUE)

  includeLegend(place="topleft",models=list(m1,m2),
                           colors=c("darkblue","red"), design="1", digits=2)

Example output

Jackknife based calculation of standard error and confidence intervals according to Linnet's method.

mcr documentation built on May 30, 2017, 6:15 a.m.