gini: Estimate the Gini Coefficient

Description Usage Arguments Details Value Examples

View source: R/gini.R

Description

Gini coefficient estimated using the covariance approach, i.e.

G_y = \frac{2 cov (y,F(y))}{μ_y}

. See Lerman and Yitzaki (1985), Podder (1993) and A. Fernandez-Morales et al. (2016)

Usage

1
gini(x, suppressWarning = FALSE)

Arguments

x

numeric vector

suppressWarning

logical. Set TRUE to hide length(x) != 12 warning

Details

Currently returns 0 if x is only zeroes.

Value

value between 0 and (n-1)/n

Examples

1
2
x <- c(1:12)
gini(x)

mariuslarsson/touRism documentation built on Oct. 3, 2021, 8:30 p.m.