Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

binomTestCoverage

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) = ∑_{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) = choose(n, x) p^x (1-p)^(n-x)

for x = 0, 1, 2, …, 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 (hpark03@email.wm.edu), 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

Examples

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

conf

Visualization and Analysis of Statistical Measures of Confidence

v1.7.0
GPL (<= 2)
Authors
Christopher Weld [aut, cre] (<https://orcid.org/0000-0001-5902-9738>), Hayeon Park [aut], Kexin Feng [aut], Heather Sasinowska [aut], Lawrence Leemis [aut], Andrew Loh [ctb], Yuan Chang [ctb], Brock Crook [ctb], Xin Zhang [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.