Margin of error, if all responses identical

In summary, you can use the "margin of error" (or "standard error of the proportion") formula sqrt[p(1-p)/n] to estimate the confidence interval for the probability of "no" when the sample proportion is 0 or 1.
  • #1
cesiumfrog
2,010
5
Hi,

If I poll 10 people (with a yes/no question), and all of them respond with 'yes', should I report the rate of 'no' answers (in the greater population) is "zero plus or minus zero", or simply be confident that it is "less than one in five"?

I ask because using the "margin of error" (or "standard error of the proportion") formula sqrt[p(1-p)/n] it would appear, counter-intuitively, that the confidence interval narrows to zero (regardless of how few the samples) when the sample proportion is 0 or 1.
 
Physics news on Phys.org
  • #2
cesiumfrog said:
Hi,

If I poll 10 people (with a yes/no question), and all of them respond with 'yes', should I report the rate of 'no' answers (in the greater population) is "zero plus or minus zero", or simply be confident that it is "less than one in five"?
You certainly have a positive confidence interval for the probability of "no" = q = 1-p.
I ask because using the "margin of error" (or "standard error of the proportion") formula sqrt[p(1-p)/n] it would appear, counter-intuitively, that the confidence interval narrows to zero (regardless of how few the samples) when the sample proportion is 0 or 1.
You can not use that formula unless you know p. You are using the sample to estimate p and your sample appears to be small for the probability, p. There are several equations for the confidence interval (see http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval. In the case you are asking about, consider the rule of three (see http://en.wikipedia.org/wiki/Rule_of_three_(statistics) ). It gives the 95% confidence interval (0, 3/n).
 
  • #3
Ah, I see, so that formula involved an approximation that the ratio wasn't extreme.

Is there a exact Bayesian approach, given a prior distributed uniformly over [0,1] for the population's ratio, to correctly determine the credible interval for the estimate of that ratio from the sample?
 
  • #4
I flip a coin with probability of heads =0, then in nflips I will get 0 heads with a standard deviation of 0. That's OK. But the coin may instead have a non-zero probability of heads but by luck I did not get any heads in the sample.

The formula you give is used for a large n normal approximation (CLT) to the binomial. Instead we can use an exact binomial test for small n. Let q=proportion of "yes" voters in the population. We want to see what values of q are plausible given we saw 10 of 10 "yes" responses. q near 1 is very likely while q small, near 0, is very unlikely. Formally, a hypothesis test:

Suppose we wanted to test:

H0:q=0.741 versus Ha:q>0.741

This is an upper-tailed test. If we want to find the p-value corresponding to the observed result of all 10"yes", then we obtain 0.74110=0.05 (which is why I chose0.741). If we had used 0.795 or 0.631 we would obtain 0.79510=0.10 and 0.63110=0.01.

If we use the usual type I error α=0.05 then we are right on the border with the stated null hypothesis and will reject the null and conclude the alternative q>0.741 is a more plausible statement. So I would report the interval for the proportion of "yes" as (0.741,1) or the range for the proportion of "no" as (0,0.259). If you want to be even more conservative, we could report (0,0.369) for "no" using a 1% type I error.
 
  • #5
If I count n heads out of N tosses, based on my prior assumption that the bias (the true probability of heads) could equally be any value between zero and unity i.e. P(a≤r≤b)=[itex]\int_a^b[/itex]dr, and noting the binomial distribution is the well-known likelihood of the observed result for a particular bias..

P(n/N|r)=NCnrn(1-r)N-n
.:P(n/N|a≤r≤b)=NCn[itex]\int_a^b[/itex]rn(1-r)N-ndr = NCn (Bb-Ba)[n+1,N-n+1] where B is the incomplete beta function.

So I can apply Bayes theorem to find the plausibilty of different biases given my observations:

P(a≤r≤b|n/N)=P(n/N|a≤r≤b) P(a<r<b) / P(n/N) = [itex]\frac{B_b-B_a}{B_1-B_0}[/itex][n+1,N-n+1] = (Ib-Ia)[n+1,N-n+1],
.:P(r≤b|n/N) = Ib[n+1,N-n+1] where I is the regularised incomplete beta function.

Rather than just naively estimating that r≈n/N, I can solve this to impose on r an upper bound (b) with arbitrary credibility, say, set P(r≤b|n/N)=0.90.

.:b = InverseBetaRegularised[0.9,n+1,N-n+1].

My application of this is that I'm doing a permutation-test (performed N times) to determine whether a result (e.g. a classifier's specificity) is statistically significant (so we count the number n of times a just-as-good result occurs purely by chance). For this permutation-test, r represents the p-value. However, because the test is computationally expensive, N cannot be huge, and so n is often very small (possibly zero). Some code would just report the p-value as n/N, but this seems unacceptable (i.e. too-easily estimating low p-values, such as exactly zero).

For example, would it be reasonable to report p<0.04 if N=100 and n=1, and p<0.02 if N=500 and n=5, but not to report p=0.01 in either case?
 
  • #6
cesiumfrog said:
My application of this is that I'm doing a permutation-test (performed N times) to determine whether a result (e.g. a classifier's specificity) is statistically significant

