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_arcsine(x, n, conf.level = 0.95)
A matrix with the lower and upper limits.
The expression to obtain the confidence interval is given below:
\(\sin^2(\arcsin(\sqrt{\tilde{p}}) \mp \frac{z_{\alpha/2}}{2\sqrt{n}})\),
where \(\tilde{p} = x/n\). The value \(z_{\alpha/2}\) is the \(1-\alpha/2\) percentile of the standard normal distribution (e.g., \(z_{0.025}=1.96\) for a 95% confidence interval).
No reference.
ci_p.
ci_p_arcsine(x= 0, n=50, conf.level=0.95)
#> [,1]
#> [1,] 0.00000000
#> [2,] 0.01908464
ci_p_arcsine(x=15, n=50, conf.level=0.95)
#> [,1]
#> [1,] 0.1822339
#> [2,] 0.4330338
ci_p_arcsine(x=50, n=50, conf.level=0.95)
#> [,1]
#> [1,] 0.9809154
#> [2,] 1.0000000