Learn R Programming

tolerance (version 1.2.0)

neghypertol.int: Negative Hypergeometric Tolerance Intervals

Description

Provides 1-sided or 2-sided tolerance intervals for negative hypergeometric random variables. When sampling without replacement, these limits are on the total number of expected draws in a future sample in order to achieve a certain number from group A (e.g., "black balls" in an urn).

Usage

neghypertol.int(x, n, N, m = NULL, alpha = 0.05, P = 0.99, side = 1, method = c("EX", "LS", "CC"))

Arguments

x
The number of units drawn in order to achieve n successes. Can be a vector, in which case the sum of x is used.
n
The target number of successes in the sample drawn (e.g., the number of "black balls" you are to draw in the sample).
N
The population size (e.g., the total number of balls in the urn).
m
The target number of successes to be sampled from the universe for a future study. If m = NULL, then the tolerance limits will be constructed assuming n for this quantity.
alpha
The level chosen such that 1-alpha is the confidence level.
P
The proportion of units from group A 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 "EX", which is an exact-based method. "LS" is the large-sample method. "CC" gives a continuity-corrected version of the large-sample method.

Value

neghypertol.int returns a data frame with items:
alpha
The specified significance level.
P
The proportion of units from group A in future samples of size m.
rate
The sampling rate determined by x/N.
p.hat
The proportion of units in the sample from group A, calculated by n/x.
1-sided.lower
The 1-sided lower tolerance bound. This is given only if side = 1.
1-sided.upper
The 1-sided upper tolerance bound. This is given only if side = 1.
2-sided.lower
The 2-sided lower tolerance bound. This is given only if side = 2.
2-sided.upper
The 2-sided upper tolerance bound. This is given only if side = 2.

References

Khan, R. A. (1994), A Note on the Generating Function of a Negative Hypergeometric Distribution, Sankhya: The Indian Journal of Statistics, Series B, 56, 309--313.

Young, D. S. (2014), Tolerance Intervals for Hypergeometric and Negative Hypergeometric Variables, Sankhya: The Indian Journal of Statistics, Series B, to appear.

See Also

acc.samp, NegHypergeometric

Examples

Run this code
## 90%/95% 1-sided and 2-sided negative hypergeometric 
## tolerance intervals for a future number of 300 successes
## when the universe is of size 1000.  The estimates are 
## based on having drawn 425 in another sample to achieve 
## 200 successes.

neghypertol.int(425, 200, 1000, m = 300, alpha = 0.05, 
                P = 0.95, side = 1, method = "LS")
neghypertol.int(425, 200, 1000, m = 300, alpha = 0.05, 
                P = 0.95, side = 1, method = "CC")

neghypertol.int(425, 200, 1000, m = 300, alpha = 0.05, 
                P = 0.95, side = 2, method = "LS")
neghypertol.int(425, 200, 1000, m = 300, alpha = 0.05, 
                P = 0.95, side = 2, method = "CC")

Run the code above in your browser using DataLab