Learn R Programming

tolerance (version 0.4.0)

bintol.int: Binomial Tolerance Intervals

Description

Provides 1-sided or 2-sided tolerance intervals for binomial random variables. From a statistical quality control perspective, these limits use the proportion of defective (or acceptable) items in a sample to bound the number of defective (or acceptable) items in future productions of a specified quantity.

Usage

bintol.int(x, n, m, alpha = 0.05, P = 0.99, side = 1, 
           method = c("LS", "WS", "AC", "JF", "CP", "AS", 
           "LO"), a1 = 0.5, a2 = 0.5)

Arguments

x
The number of defective (or acceptable) units in the sample. Can be a vector of length n, in which case the sum of x is used.
n
The size of the random sample of units selected for inspection.
m
The quantity produced in future groups.
alpha
The level chosen such that 1-alpha is the confidence level.
P
The proportion of the defective (or acceptable) units in future samples of size m to be covered by this tolerance interval.
side
Whether a 1-sided or 2-sided tolerance interval is required (determined by side = 1 or side = 2, respectively).
method
The method for calculating the lower and upper confidence bounds, which are used in the calculation of the tolerance bounds. The default method is "LS", which is the large-sample method. "WS" is Wilson's method, which is jus
a1
This specifies the first shape hyperparameter when using Jeffreys' method.
a2
This specifies the second shape hyperparameter when using Jeffreys' method.

Value

  • bintol.int returns a data frame with items:
  • alphaThe specified significance level.
  • PThe proportion of defective (or acceptable) units in future samples of size m.
  • p.hatThe proportion of defective (or acceptable) units in the sample, calculated by x/n.
  • 1-sided.lowerThe 1-sided lower tolerance bound. This is given only if side = 1.
  • 1-sided.upperThe 1-sided upper tolerance bound. This is given only if side = 1.
  • 2-sided.lowerThe 2-sided lower tolerance bound. This is given only if side = 2.
  • 2-sided.upperThe 2-sided upper tolerance bound. This is given only if side = 2.

References

Brown, L. D., Cai, T. T., and DasGupta, A. (2001), Interval Estimation for a Binomial Proportion, Statistical Science, 16, 101--133. Hahn, G. J. and Chandra, R. (1981), Tolerance Intervals for Poisson and Binomial Variables, Journal of Quality Technology, 13, 100--110.

See Also

Binomial, umatol.int

Examples

Run this code
## 85\%/90\% 1-sided binomial tolerance limits for a future 
## lot of 500 when a sample of 40 were drawn from a lot of 
## 1000.  The Agresti-Coull, Clopper-Pearson, and large-sample
## methods are presented for comparison.

bintol.int(x = 40, n = 1000, m = 500, alpha = 0.15, P = 0.90,
           side = 1, method = "AC")
bintol.int(x = 40, n = 1000, m = 500, alpha = 0.15, P = 0.90,
           side = 1, method = "CP")
bintol.int(x = 40, n = 1000, m = 500, alpha = 0.15, P = 0.90,
           side = 1, method = "LS")

## Using Jeffreys' method to construct the 85\%/90\% 1-sided 
## binomial tolerance limits.  The first calculation assumes 
## a prior on the proportion of defects which places greater
## density on values near 0.  The second calculation assumes
## a prior on the proportion of defects which places greater
## density on values near 1.

bintol.int(x = 40, n = 1000, m = 500, alpha = 0.15, P = 0.90,
           side = 1, method = "JF", a1 = 2, a2 = 10)
bintol.int(x = 40, n = 1000, m = 500, alpha = 0.15, P = 0.90,
           side = 1, method = "JF", a1 = 5, a2 = 1)

Run the code above in your browser using DataLab