euromod.eu_euromod.calibrate.descriptives ========================================= .. py:module:: euromod.eu_euromod.calibrate.descriptives .. autoapi-nested-parse:: Statistics that describe a household sample. All functions take a household sample and return a small table. Quantiles are quantiles of gross income over the whole sample, with survey weights; percentages are on a 0-100 scale. Below are listed the main public classes of the euromod.eu_euromod.calibrate.descriptives module. .. list-table:: **Function** :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`benefit_ratio_by_quantile `\ (sample, n, benefit, income) - Benefits as a share of gross income, by income quantile. * - :py:obj:`family_composition `\ (sample) - How marriage and children go together in the sample. * - :py:obj:`gini_coefficients `\ (sample) - Gini coefficients of gross and disposable household income. * - :py:obj:`income_shares `\ (sample, n) - Share of total income held by each quantile, for gross and disposable income. * - :py:obj:`sample_characteristics `\ (sample) - Size and composition of the sample. * - :py:obj:`tax_rates_by_quantile `\ (sample, n, household\_types) - Mean net tax rate by income quantile, for each household type. Functions --------- .. py:function:: benefit_ratio_by_quantile(sample, n=10, benefit='ils_benmt', income='ils_origrepy') Benefits as a share of gross income, by income quantile. The ratio is computed for each household and then averaged, so it describes the typical household in a quantile rather than the quantile's totals. :param sample: A household sample. :type sample: pandas.DataFrame :param n: Number of quantiles. :type n: :obj:`int` :param benefit: Household total to take the ratio of; default means-tested benefits. :type benefit: :obj:`str` :param income: Household gross income the sample was built with. :type income: :obj:`str` :returns: Rows ``Q1..Qn`` and ``all``; columns ``ratio`` (mean ratio, in percent) and ``weight`` (total survey weight, for combining quantiles). :rtype: pandas.DataFrame .. py:function:: family_composition(sample) How marriage and children go together in the sample. :returns: Shares between 0 and 1: ``children_among_single`` and ``children_among_married`` (households with children, among those with an unmarried or a married head), ``single_among_children`` and ``married_among_children`` (the reverse). :rtype: dict .. py:function:: gini_coefficients(sample) Gini coefficients of gross and disposable household income. :returns: ``gross`` and ``disposable``. :rtype: dict .. py:function:: income_shares(sample, n=5) Share of total income held by each quantile, for gross and disposable income. Each column ranks households by its own income: gross shares by gross income, disposable shares by disposable income. :param sample: A household sample. :type sample: pandas.DataFrame :param n: Number of quantiles (5 for quintiles). :type n: :obj:`int` :returns: Rows ``Q1..Qn``; columns ``gross`` and ``disposable``, in percent. :rtype: pandas.DataFrame .. py:function:: sample_characteristics(sample) Size and composition of the sample. :returns: ``n`` (households), ``head_age`` (mean age of the head), ``share_married`` (share of households with a married head), ``share_children`` (share with at least one child), ``children_per_family`` (mean number of children among households that have any) and ``hh_size`` (mean household size). Shares are between 0 and 1. All means use survey weights. :rtype: dict .. py:function:: tax_rates_by_quantile(sample, n=10, household_types=HOUSEHOLD_TYPES) Mean net tax rate by income quantile, for each household type. The quantiles are those of the whole sample, so a column compares households of one type with all households at the same income. :param sample: A household sample. :type sample: pandas.DataFrame :param n: Number of quantiles (10 for deciles). :type n: :obj:`int` :param household_types: Conditions by name; default :data:`HOUSEHOLD_TYPES`. :type household_types: :obj:`dict` :returns: Rows ``Q1..Qn``; one column per household type, in percent. :rtype: pandas.DataFrame