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)

Arguments

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 is 0.95.

Value

A matrix with the lower and upper limits.

Details

The expression to obtain the confidence interval is given below:

\(\sin^2(\hat\phi_{ML} \pm z_{\alpha/2} \times se(\hat\phi_{ML}))\),

where the maximum likelihood estimator for \(\phi\) is \(\hat\phi_{ML}=\arcsin(\sqrt{\hat \pi_{ML}})\), and its standard error is \(se(\hat{\phi}_{ML})=\frac{1}{\sqrt{4n}}\). 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).

References

Missing reference.

See also

Author

Victor David Usuga Duque, vusuga@unal.edu.co

Examples

ci_p_arcsine(x=15, n=50, conf.level=0.95)
#>           [,1]
#> [1,] 0.1822339
#> [2,] 0.4330338