integrity.checks: Integrity checks for input parameters

View source: R/integrity.checks.R

integrity.checksR Documentation

Integrity checks for input parameters

Description

Before any requested estimation routine is ran, integrity.checks() is called to ensure the data passed as arguments meet the proper format and can be properly interpreted by subsequent functions.

Usage

integrity.checks(
  epid,
  GT,
  t,
  begin,
  end,
  date.first.obs,
  time.step,
  AR,
  S0,
  methods
)

Arguments

epid

Epidemic dataset, expecting incidence counts in a varity of possible formats (see check.incid()).

GT

Generation time distribution from generation.time().

t

Vector of dates at which incidence was observed.

begin

Begin date for estimation. Can be an integer or a date (YYYY-mm-dd or YYYY/mm/dd).

end

End date for estimation. Can be an integer or a date (YYYY-mm-dd or YYYY/mm/dd).

date.first.obs

Optional date of first observation, if t not specified.

time.step

Optional. If date of first observation is specified, number of day between each incidence observation.

AR

Attack rate as a percentage from total population.

S0

Initial proportion of the population considered susceptible.

methods

Vector of methods to be used for R/R0/Rt estimation. Must be provided as c("method 1", "method 2", ...).

Details

For internal use. Called by all implemented estimation methods. All integrity/class checks are handled by this core function. GT must be an object of class R0.GT, and epidemic curve along with time values are handled here. If you plan on calling manually any other estimation function, make sure data are provided with correct format.

The epidemic curve epid may be provided as a vector. In that case, a vector t may be provided with the dates of observation. If t is not numeric, an attempt is made to convert to dates with as.Date(). If t is not provided, dates are obtained from the names of incid, and if not available, index values are used. Finally, one can provide an epidemic curve object generated by the epitools package (see check.incid() for more details).

A quick note on t, begin and end : when a date vector is provided (t), it will be used instead of index values to establish a date-related incidence. If no date vector is provided, then begin and end can still be forced to numeric values. It then links to the corresponding index values for incidence data. If a date vector is provided, begin and end can either be numeric values or dates. If numeric, they will link to the correspondig index values for incidence, and be afterward interpreted as the associated date. If date, they will be directly associated to incidence data.

Basicly, if specified, begin and end must always have the same class.

Value

A list with two components, begin and end.

Author(s)

Pierre-Yves Boelle, Thomas Obadia


R0 documentation built on Sept. 26, 2023, 5:10 p.m.

Related to integrity.checks in R0...