ci_p_agresti_coull | R Documentation |
This function calculates the confidence interval for a proportion. It is vectorized, allowing users to evaluate it using either single values or vectors.
ci_p_agresti_coull(x, n, conf.level = 0.95)
x |
A number or a vector with the number of successes. |
n |
A number or a vector with the number of trials. |
conf.level |
Confidence level for the returned confidence interval. By default, it is 0.95. |
The Agresti-Coull interval is an approximate confidence interval for the
Binomial proportion p
.
The limits are calculated based on an adjusted proportion \tilde{p}
and its standard error. The mathematical definitions are as follows:
Adjusted proportion: \tilde{p}=\frac{x + 2}{n + 4}
;
Adjusted standard error: se=\sqrt{\frac{\tilde{p}(1 - \tilde{p})}{n + 4}}
;
Confidence limits: \tilde{p} \pm z_{\alpha/2} \cdot se
,
where z_{\alpha/2}
is the critical value of the standard normal
distribution. The limits are truncated to the range [0, 1]
.
A vector with the lower and upper limits.
Omar David Mercado Turizo, omercado@unal.edu.co
Agresti, A., & Coull, B. A. (1998). Approximate is better than “exact” for interval estimation of binomial proportions. The American Statistician, 52(2), 119-126.
ci_p.
ci_p_agresti_coull(x=15, n=50, conf.level=0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.