Margin of Error Formula

  • Thread starter Thread starter Heather Rabbitt
  • Start date Start date
H

Heather Rabbitt

Hi,

I'm looking for a formula in excel to give me the maximum and minimum
margin of error at the 95% confidence interval for a given percentage
and sample size.

For example the percentage may be 50% I have a sample size of 16 and
using a stat testing program (STATCHCK) I know the margin of error is
+/- 25% so my maximum would be 75% and my minimum would be 25%.

My problem is I have over 10,000 numbers to check and I want to
automate this in excel. I know there is a data analysis add in excel
but not sure if it can be used to solve my problem.

Any help with my problem would be greatly appreciated.

If you think this should be posted somewhere else please let me know.

Thanks in advance,

Heather
 
the standard error for your sample percentage is =
sqrt(((100-percentage)*percentage)/n-1)

assume 50% is in A1, 16 in B1

= sqrt(((100%-A1)*A1)/(B1-1))

This comes out to 12.91%

assuming your percentage is normally distributed, then a 95% confidence
interval says you should go +/- 1.96 standard errors from the mean

50% - (1.96 * 12.91%) as the lower bound and

50% + (1.96 * 12.91%) as the upper bound


(1.96 * 12.91%) = 25.303%

so you lower bound formula would be

= A1-1.96*sqrt(((100%-A1)*A1)/(B1-1))
your upper bound formula would be
= A1+1.96*sqrt(((100%-A1)*A1)/(B1-1))
 
Is it valid to use
=CONFIDENCE(Alpha, Standard_dev, Size),
(returns the confidence interval for a population mean)
i.e.
=CONFIDENCE(0.05, 0.5, 16)
(= 24.5%) ?
Is the 1.96 factor also sample size dependent ?
(My stats are rusty)

Merry Christmas to all

Kevin Beckham
 
the confidence worksheet function assumes a confidence for a mean. It is
unclear from the description given by the OP whether her % is a mean of a
bunch of percentages or if it represents the sample percentage (I assumed
the latter). If so, the sample percentage is actually modelled by a
binomial distribution which can be approximated by a normal distribution for
large samples. Her example really isn't a large sample based on the
"rules", but this isn't the forum to teach statistics.

So back to the confidence worksheet function, one of the inputs is the
standard deviation of the source population. If this is a sample
percentage, then there is no distribution for the source population - just
the population percentage. An estimate of the standard error is calculate
from this sample percentage, but this is not what the confidence worksheet
function is looking for. The standard error is dependent on the sample
size, 1.96 is a constant for 95% confidence interval.

If I take the standard error and multiply it by the squareroot of the sample
size and feed that as the second argument to the confidence function, then
it returns .25303 or 25.3% as I calculated in my post. So I suppose you
could use it with that adjustment.
 
Thanks - just wondering how do I account for scores of zero i.e. (0%)
using this formula:

lower bound formula would be
= A1-1.96*sqrt(((100%-A1)*A1)/(B1-1))
upper bound formula would be
= A1+1.96*sqrt(((100%-A1)*A1)/(B1-1))

Regardless of the sample size I always get lower bound and upper bound
scores of zero?

Thanks again,

Heather
 
Thanks - just wondering how do I account for scores of zero i.e. (0%)
using this formula:

lower bound formula would be
= A1-1.96*sqrt(((100%-A1)*A1)/(B1-1))
upper bound formula would be
= A1+1.96*sqrt(((100%-A1)*A1)/(B1-1))

Regardless of the sample size I always get lower bound and upper bound
scores of zero?

Thanks again,

Heather

[snip]

Tom's formulae approximate the exact 97.5% lower/upper confidence
bounds, assuming the data is binomially distributed. The accuracy of
the approximations depends on the sample size and the percentage. They
are less accurate when the sample size is small or the percentage is
close to 0 or 1.

To get exact 97.5% lower/upper confidence bounds, assuming the data is
binomially distributed you could use
100*lcb_binomial(B1,B1*A1/100,0.025) and
100*ucb_binomial(B1,B1*A1/100,0.025).

VBA versions of these functions can be found at
http://members.aol.com/iandjmsmith/Examples.xls


Ian Smith
 
Back
Top