binom.CI: Confidence intervals for binomial counts or proportions

Description Usage Arguments Details Value References See Also Examples

View source: R/binom.CI.R

Description

Calculates confidence intervals for binomial counts or proportions

Usage

1
2
binom.CI(x, n, conf.level = 0.95, type = c("wilson", "exact",
  "approximate"))

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.

type

Possible values are "wilson", "exact" and "approximate". See details.

Details

binom.CI with type "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.

binom.CI with type "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.

binom.CI with type "approximate" 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.

This function is a clone from epitools binomial confidence intervals functions, but with a wrapper to include the method as an option instead of separate functions.

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

References

Tomas Aragon, et al. Applied Epidemiology Using R.

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

See Also

binom.test, SS, diagnosis

Examples

1
2
3
binom.CI(1:10, seq(10, 100, 10), type = "exact")
binom.CI(1:10, seq(10, 100, 10), type = "wilson")
binom.CI(1:10, seq(10, 100, 10), type = "approximate")

DiagnosisMed documentation built on May 2, 2019, 5:21 p.m.