npregtol.int | R Documentation |
Provides 1-sided or 2-sided nonparametric regression tolerance bounds.
npregtol.int(x, y, y.hat, side = 1, alpha = 0.05, P = 0.99,
method = c("WILKS", "WALD", "HM"), upper = NULL,
lower = NULL, new = FALSE)
x |
A vector of values for the predictor variable. Currently, this function is only capable of handling a single predictor. |
y |
A vector of values for the response variable. |
y.hat |
A vector of fitted values extracted from a nonparametric smoothing routine. |
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). |
method |
The method for determining which indices of the ordered residuals will be used for the tolerance bounds.
|
upper |
The upper bound of the data. When |
lower |
The lower bound of the data. When |
new |
When |
npregtol.int
returns a data frame with items:
alpha |
The specified significance level. |
P |
The proportion of the population covered by the tolerance bound(s). |
x |
The values of the predictor variable. |
y |
The values of the response variable. |
y.hat |
The predicted value of the response for the fitted nonparametric smoothing routine. |
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 |
Young, D. S. (2013), Regression Tolerance Intervals, Communications in Statistics - Simulation and Computation, 42, 2040–2055.
loess
, nptol.int
, spline
## 95%/95% 2-sided nonparametric regression tolerance bounds
## for a sample of size 50.
set.seed(100)
x <- runif(50, 5, 45)
f1 <- function(x, b1, b2) b1 + (0.49 - b1)*exp(-b2*(x - 8)) +
rnorm(50, sd = 0.01)
y <- f1(x, 0.39, 0.11)
y.hat <- loess(y~x)$fit
out <- npregtol.int(x = x, y = y, y.hat = y.hat, side = 2,
alpha = 0.05, P = 0.95, method = "WILKS",
new = TRUE)
out
library(plotly)
plotly_regtol(tol.out = out , x = x , y = y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.