Learn R Programming

acid (version 1.1)

gini.den: Gini Coefficient for an Income Distribution

Description

This function approximates the Gini coefficient for a distribution specified by a vector of densities and a corresponding income vector. A point mass at zero is allowed.

Usage

gini.den(incs, dens, pm0 = NA, lower = NULL, upper = NULL)

Arguments

incs
a vector with sorted income values.

dens
a vector with the corresponding densities.

pm0
the point mass for zero incomes. If not specified no point mass is assumed.

lower
the lower bound of the income range considered.

upper
the upper bound of the income range considered.

Value

Gini
the approximation of the Gini coefficient.
pm0
the point mass for zero incomes used.
lower
the lower bound of the income range considered used.
upper
the upper bound of the income range considered used.

References

Cowell, F.A. (2000): Measurement of Inequality, in: Atkinson and Bourguignon (eds.), Handbook of Income Distribution, pp. 1-86, Elsevier, Amsterdam.

See Also

weighted.gini

Examples

Run this code
mu<-2
sigma<-1
incs<-c(seq(0,500,by=0.01),seq(501,50000,by=1))
dens<-dLOGNO(incs,mu,sigma)
plot(incs,dens,type="l",xlim=c(0,100))
gini.den(incs=incs,dens=dens)$Gini
gini(rLOGNO(5000000,mu,sigma))$Gini
2*pnorm(sigma/sqrt(2))-1 #theoretical Gini

Run the code above in your browser using DataLab