Skip to contents

Harmonizes household income categories between survey and ACS data by mapping detailed and followup bins to a unified income_broad variable. Use in weighting pipelines to ensure consistent income stratification.

Usage

get_income_broad(households, value_labels, settings, max_income_bin = NULL)

Arguments

households

data.table with required columns:

  • income_detailed — detailed income bin

  • income_followup — followup income bin Additional columns as needed for household attributes Rows: one per household. Modified by reference: no.

value_labels

data.table with required columns:

  • variable — variable name (e.g., income_detailed)

  • value — bin code

  • label — bin label Rows: one per bin. Modified by reference: no.

settings

list. Must include project settings for bin mapping.

max_income_bin

integer. Maximum income bin. Default: from settings or value_labels.

Value

data.table with columns:

  • All input columns

  • income_broad — recoded broad income bin

  • income_broad_label — label for broad bin Rows: one per household.

Details

  • Joins income_detailed and income_followup columns to broad bins using value_labels and settings.

  • Handles missing and top-coded values; assigns 999 for missing or unallocatable cases.

  • Creates new value labels for income_broad and appends to value_labels.

  • Returns a copy; does not modify by reference.

  • Assumes valid input tables and settings; errors if missing or bins are not represented.

  • Example mapping:

    income_detailedincome_followupincome_broad
    Less than $15,000Under $25,0001
    $15,000-$24,999Under $25,0001
    $25,000-$34,999$25,000-$49,9992
    $35,000-$49,999$25,000-$49,9992
    $50,000-$74,999$50,000-$74,9993
    $75,000-$99,999$75,000-$99,9994
    $100,000-$149,999$100,000-$249,999999
    $150,000-$199,999$100,000-$249,999999
    $200,000-$249,999$100,000-$249,999999
    $250,000 or more$250,000 or more999

Settings

  • max_income_bin (direct): maximum income bin. Default from settings/value_labels.

Examples

## Not run:
get_income_broad(households, value_labels, settings)
#> Error: object 'households' not found
## End(Not run)