Skip to contents

make_medicare_ds() is a Make function that creates a new R object. Specifically, this function implements an algorithm to make medicare dataset. The function returns a Medicare Benefits Schedule (an output object of multiple potential types).

Usage

make_medicare_ds(
  mbs_raw_tb = get_medicare_data(clean_1L_lgl = TRUE),
  as_dyad_1L_lgl = TRUE,
  erp_tb = make_erp_ds(as_dyad_1L_lgl = FALSE),
  age_bands_lup = NULL,
  age_group_var_1L_chr = "AgeGroup",
  index_1L_chr = "Quarter",
  key_vars_chr = c("Sex", "Age"),
  metrics_chr = c("Patients", "Services"),
  new_metrics_chr = c("ServicesPerPatient", "PatientsPerPerson", "ServicesPerPerson"),
  names_from_1L_chr = "Measure",
  population_var_1L_chr = "Persons",
  provider_var_1L_chr = "ProviderType",
  rename_age_to_1L_chr = "Age",
  rename_provider_to_1L_chr = "ServiceType",
  scale_1L_int = 1,
  scaled_naming_1L_chr = "{.col}Scaled",
  values_to_1L_chr = "Value",
  years_chr = c("2021-22", "2022-23")
)

Arguments

mbs_raw_tb

Medicare Benefits Schedule raw (a tibble), Default: get_medicare_data(clean_1L_lgl = TRUE)

as_dyad_1L_lgl

As dyad (a logical vector of length one), Default: TRUE

erp_tb

Estimatedesident Population (a tibble), Default: make_erp_ds(as_dyad_1L_lgl = FALSE)

age_bands_lup

Age bands (a lookup table), Default: NULL

age_group_var_1L_chr

Age group variable (a character vector of length one), Default: 'AgeGroup'

index_1L_chr

Index (a character vector of length one), Default: 'Quarter'

key_vars_chr

Key variables (a character vector), Default: c("Sex", "Age")

metrics_chr

Metrics (a character vector), Default: c("Patients", "Services")

new_metrics_chr

New metrics (a character vector), Default: c("ServicesPerPatient", "PatientsPerPerson", "ServicesPerPerson")

names_from_1L_chr

Names from (a character vector of length one), Default: 'Measure'

population_var_1L_chr

Population variable (a character vector of length one), Default: 'Persons'

provider_var_1L_chr

Provider variable (a character vector of length one), Default: 'ProviderType'

rename_age_to_1L_chr

Rename age to (a character vector of length one), Default: 'Age'

rename_provider_to_1L_chr

Rename provider to (a character vector of length one), Default: 'ServiceType'

scale_1L_int

Scale (an integer vector of length one), Default: 1

scaled_naming_1L_chr

Scaled naming (a character vector of length one), Default: '.colScaled'

values_to_1L_chr

Values to (a character vector of length one), Default: 'Value'

years_chr

Years (a character vector), Default: c("2021-22", "2022-23")

Value

a Medicare Benefits Schedule (an output object of multiple potential types)