Gini-Simpson Index
Arguments
- x
A non-negative numeric vector.
- na.rm
A logical vector that indicates whether
NA
values should be excluded or not. Must be eitherTRUE
orFALSE
. The default isTRUE
. If set toFALSE
the computation yields a message if the vector containsNA
values. NAs will be removed for further computations.- digits
An optional value for digits. Specifies the minimum number of significant digits to be printed in values. The default is
NULL
and will use base R print option.
Details
concstats_simpson
is the Gini-Simpson index, also known as
the Gini impurity (Gini's diversity index) in Machine Learning, Gibbs-Martin
index or Blau index in sociology and management studies. This index ranges
from {0, 1}.
References
Simpson, E. H. (1949). "Measurement of Diversity", Nature, 163, 688.
Jost, L. (2006). "Entropy and Diversity". Oikos, 113(2), 363-375.
See also
Other Concentration and inequality measures:
concstats_all_inequ()
,
concstats_entropy()
,
concstats_gini()
,
concstats_grs()
,
concstats_inequ()
,
concstats_palma()
Examples
# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
concstats_simpson(x)
#> [1] 0.725
concstats_simpson(x, digits = 2)
#> [1] 0.72
# a vector with NA values
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, NA)
concstats_simpson(x, na.rm = TRUE)
#> `x` has NA values. NAs have been removed for computation.
#> [1] 0.725