Learn R Programming

arkhe (version 1.10.0)

confidence_binomial: Confidence Interval for Binomial Proportions

Description

Computes a Wald interval for a proportion at a desired level of significance.

Usage

confidence_binomial(object, ...)

# S4 method for numeric confidence_binomial( object, n, level = 0.95, method = "wald", corrected = FALSE )

Value

A length-two numeric vector giving the lower and upper confidence limits.

Arguments

object

A numeric vector giving the number of success.

...

Currently not used.

n

A length-one numeric vector giving the number of trials.

level

A length-one numeric vector giving the confidence level. Must be a single number between \(0\) and \(1\).

method

A character string specifying the method to be used. Any unambiguous substring can be used.

corrected

A logical scalar: should continuity correction be used? Only used if method is "wald".

Author

N. Frerebeau

See Also

Other summary statistics: confidence_mean(), confidence_multinomial(), interval_credible(), interval_hdr()

Examples

Run this code
## Confidence interval for a mean
x <- seq(from = -4, to = 4, by = 0.01)
y <- dnorm(x)

confidence_mean(y, type = "student")
confidence_mean(y, type = "normal")

## Confidence interval for a propotion
confidence_binomial(118, n = 236)

x <- c(35, 74, 22, 69)
confidence_multinomial(x)

Run the code above in your browser using DataLab