Can you clarify what that means? When I think of a "permutation test", I visualize paired observations, e.g. "treatment" and "result". I can think of "treatment" as "actual classification" and "result" is "classifier's classification". But is the "treatment" a variable that has only two values?
 
  • #7
cesiumfrog said:
based on my prior assumption that the bias (the true probability of heads) could equally be any value between zero and unity ---
Rather than just naively estimating that r≈n/N,
n/N is not naive. It is the maximum likelihood estimator. It is wrong to give more weight to the "no-knowledge" assumption of a uniform prior distribution, than to the data-supported n/N estimate. "no-knowledge" Bayes techniques are not a good substitute for data. Bayes prior distribution should be based on something applicable to the experiment being done (prior knowledge, a conservative assumption, etc.). It is better to directly use the data and a maximum likelihood estimator than to influence the results with a "no-knowledge" Bayes prior. You might also consider the technique of "bootstrapping" if you are not happy using the MLE directly. I don't know if the result will be different.
 
Last edited:
  • #8
FactChecker said:
It is wrong to give more weight to the "no-knowledge" assumption of a uniform prior distribution, than to the data-supported n/N estimate.

Applying statistics to real world problems is a subjective matter. The original post asks about a "confidence interval". A Bayesian prior is needed to compute a "credible interval" (which is a different type of interval). Reporting the maximum liklihood estimate without stating any type of associated interval is a third alternative. These choices are choices about how to formulate a real world problem as a mathematical problem.

cesiumfrog has asked
For example, would it be reasonable to report p<0.04 if N=100 and n=1, and p<0.02 if N=500 and n=5, but not to report p=0.01 in either case?

Let p denote the probability that a randomly selected member of the population answers "No". None of the above formulations reaches a conclusion about p defnitely having some value or being in some interval of values. A Bayesian approach reaches a conclusion about p being in a certain interval with a certain probability. A confidence interval approach reaches a conclusion about p being in a certain interval with a certain "confidence" (and "confidence" is not a synonym for "probability"). Reporting the maximum liklihood estimate isn't a claim about the actual value of p.

Cesiumfrog needs to be specific about the general form of the statement he wants to report.

.
 

1. What is the margin of error?

The margin of error is a statistical measure that represents the amount of sampling error in a survey or poll. It is calculated by taking into account the sample size, the standard deviation of the sample, and the level of confidence desired.

2. How is the margin of error calculated?

The margin of error is typically calculated by multiplying the standard error of the sample by the critical value of the desired confidence level. This value is then added and subtracted from the estimated percentage or mean to determine the range of values within which the true population parameter is likely to fall.

3. What does the margin of error tell us?

The margin of error tells us the degree of uncertainty in a survey or poll. It provides a range within which the true population parameter is likely to fall, given the sample and the level of confidence. The smaller the margin of error, the more accurate the results of the survey or poll are likely to be.

4. How does identical responses affect the margin of error?

If all responses are identical, the margin of error will be zero. This is because there is no variation in the responses, so the standard error will be zero and the confidence interval will be equal to the estimated percentage or mean. However, this scenario is highly unlikely in real-world surveys or polls.

5. Can the margin of error be reduced?

Yes, the margin of error can be reduced by increasing the sample size, as this decreases the standard error. It can also be reduced by increasing the level of confidence, although this may result in a wider confidence interval. Additionally, ensuring a representative sample and minimizing non-sampling errors can help reduce the margin of error.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
727
  • Introductory Physics Homework Help
Replies
12
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
11K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
24
Views
4K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
13K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
Replies
6
Views
3K
Back
Top