Learn R Programming

tolerance (version 3.0.0)

K.factor.sim: Estimating K-factors for Simultaneous Tolerance Intervals Based on Normality

Description

Estimates k-factors for simultaneous tolerance intervals based on normality.

Usage

K.factor.sim(n, l = NULL, alpha = 0.05, P = 0.99, side = 1, 
         method = c("EXACT", "BONF"), m = 50)

Value

K.factor returns the k-factor for simultaneous tolerance intervals based on normality with the arguments specified above.

Arguments

n

If method = "EXACT", this is the sample size of each of the l groups. If method = "BONF", then n can be a vector of different sample sizes for the l groups.

l

The number of normal populations for which the k-factors will be constructed simultaneously. If NULL, then it is taken to be the length of n.

alpha

The level chosen such that 1-alpha is the confidence level.

P

The proportion of the population to be covered by the tolerance interval.

side

Whether a k-factor for a 1-sided or 2-sided tolerance interval is required (determined by side = 1 or side = 2, respectively).

method

The method for calculating the k-factors. "EXACT" is an exact method that can be used when all l groups have the same sample size. "BONF" is an approximate method using the Bonferroni inequality, which can be used when the l groups have different sample sizes.

m

The maximum number of subintervals to be used in the integrate function. This is necessary only for method = "EXACT". The larger the number, the more accurate the solution. Too low of a value can result in an error. A large value can also cause the function to be slow for method = "EXACT".

References

Krishnamoorthy, K. and Mathew, T. (2009), Statistical Tolerance Regions: Theory, Applications, and Computation, Wiley.

Mee, R. W. (1990), Simultaneous Tolerance Intervals for Normal Populations with Common Variance, Technometrics, 32, 83-92.

See Also

integrate, K.factor

Examples

Run this code
## Reproducing part of Table B5 from Krishnamoorthy and 
## Mathew (2009).

n_sizes <- c(2:20, seq(30, 100, 10))
l_sizes <- 2:10
KM_table <- sapply(1:length(l_sizes), function(i)
                   sapply(1:length(n_sizes), function(j)
                   round(K.factor.sim(n = n_sizes[j], 
                   l = l_sizes[i], side=1, alpha = 0.1, 
                   P = 0.9),3)))
dimnames(KM_table) <- list(n = n_sizes, l = l_sizes)
KM_table

Run the code above in your browser using DataLab