binomTestCoverage: Actual Coverage Calculation for Binomial Proportions

View source: R/binomTestCoverage.R

binomTestCoverageR Documentation

Actual Coverage Calculation for Binomial Proportions

Description

Calculates the actual coverage of a confidence interval for a binomial proportion for a particular sample size n and a particular value of the probability of success p for several confidence interval procedures.

Usage

  binomTestCoverage(n, p,
                    alpha = 0.05,
                    intervalType = "Clopper-Pearson")

Arguments

n

sample size

p

population probability of success

alpha

significance level for confidence interval

intervalType

type of confidence interval used; either "Clopper-Pearson", "Wald", "Wilson-Score", "Jeffreys", "Agresti-Coull", "Arcsine", or "Blaker"

Details

Calculates the actual coverage of a confidence interval procedure at a particular value of p for

  • various types of confidence intervals,

  • various probabilities of success p, and

  • various sample sizes n.

The actual coverage for a particular value of p, the probability of success of interest, is

c(p) = \sum_{x=0}^n {I(x,p) {n \choose x} p^x (1-p)^{n-x}},

where I(x,p) is an indicator function that determines whether a confidence interval covers p when X = x (see Vollset, 1993).

The binomial distribution with arguments size = n and prob = p has probability mass function

p(x) = {n \choose x} p^x (1-p)^{n-x}

for x = 0, 1, 2, \ldots, n.

The algorithm for computing the actual coverage for a particular probability of success begins by calculating all possible lower and upper bounds associated with the confidence interval procedure specified by the intervalType argument. The appropriate binomial probabilities are summed to determine the actual coverage at p.

Author(s)

Hayeon Park (hpark031@gmail.com), Larry Leemis (leemis@math.wm.edu)

References

Vollset, S.E. (1993). Confidence Intervals for a Binomial Proportion. Statistics in Medicine, 12, 809-824.

See Also

dbinom

Examples

  binomTestCoverage(6, 0.4)
  binomTestCoverage(n = 10, p = 0.3, alpha = 0.01, intervalType = "Wilson-Score")

conf documentation built on Oct. 1, 2023, 1:07 a.m.