gini | R Documentation |
Computes the Gini coefficient based on (possibly weighted) sample data
gini(x, weights=rep(1,length=length(x)))
x |
a vector containing at least non-negative elements |
weights |
an optional vector of sample weights for |
Gini
is the Gini coefficient, a common measure of inequality
within a distribution. It is commonly used to measure income inequality.
It is defined as twice the area between the 45 degree line
and a Lorenz curve, where the Lorenz curve is a graph describing the share of
total income T accruing to the poorest fraction p of the population.
In typical use the values of x
are the incomes of individuals from a survey
and the weights
are the corresponding survey weights.
If the values of x
are the mean incomes within income classes and the
weights weights
are the corresponding population proportions within those
classes, the function computes an estimate of the Gini coefficient of the
underlying income distribution.
the Gini coefficient (between 0 and 1).
Mark S. Handcock handcock@stat.ucla.edu
Relative Distribution Methods in the Social Sciences, by Mark S. Handcock and Martina Morris, Springer-Verlag, Inc., New York, 1999. ISBN 0387987789.
Relative Distribution Methods in the Social Sciences, by Mark S. Handcock and Martina Morris, Springer-Verlag, Inc., New York, 1999. ISBN 0387987789.
Divergent Paths: Economic Mobility in the New American Labor Market, Russell Sage Foundation, New York, June 2001 Annette D. Bernhardt, Martina Morris, Mark S. Handcock and Marc Scott.
Measurement of Inequality, by F. A. Cowell, in A. B. Atkinson / F. Bourguignon (Eds): Handbook of Income Distribution, Amsterdam, 2000.
Measuring Inequality, by F. A. Cowell, Prentice Hall/Harvester Wheatshef, 1995.
reldist
, nls
# generate vector (of incomes) x <- c(541, 1463, 2445, 3438, 4437, 5401, 6392, 8304, 11904, 22261) # compute Gini coefficient gini(x) # generate a vector of weights. w <- runif(n=length(x)) gini(x,w) # # Compute the inequality in income growth for the recent cohort of the # National Longitudinal Survey (NLS) initiated in 1979. # library(reldist) data(nls) help(nls) # Compute the wage growth y <- exp(recent$chpermwage) # Compute the unweighted estimate gini(y) # Compute the weighted estimate gini(y,w=recent$wgt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.