Calculate sample sizes for 2stage surveys for demonstrating disease freedom,
for specified target herd/flock sensitivity and system sensitivity.
This analysis calculates the number of herds and the number of animals within each herd
to be tested to provide specified herd and system sensitivities (probability of detecting disease)
for the given animal and herdlevel design prevalences and test sensitivity. Test
specificity is assumed to be 100% (or followup testing of any positive will be undertaken
to confirm or exclude disease).
Numbers of herds to test are calculated using the hypergeometric apprximation if the
number of herds in the population is specified as well as using the binomial fomula assuming unknown (large)
number of herds in the population. If the population size is not specified only the binomial results are presented.
Numbers of animals to test in each herd are calculated for a range of herd sizes using the hypergeometric
approximation and for unknown (large) herd sizes using the binomial calculation.
Design prevalence (specified level of disease to be detected) must be specified
at both animal and herd levels. Design prevalence can be specified as either:
 a proportion of the population infected; or
 a specific (integer) number of herds infected (for herdprevalence only and
only if the number of herds in the population is specified).
Inputs
Inputs required include:
 animallevel design prevalence (as a proportion only);
 herdlevel design prevalence and whether this is specified as a proportion or number of herds;
 the estimated test sensitivity;
 the target herd or flock sensitivity (SeH) which is the probability of detecting
disease if it is present in a herd at the specified animallevel design prevalence;
 the target system sensitivity (SSe) which is the probability of detecting
disease if it is present in the population at the specified animal and herd level design prevalences;
 The number of herds in the population (optional).
Outputs
Outputs from the analysis include:
 The total numbers of herds to be sampled;
 The maximum total sample size (if animallevel prevalence is specified as a proportion);
 The numbers of animals to test in herd, for a range of herd sizes to achieve the specified
value for SeH; and
 The numbers of animals to test in herd and the corresponding numbers of herds to test,
for a range of herd sizes and SeH values.
Note:
 If it is not possible to achieve the desired herd sensitivity by testing
all animals in a herd of given size, the sample size is left blank;
 If animallevel prevalence is specified as a number of animals, sample size for
an unknown herd/flock size cannot be calculated;
 If herdlevel prevalence is specified as a number of herds, number of herds
to be sampled for a large or unknown population cannot be calculated.
