ci_1pop_bern | R Documentation |
ci_1pop_bern
can be used for obtaining the confidence intervalo for a proportion for a group.
ci_1pop_bern(x, n = NULL, conf_level = 0.95, type = "two.sided", na.rm = F)
x |
a vector of counts of sucesses. |
n |
a vector of counts of trials. |
conf_level |
confidence level of the returned confidence interval. Must be a single number between 0 and 1. |
type |
a character string specifying the type of confidence interval. Must be one of "two.sided" (default), "right" or "left". |
na.rm |
a logical value indicating whether |
type
specifies the type of confidence interval. If type
is "two.sided", the returned confidence interval is (lower_ci, upper_ci)
. If type
is "left", the returned confidence interval is (lower_ci, 1)
. And, finally, if type
is "right", the returned confidence interval is (0, upper_ci))
.
A 1 x 3 tibble with 'lower_ci', 'upper_ci', and 'conf_level' columns. Values correspond to the lower and upper bounds of the confidence interval, and to the confidence level, respectively.
heads <- rbinom(1, size = 100, prob = .5)
ci_1pop_bern(heads)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.