1
$\begingroup$

I essentially have an experiment where a coin with an unknown $p(heads)$ is flipped $N_{total}$ times. I want to plot $p(heads)$ along with the associated 95% CI. I was planning on plotting $p = N_{heads}/N_{total}$ with error bars derived from the inverse binomial distribution evaluated at 0.975 and 0.025 with parameters $p$ and $N_{total}$. The problem is that in my experiment $N_{heads}$ is equal to $N_{total}$ which gives me a CI zero height suggesting that I know the value of $p(heads)$ exactly, but that seems unlikely.

Is there a better way to calculate the CI? I was thinking I could use the binomial distribution to find the value of $p_{heads}$ that has a probability of having $N_{heads} = N_{total}$ equal to 0.975, but this seems like the exact opposite of what CIs are supposed to tell you.

$\endgroup$

1 Answer 1

2
$\begingroup$

Short answer, but this should work... you can estimate a CI for p(heads) using an Agresti-Coull interval:

https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval#Agresti.E2.80.93Coull_interval

This interval calculation method has 'good' coverage properties: http://www.stat.ufl.edu/~aa/articles/agresti_coull_1998.pdf

$\endgroup$
1
  • $\begingroup$ It looks like the method I had been using is wrong and the one I proposed but don't like is the Clopper–Pearson interval. $\endgroup$
    – StrongBad
    Commented Aug 8, 2017 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.