Analysis of 2-stage freedom survey data

Input Values


Analyse herd-testing data for 2-stage surveys for demonstrating disease freedom. This analysis calculates the overall system sensitivity for the survey and the resulting probability of population freedom from disease. It assumes that a random sample of herds (or all herds) has been selected for testing from the population and that a random sample of animals (or all animals) has been tested within each selected herd. It also assumes that the test system has a specificity of 100% (any positive results are further investigated to exclude false positives) and that no positive results were recorded. The analysis adjusts for imperfect sensitivity of the test used.

The analysis calculates both herd and system level sensitivity estimates using three different methods depending on the available data:

  • assumed binomial sampling (sampling with replacement) where population size is unknown or not specified;
  • a hypergeometric distribution (sampling without replacement) where population size is specified; or
  • exact probability calculations where the entire population has been sampled.

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 or animals (within herds) infected.


Inputs required include:

  • animal-level design prevalence and whether this is specified as a proportion or number of animals;
  • herd-level design prevalence and whether this is specified as a proportion or number of herds;
  • the number of herds in the population as either unknown, all herds tested or a specified number of herds;
  • the estimated test sensitivity;
  • the assumed prior probability that the population is free of disease; and
  • testing data for each herd, including herd id (optional), number tested and (optionally) herd size. Herd size is required if design prevalence is specified as number rather than proportion of animals.


Outputs from the analysis include:

  • Overall system sensitivity (probability of detecting disease if it was present at the specified animal and herd-level design prevalences);
  • Probability of freedom of the population from disease (at the specified animal and herd-level design prevalences; and
  • A summary of herd-level sensitivity (SeH) values and specific values for each herd tested.
Animal-level design prevalence:
Herd-level design prevalence:
Number of herds in population?
Unknown/Not specified
All herds tested
Specified below
Test sensitivity:
Prior probability of freedom:

Paste herd testing data in the space below. Data columns can be in any order but must include a column for number tested (labeled "Tested"). Columns for herd id, and herd size (labeled "HerdSize") are optional. A header row specifying column names must also be included.
Download example data


  Home  |   About this site  |   Glossary   |   References   |   Links   |  125 recent calculations

This site was created by Ausvet with funding from a range of sources.
It provides a range of epidemiological tools for the use of researchers and epidemiologists, particularly in animal health.
Please send any comments, questions or suggestions to Evan Sergeant
© 2017 Ausvet