Title: | Computing Individual Components of the Gini and the Theil Indices |
---|---|
Description: | Computes individual contributions to the overall Gini and Theil's T and Theil's L measures and their decompositions by groups such as race, gender, national origin, with the three functions of iGini(), iTheiT(), and iTheilL(). For details, see Tim F. Liao (2019) <doi:10.1177/0049124119875961>. |
Authors: | Tim Liao |
Maintainer: | Tim Liao <[email protected]> |
License: | GPL-2 |
Version: | 1.0.2 |
Built: | 2025-02-27 03:15:31 UTC |
Source: | https://github.com/cran/iIneq |
The function computes individual components of the Gini index and their group-based decompositions. It takes as input an outcome variable, a grouping variable, and an optional sampling weight. It returns a data matrix of three columns containg individual contributions and their between- and within-group components. Because iGini is computational insensive, parallel processing is recommended, and the number of cores can be specified.
iGini(x, g, w=rep(1,length(x)),core=1)
iGini(x, g, w=rep(1,length(x)),core=1)
x |
Input continuous variable such as income. |
g |
A grouping variable containing integers, such gender coded 1 & 2. |
w |
An optional sampling weight variable. |
core |
An optional input for specifying the number of processing cores in your computer. When specified, you will need to have the doParallel package and the foreach package installed for conducting parallel processing to speed up the computation. |
The function outputs three variables, g.i, g.ikb, and g.ikw.
g.i |
This variable gives the individual contribtions to the overall Gini index. |
g.ikb |
This variable provides for each individual component of the Gini its between-group subcomponent. |
g.ikw |
This variable provides for each individual component of the Gini its within-group subcomponent. The g.ikb and g.ikw sum up to g.i for each i observation. |
Tim F. Liao. 2019. "Individual Components of Three Inequality Measures for Analyzing Shapes of Inequality.” Sociological Methods & Research Advance online publication. doi:10.1177/0049124119875961
data(ChickWeight) attach(ChickWeight) iGini.result <- iGini(weight,Diet,core=1)
data(ChickWeight) attach(ChickWeight) iGini.result <- iGini(weight,Diet,core=1)
The function computes individual components of Theil's L index (or Theil's second measure) and their group-based decompositions. It takes as input an outcome variable, a grouping variable, and an optional sampling weight. It returns a data matrix of three columns containg individual contributions and their between- and within-group components.
iTheilL(x, g, w=rep(1,length(x)))
iTheilL(x, g, w=rep(1,length(x)))
x |
Input continuous variable such as income. |
g |
A grouping variable containing integers, such gender coded 1 & 2. |
w |
An optional sampling weight variable. |
The function outputs three variables, g.i, g.ikb, and g.ikw.
g.i |
This variable gives the individual contribtions to the overall Gini index. |
g.ikb |
This variable provides for each individual component of the Gini its between-group subcomponent. |
g.ikw |
This variable provides for each individual component of the Gini its within-group subcomponent. The g.ikb and g.ikw sum up to g.i for each i observation. |
Tim F. Liao. 2019. "Individual Components of Three Inequality Measures for Analyzing Shapes of Inequality.” Sociological Methods & Research Advance online publication. doi:10.1177/0049124119875961
data(ChickWeight) attach(ChickWeight) iTheilL.result <- iTheilL(weight,Diet)
data(ChickWeight) attach(ChickWeight) iTheilL.result <- iTheilL(weight,Diet)
The function computes individual components of Theil's T index (or Theil's first measure) and their group-based decompositions. It takes as input an outcome variable, a grouping variable, and an optional sampling weight. It returns a data matrix of three columns containg individual contributions and their between- and within-group components.
iTheilT(x, g, w=rep(1,length(x)))
iTheilT(x, g, w=rep(1,length(x)))
x |
Input continuous variable such as income. |
g |
A grouping variable containing integers, such gender coded 1 & 2. |
w |
An optional sampling weight variable. |
The function outputs three variables, g.i, g.ikb, and g.ikw.
g.i |
This variable gives the individual contribtions to the overall Gini index. |
g.ikb |
This variable provides for each individual component of the Gini its between-group subcomponent. |
g.ikw |
This variable provides for each individual component of the Gini its within-group subcomponent. The g.ikb and g.ikw sum up to g.i for each i observation. |
Tim F. Liao. 2019. "Individual Components of Three Inequality Measures for Analyzing Shapes of Inequality.” Sociological Methods & Research Advance online publication. doi:10.1177/0049124119875961
data(ChickWeight) attach(ChickWeight) iTheilT.result <- iTheilT(weight,Diet)
data(ChickWeight) attach(ChickWeight) iTheilT.result <- iTheilT(weight,Diet)