[Sampling] Margin of Error (Non-replacement Sampling from a Finite Population)
Author: RumexJaponicusExecutions: 2585
※ This library was created by a member. This site is not responsible for its content.
For non-replacement sampling from a finite population, this function calculates the “margin of error” that satisfies the specified conditions.
If a non-replacement sampling of “sample size” is repeated infinitely many times from a population with a “population size” and a “population proportion,” the “sample proportion” will, with the probability specified by the “confidence level,” approximately satisfy the following condition:
| Sample proportion - Population proportion | ≤ Margin of error
| Sample proportion - Population proportion | ≤ Margin of error
| Margin of error | |
| Error Code | |
| Estimated proportion of the population | |
| Estimated error limits | |
| Estimated confidence level |
[Error Codes]
Error Code Description
0 The calculation completed successfully.
101 Does not satisfy (0 < population proportion - margin of error ∧ population proportion + margin of error < 1).
102 Does not satisfy (0 < margin of error < 0.5).
201 Does not satisfy (sample size < population size).
202 Does not satisfy (1 / population size ≤ population proportion ≤ 1 - 1 / population size).
301 ( 2 ≤ sample size ∧ sample size ∈ N ) is not true.
302 ( 0 < confidence level < 1 ) is not true.
303 ( 0 < population proportion < 1 ) is not true.
304 ( 3 ≤ population size ∧ population size ∈ N ) is not true.
* N is the set of all natural numbers
[Evaluation of Calculation Results]
If the “Error Code” is 0, the calculation results are evaluated based on the hypergeometric distribution. In this evaluation, optimal values are estimated in the order of “population proportion,” “margin of error,” and “confidence level.”
Estimated population proportion P
Estimated margin of error e
Estimated confidence level A
Where
P = M / population size
M = [population size * population proportion + 0.5]
e = max(|e_min|, |e_max|)
e_min = m_min / sample size - P
e_max = m_max / sample size - P
m_min = [sample size * (P - margin of error) + 0.5]
m_max = [sample size * (P + margin of error) + 0.5]
A = 1 - (B_lower + B_upper)
Sample size
B_lower = 1 - Σ H(x; population size, sample size, P)
x = m_min
m_max
B_upper = 1 - Σ H(x; population size, sample size, P)
x = 0
where H(x; N, n, p) is the probability mass function of the hypergeometric distribution.
Error Code Description
0 The calculation completed successfully.
101 Does not satisfy (0 < population proportion - margin of error ∧ population proportion + margin of error < 1).
102 Does not satisfy (0 < margin of error < 0.5).
201 Does not satisfy (sample size < population size).
202 Does not satisfy (1 / population size ≤ population proportion ≤ 1 - 1 / population size).
301 ( 2 ≤ sample size ∧ sample size ∈ N ) is not true.
302 ( 0 < confidence level < 1 ) is not true.
303 ( 0 < population proportion < 1 ) is not true.
304 ( 3 ≤ population size ∧ population size ∈ N ) is not true.
* N is the set of all natural numbers
[Evaluation of Calculation Results]
If the “Error Code” is 0, the calculation results are evaluated based on the hypergeometric distribution. In this evaluation, optimal values are estimated in the order of “population proportion,” “margin of error,” and “confidence level.”
Estimated population proportion P
Estimated margin of error e
Estimated confidence level A
Where
P = M / population size
M = [population size * population proportion + 0.5]
e = max(|e_min|, |e_max|)
e_min = m_min / sample size - P
e_max = m_max / sample size - P
m_min = [sample size * (P - margin of error) + 0.5]
m_max = [sample size * (P + margin of error) + 0.5]
A = 1 - (B_lower + B_upper)
Sample size
B_lower = 1 - Σ H(x; population size, sample size, P)
x = m_min
m_max
B_upper = 1 - Σ H(x; population size, sample size, P)
x = 0
where H(x; N, n, p) is the probability mass function of the hypergeometric distribution.
No customer feedback for this calculation yet.