Learn R Programming

tolerance (version 3.0.0)

fidbintol.int: Fiducial-Based Tolerance Intervals for the Function of Two Binomial Proportions

Description

Provides 1-sided or 2-sided tolerance intervals for the function of two binomial proportions using fiducial quantities.

Usage

fidbintol.int(x1, x2, n1, n2, m1 = NULL, m2 = NULL, FUN, 
              alpha = 0.05, P = 0.99, side = 1, K = 1000, 
              B = 1000)

Value

fidbintol.int returns a list with two items. The first item (tol.limits) is a data frame with the following items:

alpha

The specified significance level.

P

The proportion of the population covered by this tolerance interval.

fn.est

A point estimate of the functional form of interest using the maximum likelihood estimates calculated with the inputted values of x1, x2, n1, and n2.

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.

The second item (fn) simply returns the functional form specified by FUN.

Arguments

x1

A value of observed "successes" from group 1.

x2

A value of observed "successes" from group 2.

n1

The total number of trials for group 1.

n2

The total number of trials for group 2.

m1

The total number of future trials for group 1. If NULL, then it is set to n1.

m2

The total number of future trials for group 2. If NULL, then it is set to n2.

FUN

Any reasonable (and meaningful) function taking exactly two arguments that we are interested in constructing a tolerance interval on.

alpha

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

P

The proportion of the population 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).

K

The number of fiducial quantities to be generated. The number of iterations should be at least as large as the default value of 1000. See Details for the definition of the fiducial quantity for a binomial proportion.

B

The number of iterations used for the Monte Carlo algorithm which determines the tolerance limits. The number of iterations should be at least as large as the default value of 1000.

Details

If \(X\) is observed from a \(Bin(n,p)\) distribution, then the fiducial quantity for \(p\) is \(Beta(X+0.5,n-X+0.5)\).

References

Clopper, C. J. and Pearson, E. S. (1934), The Use of Confidence or Fiducial Limits Illustrated in the Case of the Binomial, Biometrika, 26, 404--413.

Krishnamoorthy, K. and Lee, M. (2010), Inference for Functions of Parameters in Discrete Distributions Based on Fiducial Approach: Binomial and Poisson Cases, Journal of Statistical Planning and Inference, 140, 1182--1192.

Mathew, T. and Young, D. S. (2013), Fiducial-Based Tolerance Intervals for Some Discrete Distributions, Computational Statistics and Data Analysis, 61, 38--49.

See Also

fidnegbintol.int, fidpoistol.int

Examples

Run this code
## 95%/99% 1-sided and 2-sided tolerance intervals for 
## the difference between binomial proportions.

set.seed(100)

p1 <- 0.2
p2 <- 0.4
n1 <- n2 <- 200
x1 <- rbinom(1, n1, p1)
x2 <- rbinom(1, n2, p2)
fun.ti <- function(x, y) x - y

fidbintol.int(x1, x2, n1, n2, m1 = 500, m2 = 500, FUN = fun.ti,
              alpha = 0.05, P = 0.99, side = 1)
fidbintol.int(x1, x2, n1, n2, m1 = 500, m2 = 500, FUN = fun.ti,
              alpha = 0.05, P = 0.99, side = 2)
              

Run the code above in your browser using DataLab