Learn R Programming

StatMeasures (version 1.0)

gini: Gini coefficient of a distribution

Description

Takes in a distribution and returns gini coefficient

Usage

gini(y)

Arguments

y
an integer or numeric distribution

Value

gini coefficient of the distribution

Details

To compute the gini coefficient of a distribution, gini is the right function. It uses trapezoidal approximation to calculate the area of the curve.

Lorenz curve is also plotted as output.

See Also

auc

Examples

Run this code
# Distribution
dist <- c(1, 4, 7, 15, 10)

# Gini coefficient
GINI <- gini(y = dist)

Run the code above in your browser using DataLab