computePValue: FUNCTION to compute the probability of finding no testpositives in
a sample of a certain size.
Description
For a population of size nPopulation with a given design prevalence
the function computes the probability of finding no testpositives
in a sample of size nSample if an imperfect test is used (given sensitivity
and specificity). This probability corresponds to the alpha-error
(=error of the first kind) of the overall test with null hypothesis:
prevalence = design prevalence. A modified hypergeometric formula
is used; see Cameron, Baldock, 1998.
The return value is a numeric between 0 and 1. It is
the probability of finding no testpositives (not diseased!) in
the sample.
Arguments
nPopulation
Integer. Population size.
nSample
Integer. Size of sample.
nDiseased
Integer. Number of diseased elements in the population
according to the design prevalence.
sensitivity
Numeric between 0 and 1. Sensitivity (= probability of
a testpositive result, given the tested individual is diseased)
of the test (e.g., diagnostic test or herd test).
specificity
Numeric between 0 and 1. Specificity (= probability of
a testnegative result, given the tested individual is not
diseased) of the test (e.g., diagnostic test or herd test).
The default value is 1.
Author
Ian Kopacka <ian.kopacka@ages.at>
References
A.R. Cameron and F.C. Baldock, "A new probablility formula
to substantiate freedom from disease", Prev. Vet. Med. 34 (1998), pp. 1-17.