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"
, "clo
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).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