gini: Gini coefficient of a distribution

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/gini.R

Description

Takes in a distribution and returns gini coefficient

Usage

1
gini(y)

Arguments

y

an integer or numeric 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.

Value

gini coefficient of the distribution

Author(s)

Akash Jain

See Also

auc

Examples

1
2
3
4
5
# Distribution
dist <- c(1, 4, 7, 15, 10)

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

Example output



StatMeasures documentation built on May 2, 2019, 1:44 p.m.