Skip to contents

Pre-process hospital admissions data, converting column names to those that get_stan_data() expects.

Usage

preprocess_count_data(
  count_data,
  count_col_name = "daily_hosp_admits",
  pop_size_col_name = "state_pop"
)

Arguments

count_data

dataframe containing the following columns: date, a count column, and a population size column

count_col_name

name of the column containing the epidemiological indicator, default is daily_hosp_admits

pop_size_col_name

name of the column containing the population size of that the counts are coming from, default is state_pop

Value

a dataframe containing the hospital admissions data renamed to have the following columns date, count, and total_pop

Examples

hosp_data <- tibble::tibble(
  date = lubridate::ymd(c("2023-11-01", "2023-11-02")),
  daily_admits = c(10, 20),
  state_pop = c(1e6, 1e6)
)
hosp_data_preprocessed <- preprocess_count_data(
  hosp_data,
  "daily_admits",
  "state_pop"
)