# binomTestCoverage: Actual Coverage Calculation for Binomial Proportions In conf: Visualization and Analysis of Statistical Measures of Confidence

## 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

 ```1 2 3``` ``` 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.

`dbinom`

## Examples

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

### Example output

```[1] 0.995904
[1] 0.9894079
```

conf documentation built on Aug. 24, 2020, 5:08 p.m.