View source: R/inequalityMeasure.R
Gini | R Documentation |
Computes Gini coefficient of a given variable taking into account weights.
Gini(X, W = rep(1, length(X)))
X |
is a data vector |
W |
is a vector of weights |
Gini coefficient is given by:
G = \frac{ \sum_{i=1}^n \sum_{j=1}^n \mid x_{i} - x_{j} \mid}{2n^{2} \overline{x}}
The value of Gini coefficient.
Dixon P. M., Weiner, J., Mitchell-Olds, T., and Woodley, R.: (1987) Bootstrapping the Gini Coefficient of Inequality. Ecology , Volume 68 (5)
Firebaugh G.: (1999) Empirics of World Income Inequality, American Journal of Sociology
Deininger K.; Squire L.: (1996) A New Data Set Measuring Income Inequality, The World Bank Economic Review, Vol. 10, No. 3
# Compare weighted and unweighted result
X=1:10
W=1:10
Gini(X)
Gini(X,W)
data(Tourism)
#Gini coefficient for Total expenditure with sample weights
X=Tourism$`Total expenditure`
W=Tourism$`Sample weight`
Gini(X,W)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.