1-Stage Freedom analysis
# Sample size to achieve specified population level (or herd, flock, cluster, etc) sensitivity

### Inputs are:

### Outputs are:

This utility calculates the sample size required to achieve a target population or cluster level sensitivity for a survey.

For these calculations unit specificity is assumed to be 100%. For cluster (herd, flock, etc) level calculations, enter test sensitivity, unit-level design prevalence and required cluster-level sensitivity. Alternatively, for population level calculations enter cluster-level (herd) sensitivity, cluster-level design prevalence and required population-level sensitivity.

Calculations use the hypergeometric approximation if population size is provided, or binomial method if population size is not specified.

- Design prevalence as either a proportion or an integer number of units (animals for cluster level sensitivity and clusters for population-level sensitivity);
- Unit sensitivity (test sensitivity to calculate cluster (herd) sensitivity or cluster (herd) sensitivity to calculate population sensitivity;
- Required population-level sensitivity; and
- Population size (optional if design prevalence is specified as a proportion, required if design prevalence is a number of units). Leave population size blank if not known.

- Required sample size for the given target population sensitivity, design prevalence and unit sensitivity; and
- A table and graph of sample sizes for varying population and design prevalence values and the given target population sensitivity and unit sensitivity.