Last data update: 2014.03.03

R: The Gini coefficient adjusted for negative attributes (Chen,...
Gini_CTR_BSR Documentation

The Gini coefficient adjusted for negative attributes (Chen, Tsaur and Rhai, 1982, Berebbi and Silber, 1985)

Description

computes the Gini coefficient adjusted for negative (even weighted) data.

Usage

Gini_CTR_BS(y,w)

Arguments

y

a vector of attributes containing even negative elements

w

a vector containing the weights associated with the elements of the attribute vector

Details

Gini_CTR_BS(y,w) is the Gini coefficient for negative data proposed by Chen, Tsaur and Rhai (1982) and subsequenty improved by Berebbi and Silber (1985). It is based on a normalization factor adding the part of the concentration area lying below the x-axis and provides a value always included into the close range [0,1].

Value

the value of the Gini coefficient adjusted for negative attributes.

Note

If the vector w contains unitary elements, compute Gini_CTR_BS as Gini_CTR_BS(y).

Author(s)

Emanuela Raffinetti, Fabio Aimar

References

C.N. Chen, T.W. Tsaur, T.S. Rhai (1982), The Gini coefficient and negative income, Oxford Economic Papers 34, 473–478

Z.M. Berrebi, J. Silber (1985), The Gini coefficient and negative income: a comment, Oxford Economic Papers 37, 525–526

See Also

ineq, IC2

Examples

# generate the vector of attributes with even negative elements
y<-c(-7,-15,11,-10,2,4,40)
# generate the vector of weights
w<-c(2.5,1.1,3.6,4.4,0.8,2.7,1.9)
# compute the Gini coefficient adjusted for negative values
Gini_CTR_BS(y,w)

data(BI2012)
# define the vector of weights
w<-BI2012$weight 

# select the vector of incomes (e.g., the incomes from transfers YTA)
y<-BI2012$YTA
# compute the Gini coefficient adjusted for negative values
Gini_CTR_BS(y,w)

# select the vector of incomes (e.g., the incomes from financial capital gain YCF)
y<-BI2012$YCF
# compute the Gini coefficient adjusted for negative values
Gini_CTR_BS(y,w)

Results


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(GiniWegNeg)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GiniWegNeg/Gini_CTR_BS.Rd_%03d_medium.png", width=480, height=480)
> ### Name: Gini_CTR_BS
> ### Title: The Gini coefficient adjusted for negative attributes (Chen,
> ###   Tsaur and Rhai, 1982, Berebbi and Silber, 1985)
> ### Aliases: Gini_CTR_BS
> 
> ### ** Examples
> 
> # generate the vector of attributes with even negative elements
> y<-c(-7,-15,11,-10,2,4,40)
> # generate the vector of weights
> w<-c(2.5,1.1,3.6,4.4,0.8,2.7,1.9)
> # compute the Gini coefficient adjusted for negative values
> Gini_CTR_BS(y,w)
$GINI_CTR_BS
[1] 0.9740317

> 
> data(BI2012)
> # define the vector of weights
> w<-BI2012$weight 
> 
> # select the vector of incomes (e.g., the incomes from transfers YTA)
> y<-BI2012$YTA
> # compute the Gini coefficient adjusted for negative values
> Gini_CTR_BS(y,w)
$GINI_CTR_BS
[1] 0.9910092

> 
> # select the vector of incomes (e.g., the incomes from financial capital gain YCF)
> y<-BI2012$YCF
> # compute the Gini coefficient adjusted for negative values
> Gini_CTR_BS(y,w)
$GINI_CTR_BS
[1] 0.9846815

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>