binom.conf.int: Confidence interval for the binomial parameter p

View source: R/binom.conf.int.r

binom.conf.intR Documentation

Confidence interval for the binomial parameter p

Description

Confidence interval for the binomial parameter p

Usage

binom.conf.int(
  x,
  n,
  proc = c("wald", "arcsine", "wilson", "clopper-pearson"),
  conf.level = 0.95,
  correct = FALSE
)

Arguments

x

number of successes

n

number of Bernoulli trials

proc

which confidence interval procedure to use

conf.level

confidence level for the returned confidence interval

correct

a logical indicating whether continuity correction should be applied

Details

The Wald procedure is the textbook procedure for confidence intervals. Arcsine procedure is obtained through the variance stabilizing transformation arcsine(sqrt(p)). Wilson and Clopper-Pearson procedures are obtained through the functions prop.test and binom.test respectively.

Value

a numeric vector of length 2, giving the bounds of the confidence interval

Examples

binom.conf.int(4, 10, "wald")
binom.conf.int(4, 10, "wilson")
binom.conf.int(4, 10, "arcsine")
binom.conf.int(4, 10, "clopper")

HervePerdry/M1SP documentation built on Dec. 16, 2024, 8:19 p.m.