gini: Gini dispersion index

Description Usage Arguments Details Value Author(s) References Examples

View source: R/gini.R

Description

Gini index for each column of a matrix.

Usage

1
gini(x)

Arguments

x

a non-negative numeric matrix, or an object that can be coerced to such a matrix by as.matrix.

Details

The Gini coefficient or index is a measure of inequality or diversity. It is zero if all the values of x are equal. It reaches a maximum value of 1/nrow(x) when all values are zero except for one.

The Gini index is only interpretable for non-negative quantities. It is not meaningful if x contains negative values.

Value

Numeric vector of length ncol(x).

Author(s)

Gordon Smyth

References

https://en.wikipedia.org/wiki/Gini_coefficient.

Examples

1
2
x <- matrix(rpois(20,lambda=5),10,2)
gini(x)

Example output

Loading required package: limma
[1] 0.1755556 0.2396226

edgeR documentation built on Jan. 16, 2021, 2:03 a.m.