Description Usage Arguments Details
Calculate the number of samples needed to estimate the population prevalence with a specified precision. Precision is defined in terms of the quantiles of the distribution of estimated prevalence values. For example, we might say, "If the true prevalence is 1 greater than 0.5 we don't grossly underestimate the prevalence.
1 | sampEstimate(Npop, popprev, prob, targ, sensitivity, specificity)
|
Npop |
Population size |
popprev |
True population prevalence |
prob |
The quantile to place a restriction on (e.g., 0.05 for the 5th percentile) |
targ |
Target value for |
sensitivity |
Sensitivity of the test |
specificity |
Specificity of the test |
The characteristics of the system that are specified are:
Total population size
Test characteristics
True population prevalence
Quantile to place a requirement on
Target value of that quantile
The solver actually solves for the sample size that is as close as possible to being equal to the required condition, so it is indifferent to whether we are setting an upper bound or a lower bound on the quantile. So, in place of the example above we could just as well say that we want the 95th percentile of estimated values to be less than 2
Solution is carried out using a bounded secant solver. No initial guess is required because we can start with the basic assumption that the number of samples must be greater than zero and less than the total population. Since the number of samples must be a whole number, we shrink the interval until it's less than a quarter-person wide, and then we return the ceiling of the upper bound.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.