Format observations and model settings for use with stan
Usage
epict_convert_to_list(
obs,
piecewise_formula = epict::piecewise_formula(~1, obs),
adjustment_formula = epict::adjustment_formula(~1, obs),
priors = epict::epict_priors(),
model_opts = epict::epict_model_opts(),
inference_opts = epict::epict_inference_opts()
)
Arguments
- obs
A data.frame with the following variables:
id
: An integer vector uniquely identifying eahc infection.test_id
: An integer vector uniquely identiying each testct_value
: Numeric cycle threshold value.t
: Relative (to a baseline) time of the test yielding a Ct value.t_rel_uncensored
: Time of test relative to the first uncensored Ct value for that id.onset_t
: Relative (to a baseline) time of onset for each infectiononset_t_rel_uncensored
: Time of onset relative to the first uncensored Ct value for that id. (optional). NA if unavailable/asymptomatic.censored
: Logical, indicating if the Ct has been censored.
- piecewise_formula
A list describing the piecewise linear cycle threshold formula as described by
piecewise_formula()
.- adjustment_formula
A list describing the cycle threshold linear adjustment formula (shift and scale) as described by
adjustment_formula()
.- priors
A data.table of population-level priors as produced by
epict_priors()
.- model_opts
A list of model options. See
epict_model_opts()
for details- inference_opts
A list of options to use for inference. See
epict_inference_opts()
for details.
See also
Functions used for modelling
epict_inits()
,
epict_model()
,
epict_priors()