weighted.gini {acid} | R Documentation |
This function computes the Gini coefficient for a vector of observations with corresponding weights.
weighted.gini(x, w = NULL)
x |
a vector of observations. |
w |
a vector of weights. |
returns the Gini coefficient.
Alexander Sohn
Cowell, F.A. (2000): Measurement of Inequality, in: Atkinson and Bourguignon (eds.), Handbook of Income Distribution, pp. 1-86, Elsevier, Amsterdam.
# generate vector (of incomes)
x <- c(541, 1463, 2445, 3438, 4437, 5401, 6392, 8304, 11904, 22261)
w <- sample(1:2,length(x),replace=TRUE)
weighted.gini(x,w)