predict: Predict results from PBreg object

Description Usage Arguments Value Author(s) Examples

Description

A predict 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'
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

String. The type of interval to compute. Either "tolerance" or "confidence" (the default).

...

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.

Author(s)

Michal J. Figurski mfigrs@gmail.com

Examples

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

MethComp documentation built on Jan. 20, 2020, 1:12 a.m.

Related to predict in MethComp...