Skip to contents

Reports and checks the difference between ACS block group reference counts and PUMS survey counts for households and persons. Use to validate alignment before and after weight adjustment, and to warn about severe mismatches.

Usage

check_diff(ref_counts, pums, settings)

Arguments

ref_counts

data.table with required columns:

  • ref_count_hh — ACS household reference count

  • ref_count_per — ACS person reference count Rows: one per block group. Keys: none required. Modified by reference: no (read-only).

pums

data.table with required columns:

  • WGTP — household weight

  • PWGTP — person weight

  • SPORDER — person order in household (1 = householder) Rows: one per person. Keys: none required. Modified by reference: no (read-only).

settings

list. Must include:

  • study_unit — 'household' or 'person'

  • adjust_pums_to_acs — whether adjustment is requested

Value

None. Prints formatted message to console.

Details

  • Calculates absolute and percent differences for household and person counts.

  • Formats a message reporting ACS and PUMS totals, differences, and percent differences.

  • If study_unit is 'household', reports both household and person differences; otherwise, only person difference.

  • If adjust_pums_to_acs is TRUE and any percent difference exceeds 10%, emits a warning message.

  • Used before and after weight adjustment to confirm alignment.

  • Does not modify data; only prints messages.

Settings

  • study_unit (direct): Determines which differences are reported. Default from config/settings.json.

  • adjust_pums_to_acs (direct): Controls warning emission. Default from config/settings.json.

See also

#' adjust_pums_to_reference

Examples

## Not run:
# check_diff(ref_counts, pums, settings)