regtol.int {tolerance} | R Documentation |
(Multiple) Linear Regression Tolerance Bounds
Description
Provides 1-sided or 2-sided (multiple) linear regression tolerance bounds. It is also possible to fit a regression through the origin model.
Usage
regtol.int(reg, new.x = NULL, side = 1, alpha = 0.05, P = 0.99, new = FALSE)
Arguments
reg |
An object of class |
new.x |
An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used. |
side |
Whether a 1-sided or 2-sided tolerance bound is required (determined by |
alpha |
The level chosen such that |
P |
The proportion of the population to be covered by the tolerance bound(s). |
new |
When |
Value
regtol.int
returns a data frame with items:
alpha |
The specified significance level. |
P |
The proportion of the population covered by the tolerance bound(s). |
y |
The value of the response given on the left-hand side of the model in |
y.hat |
The predicted value of the response for the fitted linear regression model. This data frame is sorted by this value. |
1-sided.lower |
The 1-sided lower tolerance bound. This is given only if |
1-sided.upper |
The 1-sided upper tolerance bound. This is given only if |
2-sided.lower |
The 2-sided lower tolerance bound. This is given only if |
2-sided.upper |
The 2-sided upper tolerance bound. This is given only if |
References
Wallis, W. A. (1951), Tolerance Intervals for Linear Regression, in Second Berkeley Symposium on Mathematical Statistics and Probability, ed. J. Neyman, Berkeley: University of CA Press, 43–51.
Young, D. S. (2013), Regression Tolerance Intervals, Communications in Statistics - Simulation and Computation, 42, 2040–2055.
See Also
Examples
## 95%/95% 2-sided linear regression tolerance bounds
## for a sample of size 100.
set.seed(100)
x <- runif(100, 0, 10)
y <- 20 + 5*x + rnorm(100, 0, 3)
out <- regtol.int(reg = lm(y ~ x), new.x = data.frame(x = c(3, 6, 9)),
side = 2, alpha = 0.05, P = 0.95)
out
plottol(out, x = cbind(1, x), y = y, side = "two", x.lab = "X",
y.lab = "Y")