gini                 package:reldist                 R Documentation

_C_o_m_p_u_t_e _t_h_e _G_i_n_i _C_o_e_f_f_i_c_i_e_n_t

_D_e_s_c_r_i_p_t_i_o_n:

     computes the Gini coefficient based on (possibly weighted) sample
     data

_U_s_a_g_e:

      gini(x,  weights=rep(1,length=length(x)))

_A_r_g_u_m_e_n_t_s:

       x: a vector containing at least non-negative elements

 weights: an optional vector of sample weights for 'x'

_D_e_t_a_i_l_s:

     '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.

_V_a_l_u_e:

     the Gini coefficient (between 0 and 1).

_A_u_t_h_o_r(_s):

     Mark S. Handcock handcock@stat.washington.edu

_S_o_u_r_c_e:

     _Relative Distribution Methods in the Social Sciences_, by Mark S.
     Handcock and Martina Morris, Springer-Verlag, Inc., New York,
     1999. ISBN 0387987789.

_R_e_f_e_r_e_n_c_e_s:

     _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.

_S_e_e _A_l_s_o:

     'reldist', 'nls'

_E_x_a_m_p_l_e_s:

     # 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)

