14 One Proportion

14.1 Comparing various confidence intervals

We consider a binomial experiments (i.e., an iid sequence of Bernoulli trials) and the task of building a confidence interval for the probability parameter.

The Clopper–Pearson interval is “exact”, and in fact conservative in terms of level. We compute below the two-sided (which is the default) 90% confidence interval.

0.06805557 0.3189712

The Wilson interval is “approximate” in terms of level, relying on the normal approximation to the binomial distribution. (The two intervals tend to be closer the larger the sample size is.)

0.07224992 0.3238618

We compare these two intervals in simulations.

[1] "fraction of times that the 0.90 CP interval contained the parameter: 0.928"
[1] "fraction of times that the 0.90 W interval contained the parameter: 0.979"
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
0.09503 0.18335 0.21078 0.20254 0.23276 0.29875 
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.1110  0.1901  0.2148  0.2077  0.2349  0.2961