Skip to contents

Internal function to create multiple imputed datasets with arsenic exposure levels based on county-level probability distributions.

Usage

impute_arsenic_exposure(
  datmatx_usgs,
  rasterprob_combined,
  cellpop,
  births,
  ndraws,
  as_cat_label,
  geoid_col,
  birth_county_col,
  as_level_col,
  apply_imputation_fallback
)

Arguments

datmatx_usgs

Data frame containing USGS data with geographic identifiers

rasterprob_combined

Matrix of combined probability distributions

cellpop

Vector of cell population weights

births

Data frame containing birth records

ndraws

Number of imputed datasets to create

as_cat_label

Character vector of arsenic category labels

geoid_col

Column name for geographic identifier in USGS data

birth_county_col

Column name for county identifier in birth data

as_level_col

Column name for arsenic level variable

apply_imputation_fallback

Logical indicating whether to apply fallback imputation for missing arsenic levels. The fallback fills missing values with the most common category in the respective dataset. If enabled, this fallback will be applied to any missing arsenic levels after the initial imputation step. Otherwise, it will remove any rows with missing arsenic levels.

Value

List of imputed datasets