Basic help
Not all the studies are focused in determining the presence of disease in a population, moreover there are studies interested in establishing a ratio (for example, knowing how many diseased individuals are, i.e., prevalence). In these cases the sample size depends on the acceptable error, the desired confidence level or probability of getting a correct answer, and the expected prevalence.
It should be taking into account that the error usually accepted and the confidence level are set arbitrarily by the researcher. Besides the literature on the subject matter and other sources may give us an idea about the expected value of the proportion (one that probably will), or in the worst case scenario you can choose the most unfavorable situation for the calculation of sample size (the value of the possible values near to 50% or 50% when the prevalence is unknown).
Also you should keep in mind the size of the population, because with small populations (less than 1000 individuals), it is possible to obtain a larger sample size than the size of the population, and for this reason then you must make a adjust.
Advanced help
In many epidemiological studies we have to estimate proportions (remember that the prevalence is the proportion of diseased individuals in a population).
Traditionally, it is used a formula derived directly from the formula for estimating average assuming normal distribution, replacing the standard deviation by the following expression:
$
\sigma =\sqrt {p\cdot \left( 1-p\right) }
$
Therefore we have that the sample size was calculated as:
$
n=\left( \dfrac {Z_{\alpha/2} \sqrt {p\left( 1-p\right) }} {E}\right) ^{2} = \dfrac {Z_{\alpha/2}^{2} \cdot p\left( 1-p\right) } {E^{2}}
$
where:
n: sampling size needed
Z α/2: Z-value for a confidence level CL=1-α
p: expected proportion
E: absolute accepted error or precision
However, the classical formula based on normal distribution tends to overestimate the sample size when the expected proportion is close to 50% (0.5) and to underestimate it when the values are close to 0 and 100%. For this reason we have implemented an algorithm that estimates the sample size assuming a binomial distribution based on the Wilson Score method:
$
\left(p_{lower}, p_{upper}\right) =\dfrac {2np\pm Z_{\alpha/2}\sqrt {4np\left( 1-p\right) +Z_{\alpha /2}^{2}}} {2\left( n+Z_{\alpha/2}^{2}\right) }
$
where:
n:sampling size needed
Zα/2: Z-value for a confidence level CL=1-α
p: expected proportion
plower: lower limit of the confidence interval of the estimate
pupper: upper limit of the confidence interval of the estimate
In this case, the expected proportion should be within the calculated confidence interval, and the difference between pupper and plower should be less than twice the accepted error.
Tip: The prevalence can be obtained from the previous studies. If you do not know it, you must use 50% (0.5). And in case of a range of values should be taken interval value closest to 50%
In the case of population size (N) is known, and the sampling fraction obtained from the above formulas exceeds 5%, we should adjust the sample size (n) using the following formula (Thrusfield, 2005 ):
$
n=\dfrac {N\cdot Z_{\alpha / 2}^{2}\cdot p \cdot (1-p)} {E^{2}\cdot \left( N-1\right) +Z_{\alpha / 2}^{2}\cdot p \cdot (1-p)}
$
Example
In a population of 500 individuals we want to estimate the prevalence (diseased proportion) with a precision of 10% and 95% confidence level. Based on previous studies we know that this disease occurs affecting between 10 and 30% of the population.
The problem data are:
Cl: confidence level = 95%
N: population size = 500
p: expected proportion = 30%
E: absolute accepted error or precision = 10%
Consequently the sample size is equal to 76 individuals assuming a binomial distribution and adjusting the sample size as the previously calculated sampling fraction is 17.8%.
It should be take into account that the sample size is slightly higher than that obtained using the classical formula assuming normal distribution (70 individuals).