Fetch ACS ethnicity table for imputation
get_acs_ethnicity.RdRetrieves and formats ACS ethnicity data for use in survey imputation, supporting binary or multi-level ethnicity. Use for imputing ethnicity in survey data using ACS reference.
Usage
get_acs_ethnicity(
settings,
ethnicity_levels,
year = NULL,
is_binary = TRUE,
return_counts = FALSE
)Details
Fetches ACS table for block group (binary) or tract (multi-level).
Applies string replacements and recodes topcoded variables.
Checks consistency with target levels and sums.
Returns data.table with GEOID and fraction/count columns.
Assumes settings include ACS year and target levels.
See also
fetch_acs
Other imputation utilities:
calculate_acs_proportions(),
get_acs_race(),
get_hh_person_sums(),
impute_ethnicity(),
impute_gender(),
impute_income_nonrelatives(),
impute_income_pnta(),
impute_race(),
make_binary(),
prep_hhs_for_income_imputation(),
prepare_acs_income(),
prepare_ethnicity_labels(),
prepare_ethnicity_survey_data(),
prepare_impute_targets(),
prepare_income_fit_dt(),
prepare_persons_dt(),
update_hh_income_imputed()
Examples
## Not run:
get_acs_ethnicity(settings, c('hispanic', 'not_hispanic'))
#> Error in get_acs_ethnicity(settings, c("hispanic", "not_hispanic")): could not find function "get_acs_ethnicity"