powered by
Calculates the Wald interval by following the usual textbook definition for a single proportion confidence interval using the normal approximation.
ci_prop_wald(x, conf.level = 0.95, correct = FALSE, data = NULL)
An object containing the following components:
Number of responses
Total number
The point estimate of the proportion
Lower bound of the confidence interval
Upper bound of the confidence interval
The confidence level used
Type of method used
(binary/numeric/logical) vector of a binary values, i.e. a logical vector, or numeric with values c(0, 1)
binary
numeric
logical
c(0, 1)
(scalar numeric) a scalar in (0,1) indicating the confidence level. Default is 0.95
scalar numeric
(logical) apply continuity correction.
(data.frame) Optional data frame containing the variables specified in x and by.
data.frame
x
by
$$\hat{p} \pm z_{\alpha/2} \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}$$
# example code x <- c( TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE ) ci_prop_wald(x, conf.level = 0.9)
Run the code above in your browser using DataLab