Skip to contents

Adjusts person weights to account for unrelated persons (e.g., nonrelatives, roommates, household help) who are typically excluded from survey expansion. Use internally when adjusting day weights to ensure surveyable persons are weighted correctly and unrelated persons are excluded or reallocated.

Usage

adjust_unrelated_per_wts(person_weights, persons, value_labels, settings)

Arguments

person_weights

data.table with required columns:

  • person_id <character/integer> — unique person identifier

  • hh_id <character/integer> — household identifier

  • day_group <character/integer> — day group for weighting

  • person_weight — initial person weight Rows: one per person-day. Keys: (person_id, hh_id, day_group). Modified by reference: no (returns copy).

persons

data.table with required columns:

  • person_id <character/integer> — unique person identifier

  • hh_id <character/integer> — household identifier

  • relationship — relationship to householder

  • surveyable — 1 if included in survey, 0 otherwise (optional) Rows: one per person. Keys: (person_id). Modified by reference: no (read-only).

value_labels

data.table with required columns:

  • variable — variable name

  • label — value label

  • value <character/integer> — coded value Rows: one per label. Keys: (variable, value). Modified by reference: no (read-only).

settings

list. Must include relevant survey pipeline settings.

Value

data.table. Person weights with unrelated persons excluded and weights reallocated. Same schema as input.

Details

  • Identifies unrelated persons using relationship labels and surveyable status.

  • Calculates the number of surveyable persons per household and normalizes adjustment.

  • Sums unrelated person weights per household and reallocates their weights to surveyable members.

  • Sets person weight to zero for unsurveyed/unrelated persons.

  • Returns a copy; does not modify by reference.

  • Assumes person weights may be unequal and handles normalization accordingly.

Settings

None directly referenced; relies on survey pipeline context.

See also

Examples

## Not run:
# person_weights <- ... # person weights table
# persons <- ... # persons table
# value_labels <- ... # value labels table
# settings <- ... # pipeline settings
# adj <- adjust_unrelated_per_wts(person_weights, persons, value_labels, settings)
## End(Not run)