help for iGiniTim F. Liao (May 2018)

Gini index decomposition by individual and group

Syntax

iGini varname [weights] [if exp] [in range]
[, byg(groupvar) ]

fweights and aweights are allowed; see help weight.

Description

iGini computes a refined Gini inequality index decomposition by decomposing the overall index into individual contributions to the Gini and further into the between-group and within-group components for each individual case. In addition to the main outcome variable, the by-group is typically required. Sampling weight is optional, and can be included as an aweight. The program iGini generates a new dataset of the same size as the input data, containing six variable: an id variable bearing the case number ordered in the same sequence as the original data, a group variable that records the group membership number, the iGini individual contributions to the Gini index, the iGini between-group component, the iGini within-group component, and a quantile variable reflecting the membership in either the lower or the upper half of the outcome variable distribution within each level of the group variable. The last quantile variable can be useful when used jointly with iGini components.

Techical Details

iGini computes a refined Gini inequality index. The relation between an individual iGini g_i component and the overall Gini idex G is

G = g_1 + g_2 + ... + g_N

The relation between an individual iGini g_i component and its between and within subcomponents g_ib and g_iw is

g_i = g_ib + g_iw

groupvar must take on only positive integer values greater than 0 such as 1, 2, ..., G.
To create such a variable from an existing variable, use the egen function group.
By default, observations with missing values on groupvar are excluded from calculations.

iGini is computation-intensive. To surpass the upper limit of the number of cases in Stata, the ado uses Stata's Mata, and can handle as many cases as your system allows. Thus, computation time can be long if you have more than ten thousand cases. To speed up, you may consider using Stata MP or the ado parallel.

Options

There is only one "option" implemented in the current version of iGini. It is required to run iGini.

byg groupvar requests iGini decomposition by social groups, with group membership specified by groupvar.

Resulting data

The iGini decomposition produces the following variables replacing the original
dataset: ID, Group, iGini, iGinib, and iGiniw, in that order.

Saved results

The saved internal results include the following:

Scalars

r(Gini) The overall Gini index

r(Gini_between) between-group component of iGini

r(Gini_within) within-group component of iGini

Computing iGini only

In the rare instance, you may not have a reasonable grouping variable to use but still want compute iGini. In that event, you may generate a vector of 1s by gen one=1 and use the constant one as the grouping variable. The program will simply slpit the sample into two groups, with the first half of the data get assigned a value of "1" and the second, a value of "2."

Examples

. iGini y, by(Sex)

. iGini y [aw = weight], by(Race)

. iGini inc [aw = weight], byg(SexRace)

For computing iGini only without group-based decomposition:

. gen one = 1

. iGini outcome [aw = weight], by(one)

Examples Using the Auto Dataset

. use auto

. gen origin = foreign + 1

. iGini mpg, by(origin)

Author

Tim F. Liao <tfliao@illinois.edu>

Center for Advanced Studies in the Behaviorial Sciences & University of Illinois at Urbana-Champaign

Acknowledgements

The author acknowledges the 2017-2018 fellowship support by the Center for Advanced Studies in the Behaviorial Sciences. Comments and suggestions will be welcome for debugging and updating iGini.

References

Tim F. Liao. Forthcoming.
"Individual Components of Three Inequality Measures for Analyzing Shapes of Inequality."
Sociological Methods & Research
: in press.