Decomposes by population subgroups a generalized entropy inequality measure
within a vector.
Usage
decompGEI(x, z, w = NULL, alpha = 1, ELMO = TRUE)
Arguments
x
Numeric vector with non-negative values (strictly positive
when alpha=0 or alpha=1).
z
Factor who determines the subgroups.
w
Numeric vector of sampling weigths (optional).
alpha
Parameter of the generalized entropy index. Theil index (TT) is
calculated for alpha=1, the mean log deviation (TL) for
alpha=0.
ELMO
When ELMO is TRUE, a "maximum" between-group inequality index is
estimated using the Elbers and alii method (2005).
Value
A list of class "ICI" with components:
ineq
a list with components GEI (value of inequality index)
and alpha (value of parameter).
decomp
a list with components within (value of within-group
inequality), between (value of between-group inequality) and,
if ELMO is TRUE, betweenELMO (value of maximum
between-group inequality).
intra
a list with components GEIGroups (the subgroup values of
inequality index) and contribGEIGroups (the contribution of each
subgroup to the total within-groups inequality).
ws
a list with components wIntra (the subgroup weights)
and sIntra (the subgroup shares of x).
nas
a list with NA counts, including components xNA,
zNA, wNA and totalNA.
References
Cowell F.A. (2000) Measurement of Inequality. In Atkinson A.B., Bourguignon F.
(Eds.) Handbook of Income Distribution. Elsevier, Vol. 1, pp. 87-166.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(IC2)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IC2/decompGEI.Rd_%03d_medium.png", width=480, height=480)
> ### Name: decompGEI
> ### Title: Decomposition by Groups for GEI
> ### Aliases: decompGEI
>
> ### ** Examples
>
> data(hhbudgets)
>
> decompGEI(hhbudgets[,"ingreso"], hhbudgets[,"estructura"], alpha=4)
$ineq
$ineq$index
GEI
128.0722
$ineq$parameter
alpha
4
$decomp
$decomp$within
[1] 128.0624
$decomp$between
[1] 0.00984258
$decomp$betweenELMO
[1] 23.42324
$intra
$intra$GEIGroups
unipersonal nuclear ampliado compuesto coresidente
3.9893931 181.5403932 4.8945765 0.7425743 0.1760261
$intra$contribGEIGroups
unipersonal nuclear ampliado compuesto coresidente
0.12572964 126.50647452 1.39971064 0.01596111 0.01448319
$ws
$ws$wIntra
unipersonal nuclear ampliado compuesto coresidente
0.114476790 0.614083399 0.263965382 0.003540519 0.003933910
$ws$sIntra
unipersonal nuclear ampliado compuesto coresidente
0.082922195 0.633804602 0.269302892 0.005557520 0.008412791
$nas
$nas$xNA
[1] 0
$nas$zNA
[1] 0
$nas$wNA
NULL
$nas$totalNA
[1] 0
attr(,"class")
[1] "ICI"
> summary(hhbudgets[,"tenencia"]) #35 NA's
rentada prestada propia_pagando propia litigio
501 432 159 1343 63
otra NA's
9 35
> decompGEI(x=hhbudgets[,"transporte"], z=hhbudgets[,"tenencia"], w=hhbudgets[,"factor"], ELMO=FALSE)
NULL
> summary(decompGEI(x=hhbudgets[,"transporte"], z=hhbudgets[,"tenencia"], w=hhbudgets[,"factor"], alpha=1.5))
GEI alpha
0.61155 1.50000
Decomposition:
within between
0.599633 0.011912
betweenELMO
0.42559
>
>
>
>
>
> dev.off()
null device
1
>