Skip to contents

This function estimates current coverage, by age and location.

Usage

imuGAP(
  observations,
  obs_populations,
  locations,
  dose_schedule,
  imugap_opts = imugap_options(),
  stan_opts = stan_options()
)

Arguments

observations

a data.frame, the observed data, with at least two columns:

  • a column named "positive", or the first column; a non-negative integer, the observed number of vaccinated individuals

  • a column named "sample_n", or the second column: a positive integer, the number of individuals sampled

  • if there exists a column "id", it must be unique, and will be used as the primary key for the observation data; otherwise, a unique id will be created based on the row number

obs_populations

a data.frame providing the meta-data about the observations. Briefly, it should capture for each observation the relevant location(s), cohort(s), age(s), dose, and relative contribution of that population to the observation. Each row in obs should have one or more corresponding rows in wts. The wts data.frame should have at least the following columns:

  • a column named "obs_id", with a value in the "id" column in obs

  • "location", a positive integer, distinguishing locations.

  • "cohort", a positive integer, distinguishing cohorts

  • "age", a positive integer, distinguishing when this observation applies for this location/cohort

  • "dose", a positive integer, which dose this observation applies to

  • "weight", a positive numeric value, representing the relative contribution of that population to the observation

locations

the location hierarchy, a data.frame with two columns:

  • "id", a positive integer, the location id

  • "parent_id", a positive integer or NA, the parent location id; the root location should have NA as its parent_id

dose_schedule

a numeric vector of length 2, the ages at which dose 1 and dose 2 are scheduled

imugap_opts

options for the imuGAP model

stan_opts

passed to rstan::sampling (e.g. iter, chains).

Value

An object of class stanfit returned by rstan::sampling