STOCfree_data: STOCfree_data class

View source: R/sf_data.R

STOCfree_dataR Documentation

STOCfree_data class

Description

STOCfree_data class

Usage

STOCfree_data(
  test_data = data.frame(),
  test_herd_col = NULL,
  test_date_col = NULL,
  test_res_col = NULL,
  test_name_col = NULL,
  status_dynamics_scale = "logit",
  risk_factor_data = NULL,
  risk_herd_col = NULL,
  risk_date_col = NULL,
  risk_factor_col = NULL,
  risk_factor_type = c("continuous", "categorical"),
  lag1 = 0,
  lag2 = 0,
  time_interval = c("month", "year", "week"),
  FUN = sum
)

Arguments

test_data

a data.frame containing test results

test_herd_col

name of the column with herd / farm identifiers

test_date_col

name of the column with date of test

test_res_col

name of the column with test results. Test results should be codes as 0 for negative results and 1 for positive results.

test_name_col

when several tests are used, name of the column containing the test names

status_dynamics_scale

scale on which priors for status dynamics are defined. The default is 'proba' and uses Beta priors. If 'logit' is used as an argument, the prior distributions will be normal distributions on the logit scale.

risk_factor_data

a data.frame containing the risk factors

risk_herd_col

name of the column with herd / farm identifiers

risk_date_col

name of the column with date when the risk factors apply

risk_factor_col

name of the column(s) with risk factor values

risk_factor_type

risk factor type. Must be either continuous or categorical

lag1

start of the time interval for risk factor aggregation

lag2

end of the time interval for risk factor aggregation

time_interval

function used for risk factor aggregation. By default sum() is used, the values are added.

FUN

function used when aggregating the data. By default sum() is used, the values are added.

Value

A list of class STOCfree_data. A specific sub-class is defined based on the input.


AurMad/STOCfree documentation built on Sept. 13, 2022, 3:20 a.m.