Skip to main content
2 of 3
corrected x and n in code snippet
R. Cox
  • 179
  • 8

Interval Estimation for a Binomial Proportion Given a Specific Test Outcome

Imagine that I had a coin, I tossed it 10 times (n) and it came up heads each time (x). What proportion heads I would get if I tossed it infinity times? A point estimate is 100%.

I can get the confidence intervals (CI) from:

low, high = statsmodels.stats.proportion.proportion_confint(10, 10, alpha=A, method='jeffreys')

enter image description here

& I can get the coverage probability of the 95% CI (CP) from:

coverage = binom.coverage(p, 10, method="bayes", type = "central")$coverage

enter image description here

The CP calculation uses n but doesn't consider x. Can I combine the CI and CP results to get a distribution of the CP for this case please, where x is known? And would this be an appropriate method to use for the comparison of techniques for constructing CIs?

R. Cox
  • 179
  • 8