1: Single rate

library(ratesci)

Technical details

The SCAS method is an extension of the Wilson Score method, using the same score function S(p) = x/n − p, where x is the observed number of events from n trials, and p is the true proportion. The variance of S(p) is V = p(1 − p)/n, and the 3rd central moment is μ3 = p(1 − p)(1 − 2p)/n2. The 100(1 − α)% confidence interval is found as the two solutions of the following equation, where z is the 1 − α/2 percentile of the standard normal distribution:

S(p)/V1/2 − (z2 − 1)μ3/6V3/2 = ±z

For unstratified datasets, this has a closed-form solution. The formula is extended in (Laud 2017) to incorporate stratification using inverse variance weights, wi = 1/V, or other weighting schemes as required, with the solution being found by iteration over p ∈ [0, 1].

The Jeffreys interval is obtained as α/2 and 1 − α/2 quantiles of the Beta(x + 0.5, n − x + 0.5) distribution, with boundary modifications when x = 0 or x = n.

A Clopper-Pearson interval may also be obtained as quantiles of a beta distribution, using Beta(x, n − x + 1) for the lower confidence limit, and Beta(x + 1, n − x) for the upper limit.

Laud, Peter J. 2017. “Equal-Tailed Confidence Intervals for Comparison of Rates.” Pharmaceutical Statistics 16 (5): 334–48. https://doi.org/10.1002/pst.1813.
———. 2018. “Equal-Tailed Confidence Intervals for Comparison of Rates.” Pharmaceutical Statistics 17 (3): 290–93. https://doi.org/10.1002/pst.1855.
Saha, Krishna K., Daniel Miller, and Suojin Wang. 2015. “A Comparison of Some Approximate Confidence Intervals for a Single Proportion for Clustered Binary Outcome Data.” The International Journal of Biostatistics 12 (2). https://doi.org/10.1515/ijb-2015-0024.