Skip to contents

Adjusts PUMS data so unrelated householders are split into single-person households, matching survey treatment. Use when survey excludes unrelated householders from trip diaries.

Usage

adjust_unrelated_pums(pums, settings, age_adult = 18)

Arguments

pums

data.table with required columns:

  • SERIALNO <character/integer> — household ID

  • SPORDER — person order in household

  • AGEP — age of person

  • RELSHIPP_label — relationship label

  • VEH — number of vehicles

  • PINCP — person income

  • NP — household size

  • HINCP — household income Rows: one per person. Keys: (SERIALNO, SPORDER). Modified by reference: no (returns copy).

settings

list. Must include:

  • unrelated_adjustment

  • rng_seed

age_adult

integer. Age threshold for adult. Default: 18.

Value

data.table. Adjusted PUMS data with unrelated householders split out.

Details

  • Identifies unrelated adults using RELSHIPP_label and age threshold.

  • Assigns new household ID, sets household size to 1, allocates vehicles and income, and reduces original household's attributes.

  • Adjustments prevent negative values and maintain data integrity.

  • Returns a copy; does not modify by reference.

Settings

  • unrelated_adjustment (direct): Adjustment method. Default from config/settings.json.

  • rng_seed (direct): Random seed for reproducibility. Default from config/settings.json.

Examples

## Not run:
# pums <- ... # PUMS data
# settings <- ... # pipeline settings
# pums_adj <- adjust_unrelated_pums(pums, settings)
## End(Not run)