I would have run this classical one (the asymptotic method):

(These are a little bit off topic since the Ci and test match, but they are tests about the binomial distribution.)

Code:

```
# http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval
phat <- 12/99
se <- sqrt(phat*(1-phat)/99)
lo <- phat - 1.96*se
hi <- phat + 1.96*se
print(c(lo,phat,hi))
# the "asymptotic" method
(phat - 0.2011)/se
binom.test(12, 99, .2011)
?binom.test
library(binom)
?binom.confint
binom.confint(12, 99, conf.level = 0.95, methods = "exact" )
binom.confint(12, 99, conf.level = 0.95, methods = "all" )
?prop.test
prop.test(12,99)
prop.test(c(12, 5),c(99,99))
#prop.test mentioned in: Chihara Hesterberg
# "Mathematical Statistics with resampling and R" 2011, page 195
# Brown Interval Estimation for a Binomial Proportion
```

But then then I came across “binom.confint” function.

And the function “prop.test” was mentioned in Chihara Hesterberg.

Brown et. al. had this fun conclusion:

“The standard Wald interval is in nearly universal use. We first show that the performance

of this standard interval is persistently chaotic and unacceptably poor. Indeed its coverage

properties defy all conventional wisdom, much more than is presently widely understood.

The performance is so erratic and the qualifications given in the in the influential texts are so

defective, that the standard interval should not be used. We provide a fairly comprehensive

evaluation of many natural alternative intervals. Based on this analysis, we recommend the

Wilson or the equal-tailed Jeffrey prior interval for small n (n <= 40), and the Agresti-Coull

interval for n >= 40. Even for small sample sizes the easy to present Agresti-Coull interval

is much preferable to the standard one.”

ref

Lawrence D. Brown, T. Tony Cai and Anirban DasGupta

“Interval Estimation for a Binomial Proportion”