Builds hsize by counting how many records share the same household
identifier. This is required for household income construction and for the
internal household-scale adjustment used in representativity diagnostics when
household-level values are repeated across household members.
Arguments
- data
A data frame.
- household_id
Household identifier variable. Defaults to
"idhogar". If"idhogar"is not present but"id_hogar"is present, the function uses"id_hogar"automatically.- hsize_name
Name of the output household-size variable. Defaults to
"hsize".- overwrite
Logical. If
TRUE, overwrites an existinghsize_namevariable.