0
$\begingroup$

I have tried to calculate a 95% confidence interval for proportions on datasets with small and large sample sizes. I have been checking the values with two online calculators and keep getting confidence intervals with negative values or larger than 100% for the data with the small sample size.

Two examples from different datasets:

To calculate a 95% CI using

When n=29 and observed number = 27 CI= 83.88%; 102.32%

when n=61 and observed number = 2 CI= -1.2%; 7.7%

Could anyone suggest what I have done wrong to get these values?

$\endgroup$
1
$\begingroup$

I don't know if you are using R, but the code is very straightforward (below). It will output the confidence intervals based on the Clopper and Pearson (1934) method (see binom.test {stats}).

So in your first example you would end up with:

binom.test(27,29)[4]

$conf.int
[1] **0.7723381 0.9915360**
attr(,"conf.level")
[1] 0.95

while in your second example the output will be:

binom.test(2,61)[4]
$conf.int
[1] 0.003995603 0.113472167
attr(,"conf.level")
[1] 0.95
| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Hi Toni, Thank you for taking the time to recalculate the confidence interval using clopper and pearson method. This is the first time I've tried to calculate a confidence interval and I did not appreciate/understand the value of the various methods. This is really very useful for pointing me in the right direction. Thank you! $\endgroup$ – Lostinstats Feb 27 '15 at 12:13
2
$\begingroup$

If you are using the standard "Wald" confidence interval it is common to get values outside of the possible range (0,100) because it is a symmetric interval.

I highly recommend some more sophisticated confidence intervals which are able to avoid this and have better coverage probability:

http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Thank you very much for explaining why I was getting these values!! I appreciate that you have taken the time to comment and provide feedback and I am now trying other types of confidence interval calculations :) $\endgroup$ – Lostinstats Feb 27 '15 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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