binom.coverage: Probability coverage for binomial confidence intervals

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/binom.coverage.R

Description

Determines the probability coverage for a binomial confidence interval.

Usage

1
binom.coverage(p, n, conf.level = 0.95, method = "all", ...)

Arguments

p

The (true) probability of success in a binomial experiment.

n

Vector of number of independent trials in the binomial experiment.

conf.level

The level of confidence to be used in the confidence interval.

method

Either a character string to be passed to binom.confint or a function that computes the upper and lower confidence bound for a binomial proportion. If a function is supplied, the first three arguments must be the same as binom.confint and the return value of the function must be a data.frame with column headers "method", "lower", and "upper". See binom.confint for available methods. Default is "all".

...

Additional parameters to be passed to binom.confint. Only used when method is either "bayes" or "profile"

Details

Derivations are based on the results given in the references. Methods whose coverage probabilities are consistently closer to 0.95 are more desireable. Thus, Wilson's, logit, and cloglog appear to be good for this sample size, while Jeffreys, asymptotic, and prop.test are poor. Jeffreys is a variation of Bayes using prior shape parameters of 0.5 and having equal probabilities in the tail. The Jeffreys' equal-tailed interval was created using binom.bayes using (0.5,0.5) as the prior shape parameters and type = "central".

Value

A data.frame containing the "method" used, "n", "p", and the coverage probability, C(p,n).

Author(s)

Sundar Dorai-Raj (sdorairaj@gmail.com)

References

L.D. Brown, T.T. Cai and A. DasGupta (2001), Interval estimation for a binomial proportion (with discussion), Statistical Science, 16:101-133.

L.D. Brown, T.T. Cai and A. DasGupta (2002), Confidence Intervals for a Binomial Proportion and Asymptotic Expansions, Annals of Statistics, 30:160-201.

See Also

binom.confint, binom.length

Examples

1
binom.coverage(p = 0.5, n = 50)

Example output

          method   p  n  coverage
1  agresti-coull 0.5 50 0.9350914
2     asymptotic 0.5 50 0.9350914
3          bayes 0.5 50 0.9350914
4        cloglog 0.5 50 0.9511261
5          exact 0.5 50 0.9671609
6          logit 0.5 50 0.9671609
7         probit 0.5 50 0.9350914
8        profile 0.5 50 0.9350914
9            lrt 0.5 50 0.9350914
10     prop.test 0.5 50 0.9671609
11        wilson 0.5 50 0.9350914

binom documentation built on May 2, 2019, 5:16 p.m.

Related to binom.coverage in binom...