Calculates the Clopper-Pearson interval by calling stats::binom.test().
Also referred to as the exact method.
Usage
ci_prop_clopper_pearson(x, conf.level = 0.95, data = NULL)
Arguments
- x
(binary/numeric/logical)
vector of a binary values, i.e. a logical vector, or numeric with values c(0, 1)
- conf.level
(scalar numeric)
a scalar in (0,1) indicating the confidence level. Default is 0.95
- data
(data.frame)
Optional data frame containing the variables specified in x and by.
Value
An object containing the following components:
- n
Number of responses
- N
Total number
- estimate
The point estimate of the proportion
- conf.low
Lower bound of the confidence interval
- conf.high
Upper bound of the confidence interval
- conf.level
The confidence level used
- method
Type of method used
Details
$$
\left(1 + \frac{N-n+1}{nF[\frac{\alpha}{2};2n,2(N-n+1)]} \right)^{-1}, \left( 1 + \frac{N-n}{(n+1)F[1-\frac{\alpha}{2};2(n+1),2(N-n)]} \right)^{-1}$$