Learn R Programming

MethComp (version 1.22.2)

predict.PBreg: Passing-Bablok regression - predict method

Description

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

Usage

"predict"(object, newdata = object$model$x, interval="confidence", level=0.95,...)

Arguments

object
an object of class "PBreg"
newdata
an optional vector of new values of x to make predictions for. If omitted, the fitted values will be used.
interval
type of interval calculation - either confidence or none. The former is the default.
level
tolerance/confidence level.
...
Not used.

Value

If interval is "confidence" this function returns a data frame with three columns: "fit", "lwr" and "upr" - similarly to predict.lm.If interval is "none" a vector of predicted values is returned.

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)
  predict(x, interval="none")

  ## Or the same using "Meth" object
  a <- Meth(a, y=1:2)
  x <- PBreg(a)
  print(x)
  predict(x)

Run the code above in your browser using DataLab