Last chance! 50% off unlimited learning
Sale ends in
BinomCI(x, n, conf.level = 0.95,
method = c("wilson", "wald", "agresti-coull", "jeffreys",
"modified wilson", "modified jeffreys",
"clopper-pearson", "arcsine", "logit", "witting", "pratt"),
rand = 123)
"wald"
, "wilson"
, "agresti-coull"
, "jeffreys"
,
"modified wilson"
, "modified jeffreys"
, "clopp
x == 0 | x == 1
and x == n-1 | x == n
as proposed by
Brown et al (2001).
The Clopper-Pearson interval is based on quantiles of corresponding beta
distributions. This is sometimes also called exact interval.
The arcsine interval is based on the variance stabilizing distribution for the binomial
distribution.
The logit interval is obtained by inverting the Wald type interval for the log odds.
The Witting interval (cf. Beispiel 2.106 in Witting (1985)) uses randomization to
obtain uniformly optimal lower and upper confidence bounds (cf. Satz 2.105 in
Witting (1985)) for binomial proportions.
For more details we refer to Brown et al (2001) as well as Witting (1985).
And so, which interval to choose? The Wald interval often has inadequate coverage, particularly for small n and values of p close to 0 or 1. Conversely, the Clopper-Pearson Exact method is very conservative and tends to produce wider intervals than necessary. Brown et al. recommends the Wilson or Jeffreys methods for small n and Agresti-Coull, Wilson, or Jeffreys, for larger n as providing more reliable coverage than the alternatives. Also note that the point estimate for the Agresti-Coull method is slightly larger than for other methods because of the way this interval is calculated.binom.test
, binconf
, MultinomCI
BinomCI(x=37, n=43, method=c("wald", "wilson", "agresti-coull", "jeffreys",
"modified wilson", "modified jeffreys", "clopper-pearson", "arcsine", "logit",
"witting", "pratt")
)
# the confidence interval computed by binom.test
# corresponds to the Clopper-Pearson interval
BinomCI(x=42, n=43, method="clopper-pearson")
binom.test(x=42, n=43)$conf.int
# all arguments are being recycled:
BinomCI(x=c(42, 35, 23, 22), n=43, method="wilson")
BinomCI(x=c(42, 35, 23, 22), n=c(50, 60, 70, 80), method="jeffreys")
Run the code above in your browser using DataLab