lmpredint: Prediction intervals to contain at least k out of m future...

Description Usage Arguments Value References See Also Examples

View source: R/lmpredint.R

Description

Calculates parametric and non-parametric prediction intervals to contain at least k out of m future observations given a linear model fit of class lm

Usage

1
2
lmpredint(object, newdata, k, level = 0.95, alternative="two.sided", 
          quantile=NULL, absError=0.001, interval=c(0, 100))

Arguments

object

Object of class inheriting from "lm".

newdata

A data frame in which to look for variables with which to predict.

k

Number of future observations contained in the interval. k must be smaller than the number of rows of newdata.

level

Confidence level

alternative

One of "two.sided", "less", or "greater" to calculate two- or one-sided intervals

quantile

Supply a user-defined quantile

absError

The maximum absolute error tolerated when calculating the quantile

interval

Root finding interval for calculating the quantile

Value

An object inheriting from class PIlm

References

Odeh, RE (1990): 2-Sided prediction intervals to contain at least k out of m future observations from a normal distribution. Technometric 32(2): 203-216.

See Also

predint, predict.lm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# example from predict.lm
x <- rnorm(15)
y <- x + rnorm(15)
new <- data.frame(x = seq(-3, 3, 0.5))
m <- lm(y ~ x)

# prediction intervals to 
# contain at least 10 of 13 future observations
lmpredint(m, newdata=new, k=10)

# for a single prediction
new1 <- data.frame(x = -3)
# the prediction intervals of lmpredint
lmpredint(m, newdata=new1, k=1, absError=0.00001)
# agrees with
predict(m, newdata=new1, interval="prediction")

predIntervals documentation built on May 2, 2019, 4:34 p.m.