surveyData: Constructor for class 'SurveyData'.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/surveyData.R

Description

Constructor for objects of the class 'SurveyData'.

Usage

1
2
3
4
5
surveyData(nAnimalVec = numeric(), riskGroupVec = character(),
	riskValueData = data.frame(), populationData = data.frame(), 
    designPrevalence = numeric(), alpha = numeric(), 
    intraHerdPrevalence = numeric(), diagSensitivity = numeric(), 
    costHerd = numeric(), costAnimal = numeric())

Arguments

nAnimalVec

Positive numeric vector containing the number of animals per holding.

riskGroupVec

Character vector. Vector containing the the name of a risk group to which the farm belongs. Optional argument. If provided, it must have the same length as nAnimalVec.

riskValueData

Data frame. Data frame where the first column contains the labels in riskGroupVec and the second column contains the numeric values for the relative infection risk.

populationData

Data frame. Columns of the data frame must have the same length as the vector in nAnimalVec. The data frame can contain additional data such as herd id, name and address of the owner etc.

designPrevalence

Numeric with values between 0 and 1. Prevalence of the disease under the null hypothesis.

alpha

Numeric with values between 0 and 1. Type one error for the statistical test (=significance level).

intraHerdPrevalence

Numeric with values between 0 and 1. Intra-herd prevalence, i.e., the assumed prevalence of the disease within an infected herd.

diagSensitivity

Numeric with values between 0 and 1. Sensitivity of the diagnostic test used.

costHerd

Numeric. Cost per tested herd excluding costs for sampling of animals (e.g., travel costs of the vet).

costAnimal

Numeric. Cost per tested animal, e.g., drawing of samples + analysis in the lab.

Value

The function returns an object of the class SurveyData.

Author(s)

Ian Kopacka <ian.kopacka@ages.at>

See Also

See SurveyData for additional details on the class.

Examples

1
2
3
4
5
data(sheepData)
mySurvey <- surveyData(nAnimalVec = sheepData$nSheep, 
    populationData = sheepData, designPrevalence = 0.002, 
    alpha = 0.05, intraHerdPrevalence = 0.13,
    diagSensitivity = 0.9, costHerd = 30, costAnimal = 7.1)

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