Skip to contents
  • shift_doses(): Shift doses based on the vaccination schedule to match the birth cohort.

  • compute_shift_prop(): Calculate shift proportions based on the vaccination schedule and the birth distribution to accommodate the birth cohort.

Usage

shift_doses(
  ri_data,
  ...,
  shift_prop = NULL,
  shift_mode = "full",
  vs_info = NULL,
  birth_seasonality = NULL
)

compute_shift_prop(
  vs_info,
  dist_codes = deprecated(),
  ...,
  admin_info = NULL,
  birth_seasonality = NULL
)

Arguments

ri_data

[data.frame] Routine immunization data in the format required by impute_missing_doses(). Missing values are permitted only in vaccine-dose columns.

...

Forces optional arguments to be passed by name and allows for future extensions without breaking existing code. Must be empty.

shift_prop

[data.frame] Contains the shift proportions for each vaccine dose in each administrative unit, computed using compute_shift_prop().

shift_mode

['full' | 'partial'] Indicates the dose shifting assumption (see Shifting assumptions section in details).

vs_info

[data.frame] The vaccination schedule table preprocessed with preprocess_vs_info() which is structured as prep_dummy_vs_info. dummy_vs_info defines the structure of the raw format before preprocessing.

birth_seasonality

[data.frame] Contains the birth distribution across the 12 months of a year for each administrative unit as defined in dummy_birth_seasonality. If NULL, a uniform distribution is assumed, meaning that the live births are evenly distributed across the 12 months.

dist_codes

[character] [Deprecated] Optional character vector of administrative unit codes. This argument is deprecated as of version 0.2.0 and will be removed in a future version. Use the admin_info argument instead.

admin_info

[data.frame] Optional data frame containing the administrative unit column(s) defined by admin argument in config_pviem(). It can be any data containing those columns (e.g., ri_data or birth_seasonality). Required when birth_seasonality is not provided and monthly = FALSE (meaning yearly data) in config_pviem().

Value

  • shift_doses() [data.table]: The shifted doses with the same structure as ri_data.

  • compute_shift_prop() [data.table]: The shift proportions for each vaccine and dose in each administrative unit (see Shift proportion calculation section in details).

Details

Shifting assumptions

The shift_doses() function shifts doses to match the birth cohort based on the vaccination schedule. The shift is performed according to the specified shift_mode which can be either:

  • 'full' (default): Shift doses using the full proportion. This means that if the proportion is 0.5, half of the doses at a given time point (year or month) will be shifted to the previous time point. However, if the proportion is 1.25, the number of doses at a given time point will be moved to the previous time point and the same rule from the previous example applies to the remaining fraction (0.25) from the new time point.

  • 'partial': Shift doses using the integer part of the proportion. This means that if the proportion is 0.5, nothing happens. On the other hand, if the proportion is 1.25, the number of doses at a given time point will be moved to the previous time point. So the difference with the "full" mode is that nothing/everything is shifted.

Shift proportion calculation

When monthly = TRUE in config_pviem(), compute_shift_prop() calculates the shift proportions for each month-dose-vaccine combination by converting the age at which the dose is given in month. So the size of the output will be 12 (months) * number of doses * number of vaccines. The output format is:

  • month column: As defined month argument in config_pviem().

  • vaccine, dose: as in vs_info.

  • prop: Type numeric representing the proportion of the dose to be shifted to accommodate the birth cohort.

When monthly = FALSE, it calculates the shift proportions for each admin-dose-vaccine combination by converting the age at which the dose is given in year. So the size of the output will be number of admin units * number of doses * number of vaccines. if birth_seasonality is also provided, it is used to adjust the calculation; otherwise, births are assumed to be uniformly distributed across the 12 months of a year for all admin units. The output format is:

  • admin columns: All administrative columns as defined in admin in config_pviem().

  • vaccine, dose, prop: as in the previous output format.