Description Usage Arguments Details Value Author(s) References Examples
This function computes Gini's coefficient for quantifying diversity as disparity.
1 | gini.coefficient(X, min, max)
|
X |
A numeric vector with group data. |
min |
The minimum value for the random variable. |
max |
The maximum value for the random variable. |
gini.coefficient
computes Gini's Coefficient for a group according the following formula:
G = {Δ \over {2\bar x}} = {{∑\limits_{i = 1}^n {∑\limits_{j = i + 1}^n {≤ft| {x_i - x_j } \right|} } } \over {n^2 \bar x}} . | |
It also provides maximum values for Gini's Coefficient.
The function returns a list of class gini
with following
components:
call |
Function call. |
data |
Original data vector. |
min |
Minimum value for the random variable. |
max |
Maximum value for the random variable. |
gini |
Gini's Coefficient. |
gini.max |
Maximum value of Gini's Coefficient. |
Antonio Solanas, Rejina M. Selvam, Jose Navarro and David Leiva.
Solanas, A., Selvam, R. M., Navarro, J., & Leiva, D. (2010). On the measurement of diversity in organizations. Unpublished manuscript.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ex.1 <- c(30,rep(60,3))
gini.coefficient(ex.1,30,60)
ex.2 <- c(60,rep(30,3))
gini.coefficient(ex.2,30,60)
ex.3 <- c(rep(30,2),rep(60,2))
gini.coefficient(ex.3,30,60)
# Gini coefficient does not behave as disparity index when minimum value is greater than 0. #
# Then, a translation of scale is suitable for solving this problem. #
ex.4 <- ex.1 - 30
gini.coefficient(ex.4,0,30)
ex.5 <- ex.2 - 30
gini.coefficient(ex.5,0,30)
ex.6 <- ex.3 - 30
gini.coefficient(ex.6,0,30)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.