tolfactor: Tolerance factor for linear regression

Description Usage Arguments Value Examples

Description

Tolerance factor for linear regression

Usage

1
tolfactor(X, xnew, p = 0.9, alpha = 0.05, side = "one-sided", ...)

Arguments

X

model matrix

xnew

new values of the predictors

p

proportion to be covered by the tolerance interval

alpha

significance level

side

either "one-sided" or "two-sided"

...

arguments passed to uniroot if side="two-sided", otherwise ignored

Value

A number, the tolerance factor. If side="two-sided", some attributes are set, the components of the output of uniroot.

Examples

1
2
3
4
5
6
fit <- lm(mpg ~ disp+drat, data = mtcars)
tolfactor(model.matrix(fit), xnew=c(1, 160, 4), side="two-sided") 
data(KM31)
fit <- lm(y ~ x1+x2, data = KM31)
tolfactor(model.matrix(fit), xnew=c(1, 88, 9), side="one-sided")
tolfactor(model.matrix(fit), xnew=c(1, 88, 9), side="two-sided")$root

stla/regtolerance documentation built on May 14, 2019, 3:04 p.m.