help for ginidecomp Authors: Vesa-Matti Heikkuri and Matthias Schief (revised Jan 2025)

Syntax

ginidecomp varname [weights]
[if exp] [in range]
[, bygroup(groupvar)]

fweights, aweights, pweights, and iweights
are allowed; see weights.

Multiple variables may be provided as groupvar. In this case, the program will use the egen group() command to define population subgroups based on the unique combinations of values across all the specified variables; see egen.

Description

The ginidecomp command calculates the Gini coefficient and decomposes it by population subgroups. The decomposition follows the methodology introduced in Heikkuri and Schief (2024).

By default, missing values in the groupvar variables are treated as group identifiers. If you wish to exclude observations with missing groupvar values, you should use the if !missing(groupvar) option (see example below).

If the bygroup option is not specified, the program only returns the aggregate Gini coefficient.

Technical details

Consider a population that is partitioned into K subgroups and suppose we want to decompose income inequality. Subgroup k’s Gini coefficient, population share, and income share are denoted by G_k, pi_k, and theta_k, respectively.

The within-group inequality term is a weighted power mean of subgroup Gini coefficients with each subgroup weighted by the geometric mean of its
income and population share:

G_w = [∑ (pi_k theta_k G_k)^(1/2)]^2

The between-group inequality is the difference between the cross mean absolute difference, Theta, and a weighted sum of geometric averages of subgroup mean absolute differences, delta_k, divided by twice the aggregate mean, mu:

G_w = (2 mu)^(-1) [Theta - ∑∑ pi_k pi_l sqrt(delta_k delta_l)]

Theta is obtained as the population mean absolute difference when evaluating all within-group differences as zero. For details, see Heikkuri and Schief (2024).

Options

bygroup(groupvar) requests inequality decompositions by population
subgroup, with subgroup membership defined by groupvar.

Saved results

r(gini) Aggregate Gini coefficient

r(within) Within-group inequality
r(between) Between-group inequality

r(within_pct) Within-group inequality (%)
r(between_pct) Between-group inequality (%)

Examples

. ginidecomp income [aw = wgtvar]

. ginidecomp income, by(age_group)

. ginidecomp income if fullTimeWork==1, by(age_group)

. ginidecomp income, by(age_group sex)

. ginidecomp income if !missing(age_group) & !missing(sex), by(age_group sex)

. ginidecomp income in 1/100, by(sex)

Authors

Vesa-Matti Heikkuri <vesa-matti.heikkuri@tuni.fi>

Tampere University

Matthias Schief <matthias.schief@oecd.org>

Organisation for Economic Co-operation and Development (OECD)

Acknowledgements

The program ginidecomp partly builds on "ineqdecgini.ado" by Stephen P. Jenkins

References

Heikkuri, Vesa-Matti, and Matthias Schief. Subgroup Decomposition of the Gini Coefficient: A New Solution to an Old Problem. FIT Working Paper 30, 2024.
https://verotutkimus.fi/verotutkimus/wp-content/uploads/2024/12/FIT-WP-30-Heikkuri-Schief-Gini-Decomposition-3.pdf.