Learn R Programming

L1centrality (version 0.4.0)

Heterogeneity: Lorenz Curve and the Gini Coefficient

Description

Draws a Lorenz curve (the group heterogeneity plot) and computes the Gini coefficient (the group heterogeneity index).

Usage

Lorenz_plot(x, add = FALSE, ...)

Gini(x)

Value

Lorenz_plot() draws a Lorenz curve (the group heterogeneity plot) and returns an invisible copy of a Gini coefficient (the group heterogeneity index).

Gini() returns a Gini coefficient.

Arguments

x

A numeric vector.

add

A logical value.

  • TRUE: add the Lorenz curve to an already existing plot.

  • FALSE (the default): draw the Lorenz curve to a new graphic device.

...

Further graphical parameters supplied to the internal base::plot() (when add = FALSE) or graphics::lines() (when add = TRUE) function. See graphics::par() document.

References

S. Kang and H.-S. Oh. On a notion of graph centrality based on L1 data depth. Journal of the American Statistical Association, 1--13, 2025.

M. O. Lorenz. Methods of measuring the concentration of wealth. Publications of the American Statistical Association, 9(70):209--219, 1905.

See Also

plot() methods for objects of class L1cent and L1centLOC support plotting a Lorenz curve. summary() methods for objects of class L1cent, L1centLOC, and L1centNB provide the Gini coefficient as one of the summary statistics.

Examples

Run this code
vertex_weight <- igraph::V(MCUmovie)$worldwidegross
cent <- L1cent(MCUmovie, eta = vertex_weight)
gini <- Lorenz_plot(cent, asp = 1) # one can use "plot(cent, asp = 1)"
graphics::abline(0, 1, lty = 2)
# group heterogeneity index
gini
gini == Gini(cent)

Run the code above in your browser using DataLab