Gini: Gini Coefficient G

Description

Computes the unweighted and weighted Gini index of a distribution.

Usage

1
2
3
4
Gini(x, weights, ...)

## Default S3 method:
Gini(x, weights = rep(1, length = length(x)), ...)

Arguments

x

a data.frame, a matrix-like, or a vector.

weights

a vector containing weights for x.

...

additional arguements (currently ignored)

Details

One might say the Gini is oversensitive to changes in the middle, while undersensitive at the extremes. The G coefficient doesn't capture very explicitly changes in the top 10 inequality research in the past 10 years – or the bottom 40 most poverty lies. The alternative Palma ratio does.

Author(s)

Daniel Marcelino, dmarcelino@live.com.

See Also

GiniSimpson, Lorenz, Herfindahl, Rosenbluth, Atkinson..

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# generate a vector (of incomes)
x <- c(778, 815, 857, 888, 925, 930, 965, 990, 1012)
# compute Gini coefficient
Gini(x)

# For Gini index: Gini(x)*100

Gini(c(100,0,0,0), c(1,33,33,33))

# Considers this
A <- c(20000, 30000, 40000, 50000, 60000)
B <-  c(9000, 40000, 48000, 48000, 55000)

 Gini(A); Gini(B);

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.