I recently read the Brown, Cai, Dasgupta paper on interval estimation for a binomial proportion where they propose the modified wilson method as a better alternative to the standard wald interval. I would like to use the modified wilson method to create confidence intervals, but am having trouble finding a specific equation to implement in R. I know there is already a binomci function in r that does the modified wilson, but I am required to implement my own function (this is for a school assignment). The only place where I found a concrete equation for the modified wilson is on wikipedia (see Wilson score interval with continuity correction at https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval). However, this equation produces a different result than the binomci function. Could anyone provide insight into the correct one? Thank you!
paper can be found here: https://projecteuclid.org/euclid.ss/1009213286