computeAlpha: FUNCTION to compute the herd-based alpha-errors (= 1 - herd...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/computeAlpha.R

Description

For a vector of herd sizes the herd-based alpha-errors (= 1-herd sensitivity) are computed for either limited or individual sampling; see Ziller et al.

Usage

1
2
computeAlpha(nAnimalVec, method, sampleSizeLtd, herdSensitivity, 
    intraHerdPrevalence, diagSensitivity, diagSpecificity = 1)

Arguments

nAnimalVec

Integer vector. Stock sizes of the herds.

method

Character string. "individual" for individual sampling or "limited" for limited sampling.

sampleSizeLtd

Integer. Required only if method == "limited". Sample size for limited sampling, i.e., for each herd sampleSizeLtd animals are tested, or of the herd contains less than sampleSizeLtd animals the entire herd is tested.

herdSensitivity

Numeric between 0 and 1. Required only if method == "individual". Desired (minimal) hed sensitivity for individual sampling. The number of animals to test per herd is determined according to that value.

intraHerdPrevalence

Numeric between 0 and 1. Intra-herd prevalence. The number of diseased animals per herd is computed as max(1,round(intraHerdPrevalence*nAnimalVec)) (it is assumed that at least one animal is diseased).

diagSensitivity

Numeric between 0 and 1. Sensitivity (= probability of a testpositive result, given the tested individual is diseased) of the diagnostic test.

diagSpecificity

Numeric between 0 and 1. Specificity (= probability of a testnegative result, given the tested individual is not diseased) of the diagnostic test. The default value is 1, i.e., perfect specificity, and is recommended.

Value

Returns a vector containing the herd-based alpha-errors, where each entry in the vector corresponds to an entry in the input argument nAnimalVec.

Author(s)

Ian Kopacka <ian.kopacka@ages.at>

References

M. Ziller, T. Selhorst, J. Teuffert, M. Kramer and H. Schlueter, "Analysis of sampling strategies to substantiate freedom from disease in large areas", Prev. Vet. Med. 52 (2002), pp. 333-343.

See Also

Is used in the method sample for classes IndSampling and LtdSampling.

Examples

1
2
3
4
5
data(sheepData)
## Compute the herd sensitivities usinh limited sampling:
alphaVec <- computeAlpha(nAnimalVec = sheepData$nSheep, 
    method = "limited", sampleSizeLtd = 7, 
    intraHerdPrevalence = 0.2, diagSensitivity = 0.9)

FFD documentation built on Dec. 21, 2020, 3:02 p.m.