# GiniSimpson: Compute Gini-Simpson Coefficient In DescTools: Tools for Descriptive Statistics

## Description

Calculate the Gini-Simpson coefficient.

## Usage

 `1` ```GiniSimpson(x, na.rm = FALSE) ```

## Arguments

 `x` a vector containing at least non-negative elements. `na.rm` logical. Should missing values be removed? Defaults to FALSE.

## Details

The original Simpson index lambda equals the probability that two entities taken at random from the dataset of interest (with replacement) represent the same type. The Simpson index was introduced in 1949 by Edward H. Simpson to measure the degree of concentration when individuals are classified into types. The same index was rediscovered by Orris C. Herfindahl in 1950. The square root of the index had already been introduced in 1945 by the economist Albert O. Hirschman. As a result, the same measure is usually known as the Simpson index in ecology, and as the Herfindahl index or the Herfindahl-Hirschman index (HHI) in economics.
Its transformation 1 - lambda therefore equals the probability that the two entities represent different types. This measure is also known in ecology as the probability of interspecific encounter (PIE) and the Gini-Simpson index.

a numeric value.

## Author(s)

Andri Signorell <[email protected]>

## References

Cover Thomas M. and Thomas Joy A. (1991) Elements of Information Theory. Wiley.

`DivCoef`, `Entropy`, `Gini`, `Herfindahl`

## Examples

 ```1 2 3 4 5 6 7 8``` ```x <- c(261,29,33,15,39,28,95,5,6,28,69,8,105,38,15) GiniSimpson(x) # is the same as 1 - Herfindahl(x) GiniSimpson(c(783,121,112,70,201,153,425,19,37,126,325,51,442,193,41)) ```

### Example output

```[1] 0.8331263
[1] 0.8331263
[1] 0.8698708
```

DescTools documentation built on Nov. 13, 2018, 5:04 p.m.