Description Usage Arguments Value References See Also Examples
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
1 2 |
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 |
An object inheriting from class
PIlm
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.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.