Report ACS vs. PUMS count differences
check_diff.RdReports 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.
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
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_unitis 'household', reports both household and person differences; otherwise, only person difference.If
adjust_pums_to_acsis 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.