household

Define functions to count households by income, household type, age and household size.

Functions definded in this script: - Load data on person level - Define changes in disaggregagtion of different SOEP variables and replace encoding - Calculate income quintiles - Caclulate weighted shares for one variable (e.g. income)

Disaggregation of heouseholds in inhabit matrix: Region –> Income Quantile –> household type –> age –> number of people

Functions are applied in “inhabit_matrix.py”.

Functions

age_class(df, ip, col_name)

Assign age classes to every person.

household_types(df, ip, col_name)

Replace encoding of household types with own encoding.

income_quintiles(df, ip, col_name)

Calculate income quintiles for df and add them in "income_quintile" column.

size_class(df, ip, col_name)

Assign Household size class to every person.