View source: R/statistical_tests_and_estimates.R
binom_ci | R Documentation |
Wrapper for binom::binom.confint
binom_ci(x, conf.level = 0.95, methods = "wilson", ...)
x |
vector of type integer (0/1) or logical (TRUE/FALSE) |
conf.level |
confidence level (between 0 and 1). Default is 0.95. |
methods |
which method to use to construct the interval. Any combination of c("exact", "ac", "asymptotic", "wilson", "prop.test", "bayes", "logit", "cloglog", "probit") is allowed or "all". Default is "wilson". |
... |
Additional arguments to be passed to binom::binom.bayes |
See binom::binom.confint for method details
data.frame with with mean (mean
), and bounds of confidence interval (lower
, upper
)
Returns a data frame with the following columns:
method
- method(s) selected
x
- number of successes in the binomial experiment
n
- number of independent trials in the binomial experiment
mean
- success proportion mean
lower
- success proportion lower bound
upper
- success proportion upper bound
x <- c(rep(0, 500), rep(1, 500))
binom_ci(x, conf.level = .90, methods = 'all')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.