Skip to content

Structure for incorporating covariates into a fit_seromodel_covariates function #306

@ben18785

Description

@ben18785

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:

formula ~ 1

Time-varying model:

formula ~ time

Age-varying model:

formula ~ age

Formula can also be used to specify, for example, covariate effects:

formula = ~ sex

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:

formula = ~ (age | sex)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions