R/ci_p_xxx.R
ci_p_wald_bs.Rd
This function calculates the Wald Binomial Score confidence interval for a binomial proportion. It is vectorized, allowing the evaluation of single values or vectors.
ci_p_wald_bs(x, n, conf.level = 0.95)
A vector with the lower and upper limits of the confidence interval.
The Wald Binomial Score confidence interval is an adjusted version of the Wald interval, designed to improve accuracy in small samples and near the boundaries of the parameter space.
The bounds for the interval confidence are:
\(\hat{p} \mp \left[ \frac{Z_{\alpha/2} \sqrt{\hat{p} (1-\hat{p})}}{\sqrt{n - Z_{\alpha/2}^2 - \frac{2Z_{\alpha/2}}{\sqrt{n}} - \frac{1}{n}}} + \frac{1}{2n} \right]\)
This interval is particularly useful when \(n\) is small or when the proportion \(\hat{p}\) is close to 0 or 1.
Blyth, C.R. and Still, H.A. (1983). Binomial confidence intervals, Journal of the American Statistical Association, 78, 108–116.
ci_p.
ci_p_wald_bs(x = 15, n = 50, conf.level = 0.95)
#> [,1]
#> [1,] 0.1629798
#> [2,] 0.4370202