Learn R Programming

dineq (version 0.1.0)

gini.wtd: Gini coefficient

Description

Returns the (optional weighted) Gini coefficient for a vector.

Usage

gini.wtd(x, weights = NULL)

Arguments

x

a numeric vector containing at least non-negative elements.

weights

an optional vector of weights of x to be used in the computation of the Gini coefficient. Should be NULL or a numeric vector.

Value

The value of the Gini coefficient.

Details

The Gini coefficient is a measure of inequality among values of a distribution. The most used single measure for income inequality. The coefficient can theoretically range between 0 and 1, with 1 being the highest possible inequality (for instance: 1 person in a society has all income; the others none). But coefficients that are negative or greater than 1 are also possible because of negative values in the distribution. Compared to other measures of inequality, the Gini coefficient is especially sensitive for changes in the middle of the distribution.

Extension of the gini function in reldist package in order to handle missings.

References

Haughton, J. and S. Khandker. (2009) Handbook on poverty and inequality, Washington, DC: World Bank.

Cowell F. (2000) Measurement of Inequality. In Atkinson A. and Bourguignon F. (eds.) Handbook of Income Distribution. Amsterdam: Elsevier, p. 87-166.

Examples

Run this code
# NOT RUN {
#calculate Gini coefficient using Mexican Income data set
data(mex_inc_2008)

#unweighted Gini coefficient:
gini.wtd(mex_inc_2008$income)

#weighted Gini coefficient:
gini.wtd(x=mex_inc_2008$income, weights=mex_inc_2008$factor)

# }

Run the code above in your browser using DataLab