Confidence intervals for binomial counts or proportions

Share:

Description

Calculates confidence intervals for binomial counts or proportions

Usage

1
2
3
binom.exact(x, n, conf.level = 0.95)
binom.wilson(x, n, conf.level = 0.95)
binom.approx(x, n, conf.level = 0.95)

Arguments

x

number of successes in n trials, can be a vector

n

number of Bernoulli trials, can be a vector

conf.level

confidence level (default = 0.95), can be a vector

Details

The function, binom.exact, calculates exact confidence intervals for binomial counts or proportions. This function uses R's binom.test function; however, the arguments to this function can be numeric vectors of any length.

The function, binom.wilson, calculates confidence intervals for binomial counts or proportions using Wilson's formula which approximate the exact method. The arguments to this function can be numeric vectors of any length (Rothman).

The function, binom.approx, calculates confidence intervals for binomial counts or proportions using a normal approximation to the binomial distribution. The arguments to this function can be numeric vectors of any length.

Value

This function returns a n x 6 matrix with the following colnames:

x

number of successes in n trials

n

number of Bernoulli trials

prop

proportion = x/n

lower

lower confidence interval limit

upper

upper confidence interval limit

conf.level

confidence level

Note

Visit http://medepi.com for the latest.

Author(s)

Tomas Aragon, aragon@berkeley.edu, http://www.medepi.com

References

Tomas Aragon, et al. Applied Epidemiology Using R. Available at http://medepi.com

Kenneth Rothman (2002), Epidemiology: An Introduction, Oxford University Press, 1st Edition.

See Also

pois.exact, binom.test

Examples

1
2
3
binom.exact(1:10, seq(10, 100, 10))
binom.wilson(1:10, seq(10, 100, 10))
binom.approx(1:10, seq(10, 100, 10))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.