Learn R Programming

MethComp (version 1.30.0)

PBreg: Passing-Bablok regression

Description

Implementation of the Passing-Bablok's procedure for assessing of the equality of measurements by two different analytical methods.

Usage

PBreg(x, y = NULL, conf.level = 0.05, wh.meth = 1:2)

Value

PBreg returns an object of class "PBreg", for which the print, predict and plot methods are defined.

An object of class "PBreg" is a list composed of the following elements:

coefficients

a matrix of 3 columns and 2 rows, containing the estimates of the intercept and slope, along with their confidence boundaries.

residuals

defined as in the "lm" class, as the response minus the fitted value.

fitted.values

the fitted values.

model

the model data frame used.

n

a vector of two values: the number of observations read, and the number of observations used.

S

A vector of all slope estimates.

I

A vector of all intercept estimates.

adj

A vector of fit parameters, where Ss is the number of estimated slopes (length(S)), K is the offset for slopes <(-1), M1 and M2 are the locations of confidence boundaries in S, and l and L are the numbers of points above and below the fitted line, used in cusum calculation.

cusum

A vector of cumulative sums of residuals sorted by the D-rank.

Di

A vector of D-ranks.

Arguments

x

a Meth object, alternatively a numeric vector of measurements by method A, or a data frame of exactly two columns, first column with measurements by method A, second column with measurements by method B.

y

a numeric vector of measurements by method B - must be of the same length as x. If not provided, x must be the Meth object or a data frame of exactly 2 columns.

conf.level

confidence level for calculation of confidence boundaries - 0.05 is the default.

wh.meth

Which of the methods from the Meth object are used in the regression.

Author

Michal J. Figurski mfigrs@gmail.com

Details

This is an implementation of the original Passing-Bablok procedure of fitting unbiased linear regression line to data in the method comparison studies. It calcualtes the unbiased slope and intercept, along with their confidence intervals. However, the tests for linearity is not yet fully implemented.

It doesn't matter which results are assigned to "Method A" and "Method B", however the "Method A" results will be plotted on the x-axis by the plot method.

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

plot.PBreg, predict.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)

  ## A real data example
  data(milk)
  milk <- Meth(milk)
  summary(milk)
  PBmilk <- PBreg(milk)
  par(mfrow=c(2,2))
  plot(PBmilk, s=1:4)

Run the code above in your browser using DataLab