Skip to contents

A data frame containing dummy data for vaccination schedule in fakeland country in its preprocessed format, ready for use in immunity estimation.

Usage

prep_dummy_vs_info

Format

A data frame with 4 rows and 3 columns:

vaccine

[character] Vaccine name (e.g., 'OPV').

dose

[character] Dose identifier: <vaccine><dose_num> (e.g., 'OPV1').

age

[numeric] Age the dose is given in years (converted to consistent unit).

Source

Reprocessed dummy_vs_info using preprocess_vs_info()

Details

Preprocessing Steps

The preprocess_vs_info() function performs:

  1. Validates the input (the raw schedule table) against the rules specified for dummy_vs_info. See Validation rules section in validate_vs_info() for details on validation rules.

  2. Converts all ages to a consistent unit (years)

  3. Creates the dose with the format <vaccine><dose_num> (e.g., 'OPV1') from the raw schedule table (see dummy_vs_info). In case you are creating the preprocessed table manually, adding leading zeros to dose numbers is not allowed (i.e., 'VAX01' is not valid if vaccine is 'VAX' but it is if vaccine is 'VAX0').

  4. Removes the dose_num and age_unit columns.

See preprocess_vs_info() for more details about the steps.

See also

dummy_vs_info for raw format, preprocess_vs_info() for preprocessing function, prep_dummy_efficacy for related preprocessed efficacy data, validate_vs_info() for validation function

Examples

# \donttest{
# View preprocessed schedule
print(prep_dummy_vs_info)
#>   vaccine dose       age
#> 1     OPV OPV0 0.0000000
#> 2     OPV OPV1 0.1153846
#> 3     IPV IPV1 0.1153846
#> 4     IPV IPV2 0.5000000

# Validate the preprocessed schedule
validate_vs_info(prep_dummy_vs_info, preprocessed = TRUE)

# Check age conversion
prep_dummy_vs_info |>
  dplyr::left_join(
    dummy_vs_info |>
      dplyr::group_by(vaccine) |>
      dplyr::mutate(
        age_years = dplyr::case_when(
          age_unit == "week" ~ age / 52,
          age_unit == "month" ~ age / 12,
          age_unit == "year" ~ age
        ),
        dose = paste0(vaccine, dose_num)
      ) |>
      dplyr::ungroup() |>
      dplyr::select(dose, age_years),
    by = c("dose")
  )
#>   vaccine dose       age age_years
#> 1     OPV OPV0 0.0000000 0.0000000
#> 2     OPV OPV1 0.1153846 0.1153846
#> 3     IPV IPV1 0.1153846 0.1153846
#> 4     IPV IPV2 0.5000000 0.5000000
# }