Gini(x, n = rep(1, length(x)), unbiased = TRUE,
conf.level = NA, R = 1000, type = "bca", na.rm = FALSE)
NA
, if x contains negative elements.TRUE
the bootstrap confidence intervals are calculated.
If set to NA
(default) no confidence intervals are returned."norm"
,"basic"
, "stud"
,
"perc"
or "bca"
).
This argument is ignored if no confidence inconf.level
is set to NA
then the result will beconf.level
is provided, a named numeric vector with 3 elements:type
argument ("bca"
).
Dixon (1987) describes a refinement of the bias-corrected method known as 'accelerated' -
this produces values very closed to conventional bias corrected intervals.
(Iain Buchan (2002) Calculating the Gini coefficient of inequality, see: Herfindahl
, Rosenbluth
for concentration measures,
Lc
for the Lorenz curve
ineq()
in the package # generate vector (of incomes)
x <- c(541, 1463, 2445, 3438, 4437, 5401, 6392, 8304, 11904, 22261)
# compute Gini coefficient
Gini(x)
# working with weights
fl <- c(2.5, 7.5, 15, 35, 75, 150) # midpoints of classes
n <- c(25, 13, 10, 5, 5, 2) # frequencies
# with confidence intervals
Gini(fl, n, conf.level=0.95, unbiased=FALSE)
# some special cases
x <- c(10, 10, 0, 0, 0)
plot(Lc(x))
Gini(x, unbiased=FALSE)
# the same with weights
Gini(x=c(10, 0), n=c(2,3), unbiased=FALSE)
# perfect balance
Gini(c(10, 10, 10))
Run the code above in your browser using DataLab