1

I encountered the following question while I was preparing for data science interviews:

You are running for office and your pollster polled 100 people. 60 of them claimed they will vote for you. Can you relax?

The solution of the problem goes like this:

  • Assume that there’s only you and one other opponent.
  • Also, assume that we want a 95% confidence interval. This gives us a z-score of 1.96.
  • Confidence interval formula: $$\hat{p}\,\pm z^{\ast}\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}$$ where p-hat = 60/100 = 0.6, z* = 1.96, n = 100
    ...

Can someone explain where the formula for confidence interval comes from (e.g. assumptions made about the population distribution)? I know how to calculate the confidence interval when the population variance and mean are known, but I couldn't figure how the article writer came up with this specific formula.

Thank you in advance!

  • Your expression uses a normal approximation to a binomial distribution, taking the variance to be that of the binomial distribution if your $\hat p$ estimate was correct – Henry Oct 23 '21 at 01:13
  • @Henry Appreciate your insights! I see that the square root term comes from the binomial variance, whereas the z-score is normal. But do you think it's appropriate for the author to have mixed up binomial and normal distributions in estimating the confidence interval? In other words, do you see a better way to estimate the confidence interval? – Extraordinary Least Squares Oct 23 '21 at 01:25
  • https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval shows a few of the many possible approaches, of which this is one – Henry Oct 23 '21 at 01:33
  • This is a Wald CI for the binomial success probability. It works poorly for samples as small as 100. This Q&A discusses its derivation, approximations that can lead to errors, and gives links to further discussion. // For this application, even taking the interval to be exact, the margin of error is about $\pm 0.09$ so the CI almost contains $0.5.$ Especially because opinions may fluctuate over short periods of time, you should not "relax" and stop campaigning. – BruceET Oct 24 '21 at 08:56

0 Answers0