plotpbreg: Passing-Bablok regression - plot method

Description Usage Arguments Author(s) References See Also Examples

Description

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

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'PBreg'
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.

Author(s)

Michal J. Figurski mfigrs@gmail.com

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
  ## 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)

Example output

Loading required package: nlme

Passing-Bablok linear regression of y on x 

Observations read: 30, used: 30
Slopes calculated: 435, offset: 29

            Estimate     2.5%CI  97.5%CI
Intercept -0.5664553 -2.8516891 1.277954
Slope      0.9831395  0.7948791 1.308227

Unadjusted summary of slopes:
     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
 -56.7486    0.4679    0.9239    3.4681    1.4893 1077.7566 

Summary of residuals:
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
-10.2957  -1.9124   0.0000   0.5854   4.1432  10.9873 

Test for linearity: (passed)
Linearity test not fully implemented in this version.

The following variables from the dataframe
"a" are used as the Meth variables:   
   y: x y 
       #Replicates
Method          1 #Items #Obs: 60 Values:  min      med      max
     x         30     30       30     1.466140 15.79530 29.90449
     y         30     30       30     1.858824 16.54855 28.85836

Passing-Bablok linear regression of y on x 

Observations read: 30, used: 30
Slopes calculated: 435, offset: 29

            Estimate     2.5%CI  97.5%CI
Intercept -0.5664553 -2.8516891 1.277954
Slope      0.9831395  0.7948791 1.308227

Unadjusted summary of slopes:
     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
 -56.7486    0.4679    0.9239    3.4681    1.4893 1077.7566 

Summary of residuals:
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
-10.2957  -1.9124   0.0000   0.5854   4.1432  10.9873 

Test for linearity: (passed)
Linearity test not fully implemented in this version.

MethComp documentation built on May 2, 2019, 5:06 p.m.

Related to plotpbreg in MethComp...