Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rsu.spp.rs

Surveillance system specificity assuming representative sampling


Description

Calculates surveillance system (population level) specificity assuming representative sampling and imperfect test specificity.

Usage

rsu.spp.rs(N, n, c = 1, sp.u)

Arguments

N

scalar or vector of the same length as that vector of n defining the [cluster] population size. Use NA if the size of the population not known, or for a more general application see details, below.

n

scalar or vector defining the sample size.

c

scalar or vector of the same length as that vector of n defining the cut-point number of positives to classify a cluster as positive, if the number of positive samples is less than c the cluster is declared is negative, if the number of positive samples is greater than c the cluster is declared positive.

sp.u

scalar (0 to 1) or vector of same length as n, the specificity of the diagnostic test at the surveillance unit level.

Details

This function calculates population specificity using the hypergeometric distribution if N and c are provided and the binomial distribution otherwise.

If N is provided the number of false positives is fixed, based on N and test specificity sp.u. This implies that test specificity is a fixed individual-level characteristic (e.g. due to specific cross-reacting infection). If N is not supplied, cluster (e.g. herd) specificity is a random binomial function based only on the number of samples and test specificity (i.e. specificity is a function of the test and independent of individual characteristics).

Value

A vector of population specificity estimates.

References

Martin S, Shoukri M, Thorburn M (1992). Evaluating the health status of herds based on tests applied to individuals. Preventive Veterinary Medicine 14: 33 - 43.

Examples

## EXAMPLE 1:
## Calculate the surveillance system specificity (i.e. the probability that 
## an uninfected population will be correctly identified as negative) if 30 
## surveillance units have been tested from a population of 150 using a 
## diagnostic test with surveillance unit specificity of 0.90, using a 
## cut-point of one or more positives to consider the population positive.

## A specificity of 0.90 means that 9 out of 10 samples from disease-negative
## surveillance units will return a negative result (i.e. one of them will be
## a false positive).
 
rsu.spp.rs(N = 150, n = 30, c = 1, sp.u = 0.90)

## The surveillance system specificity is 0.03. There is a probability of 
## 0.03 that all 30 samples will be negative.   


## EXAMPLE 2:
## Now assume we set a cut-point of 6. That is, 6 or more samples have to 
## return a positive result for us to declare the population positive:

rsu.spp.rs(N = 150, n = 30, c = 6, sp.u = 0.90)

## The surveillance system specificity is 0.95.

epiR

Tools for the Analysis of Epidemiological Data

v2.0.19
GPL (>= 2)
Authors
Mark Stevenson <mark.stevenson1@unimelb.edu.au> and Evan Sergeant <evansergeant@gmail.com> with contributions from Telmo Nunes, Cord Heuer, Jonathon Marshall, Javier Sanchez, Ron Thornton, Jeno Reiczigel, Jim Robison-Cox, Paola Sebastiani, Peter Solymos, Kazuki Yoshida, Geoff Jones, Sarah Pirikahu, Simon Firestone, Ryan Kyle, Johann Popp, Mathew Jay and Charles Reynard.
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.