Proposed interface:
fit <- fit_seromodel_covariates(
serosurvey = serodata,
formula = ~...,
covariates=...,
...
)
Note that by allowing covariates to be a data frame separate from the serosurvey, this allows more flexible types of covariates to be included. For example, time- or age-varying covariates.
Formula can indicate the model type. For example:
Constant model:
Time-varying model:
Age-varying model:
Formula can also be used to specify, for example, covariate effects:
or it can be used to allow a difference in the base rate by a multiplicative factor across regions;
formula = ~ sex + (1 | region)
In the above, if the model is a time-varying model this would mean a decomposition of the form:
$$
\log \lambda(t,region) = \eta(t) + \theta(region) + beta * sex
$$
Alternatively, we could also allow each region to have its own time-varying base:
formula = ~ sex + (time | region)
$$
\log \lambda(t,region) = \eta(t, region) + beta * sex
$$
We could also output a regression summary type thing here.
We could also do:
Note: existing users could use fit_seromodel with model_type which would internally call fit_seromodel_covariates.
Ideas:
- We may want to make a shiny app to facilitate users in choosing an appropriate prior for the FOI
- Facilitate prior-predictive checks
- Workflow for setting priors; e.g. try fitting model with males/females separately
Proposed interface:
Note that by allowing
covariatesto be a data frame separate from the serosurvey, this allows more flexible types of covariates to be included. For example, time- or age-varying covariates.Formula can indicate the model type. For example:
Constant model:
Time-varying model:
Age-varying model:
Formula can also be used to specify, for example, covariate effects:
or it can be used to allow a difference in the base rate by a multiplicative factor across regions;
In the above, if the model is a time-varying model this would mean a decomposition of the form:
Alternatively, we could also allow each region to have its own time-varying base:
We could also output a regression summary type thing here.
We could also do:
Note: existing users could use
fit_seromodelwithmodel_typewhich would internally callfit_seromodel_covariates.Ideas: