A set of different inequality and diversity measures.
Usage
concstats_inequ(x, normalized = TRUE, type = c("entropy", "gini",
"simpson", "palma", "grs", "all"), na.rm = TRUE, digits = NULL)Arguments
- x
A non-negative numeric vector.
- normalized
Logical. Argument of the functions
concstats_entropy,concstats_ginispecifying whether or not a normalized value is required. Must be eitherTRUEorFALSE. The default isTRUE.- type
A character string of the measure to be calculated, defaults to
concstats_entropy. Input is not case-sensitive.- na.rm
A logical vector that indicates whether
NAvalues should be excluded or not. Must be eitherTRUEorFALSE. The default isTRUE. If set toFALSEthe computation yields a message if the vector containsNAvalues. NAs will be removed for further computations.- digits
A non-null value for digits specifies the minimum number of significant digits to be printed in values. The default is
NULLand will use base R print option. Significant digits defaults to 7. Values are restricted between 1 and default value.
Details
concstats_inequis a wrapper for the proposed inequality measures. All measures can be accessed individually.concstats_entropy()returns the Shannon entropy.concstats_entropyYou can normalize the entropy measures by settingnormalized = TRUE.concstats_gini()calculates the gini coefficient.concstats_giniYou can normalize the gini measures by settingnormalized = TRUE.concstats_simpson()calculates the gini-simpson index.concstats_palma()calculates the palma ratio of inequality.concstats_grs()calculates an alternative concentration measure.concstats_all_inequ()returns all measures in a one step procedure. For more details or references please see the help page of the respective function.
See also
concstats_concstats(),concstats_mstruct(),concstats_comp()
Other Concentration and inequality measures:
concstats_all_inequ(),
concstats_entropy(),
concstats_gini(),
concstats_grs(),
concstats_palma(),
concstats_simpson()
Examples
# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
# Calculate the Palma ratio
concstats_inequ(x, type = "palma")
#> [1] 2.666667
# Calculate the entropy measure directly
concstats_inequ(x, normalized = TRUE, type = "entropy")
#> [1] 0.879203
# Calculate the group measures
concstats_inequ(x, type = "all", digits = 2)
#> Measure Value
#> 1 Entropy 0.88
#> 2 Gini Index 0.43
#> 3 Simpson Index 0.72
#> 4 Palma Ratio 2.67
#> 5 GRS 0.40
