Package 'concstats'

Title: Market Structure, Concentration and Inequality Measures
Description: Based on individual market shares of all participants in a market or space, the package offers a set of different structural and concentration measures frequently - and not so frequently - used in research and in practice. Measures can be calculated in groups or individually. The calculated measure or the resulting vector in table format should help practitioners make more informed decisions. Methods used in this package are from: 1. Chang, E. J., Guerra, S. M., de Souza Penaloza, R. A. & Tabak, B. M. (2005) "Banking concentration: the Brazilian case". 2. Cobham, A. and A. Summer (2013). "Is It All About the Tails? The Palma Measure of Income Inequality". 3. Garcia Alba Idunate, P. (1994). "Un Indice de dominancia para el analisis de la estructura de los mercados". 4. Ginevicius, R. and S. Cirba (2009). "Additive measurement of market concentration" <doi:10.3846/1611-1699.2009.10.191-198>. 5. Herfindahl, O. C. (1950), "Concentration in the steel industry" (PhD thesis). 6. Hirschmann, A. O. (1945), "National power and structure of foreign trade". 7. Melnik, A., O. Shy, and R. Stenbacka (2008), "Assessing market dominance" <doi:10.1016/j.jebo.2008.03.010>. 8. Palma, J. G. (2006). "Globalizing Inequality: 'Centrifugal' and 'Centripetal' Forces at Work". 9. Shannon, C. E. (1948). "A Mathematical Theory of Communication". 10. Simpson, E. H. (1949). "Measurement of Diversity" <doi:10.1038/163688a0>.
Authors: Andreas Schneider [aut, cre] , Sebastian Wojcik [rev], Christopher T. Kenny [rev]
Maintainer: Andreas Schneider <[email protected]>
License: GPL (>= 3)
Version: 0.2.0
Built: 2024-11-30 08:36:49 UTC
Source: https://github.com/ropensci/concstats

Help Index


A wrapper for the proposed concentration measures

Description

A wrapper for the proposed concentration measures

Usage

concstats_all_comp(x, normalized = FALSE, na.rm = TRUE, digits = NULL)

Arguments

x

A non-negative numeric vector.

normalized

Logical. Argument specifying whether or not a normalized value is required. Must be either TRUE or FALSE. Defaults to FALSE.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

digits

A non-null 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. Significant digits defaults to 7.

Details

concstats_all_comp returns all proposed group measures in a one step procedure with default settings if not otherwise specified.

Value

A data.frame.

See Also

concstats_all_mstruct(), concstats_all_inequ()

Other Competition/Concentration measures: concstats_comp(), concstats_dom(), concstats_hhi(), concstats_hhi_d(), concstats_hhi_min(), concstats_sten()

Examples

# a vector of market shares
x <- c(0.35, 0.4, 0.05, 0.1, 0.06, 0.04)
concstats_all_comp(x, digits = 2)

A wrapper for the proposed inequality measures

Description

A wrapper for the proposed inequality measures

Usage

concstats_all_inequ(x, normalized = FALSE, na.rm = TRUE, digits = NULL)

Arguments

x

A non-negative numeric vector.

normalized

Logical. Argument specifying whether or not a normalized value is required. Must be either TRUE or FALSE. The default is FALSE.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is FALSE. If set to FALSE the computation yields NA if NA values are present.

digits

A non-null 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. Significant digits defaults to 7.

Details

concstats_all_inequ returns all proposed group measures in a one step procedure with default settings if not otherwise specified.

Value

A data.frame.

See Also

concstats_all_mstruct(), concstats_all_comp()

Other Concentration and inequality measures: concstats_entropy(), concstats_gini(), concstats_grs(), concstats_inequ(), concstats_palma(), concstats_simpson()

Examples

# a vector of market shares
x <- c(0.35, 0.4, 0.05, 0.1, 0.06, 0.04)
concstats_all_inequ(x, digits = 2)

A wrapper for the proposed structural measures

Description

A wrapper for the proposed structural measures

Usage

concstats_all_mstruct(x, na.rm = TRUE, digits = NULL)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if the vector contains NA values.

digits

A non-null 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. Significant digits defaults to 7.

Details

concstats_all_mstruct returns all proposed group measures in a one step procedure with default settings if not otherwise specified.

Value

A data.frame.

See Also

concstats_all_comp(), concstats_all_inequ()

Other Market structure measures: concstats_firm(), concstats_mstruct(), concstats_nrs_eq(), concstats_top(), concstats_top3(), concstats_top3_df(), concstats_top5(), concstats_top5_df(), concstats_top_df()

Examples

# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
concstats_all_mstruct(x, digits = 2)

Group of Concentration Measures

Description

A set of different concentration and competition measures.

Usage

concstats_comp(x, normalized = FALSE, type = c("hhi", "hhi_d", "hhi_min",
 "dom", "sten", "all"), na.rm = TRUE, digits = NULL)

Arguments

x

A non-negative numeric vector.

normalized

Logical. Argument specifying whether or not a normalized value is required. Ranges from (0, 1) and often used for comparison over time. Must be either TRUE or FALSE. The default is FALSE.

type

A character string of the measure to be calculated, can be abbreviated with the first letter. Defaults to "hhi". Input is not case-sensitive.

na.rm

A logical vector that indicates whether NA values should be excluded or not. If set to FALSE the computation yields NA if vector contains NA values. Must be either TRUE or FALSE. Defaults to TRUE.

digits

A non-null 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. Significant digits defaults to 7.

Details

  • concstats_comp is a wrapper for the proposed concentration measures. All measures can be accessed individually.

  • concstats_hhi() returns the Herfindahl-Hirschman index (HHI). concstats_hhi, can be calculated individually as a normalized measure changing the default setting to TRUE.

  • concstats_hhi_d() returns the dual of the HHI.

  • concstats_hhi_min() calculates the minimum of the HHI index.

  • concstats_dom() calculates the dominance index.

  • concstats_sten() calculates the stenbacka index.

  • concstats_all_comp() is a wrapper that computes all measures in a one step procedure. For more details or references please see the help page of the respective function.

Value

A single numeric measure in decimal form or ⁠data frame⁠.

Note

The vector of market shares should be in a decimal form corresponding to total shares of individual firms/units. The vector should sum up to 1. Alternatively, the user might use concstats_shares() to converting raw variables, e.g. loans or sales into shares.

See Also

concstats_concstats(), concstats_mstruct(), concstats_inequ()

Other Competition/Concentration measures: concstats_all_comp(), concstats_dom(), concstats_hhi(), concstats_hhi_d(), concstats_hhi_min(), concstats_sten()

Examples

# a vector of market shares
x <- c(0.35, 0.4, 0.05, 0.1, 0.06, 0.04)
# the Herfindahl-Hirschman index of the vector
concstats_comp(x, type = "hhi")
# individual measure
concstats_sten(x)
# complete group measures
concstats_comp(x, type = "all", digits = 2)

A set of Market Structure, Concentration, and Inequality Measures

Description

A convenience function which calculates a selected set of different market structure, inequality and concentration measures more or less commonly used, e.g. k-firm ratios, Entropy, HHI, Palma ratio, and others in a one step procedure to provide a first overview.

Usage

concstats_concstats(x, na.rm = TRUE, digits = NULL)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. Defaults to TRUE. If set to FALSE the computation yields NA if vector contains NA values.

digits

A non-null 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. Significant digits defaults to 7.

Details

concstats_concstats computes a set of different and selected structural, inequality, and concentration measures in a one step procedure. The resulting ⁠data frame⁠ contains eight measures: number of firms with market share, numbers equivalent, the cumulative share of the top (top 3 and top 5) firm(s) in percentage, the hhi index, the entropy index, and the palma ratio. However, all measures can be computed individually or in groups.

Value

A ⁠data frame⁠ of numeric measures with default settings.

Note

The vector of market shares should be in a decimal form corresponding to the total share of individual firms/units. The vector should sum up to 1, otherwise a numeric vector will be converted into decimal form.

See Also

concstats_mstruct(), concstats_comp(), concstats_inequ()

Examples

# a vector of market shares
x <- c(0.35, 0.4, 0.05, 0.1, 0.06, 0.04)
# a selected set of different structural, concentration, and inequality
# measures
concstats_concstats(x, digits = 2)

Dominance Index

Description

An alternative measure which can be used in case of mergers.

Usage

concstats_dom(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if the vector contains NA values.

Details

concstats_dom calculates a dominance index, which measures the concentration within the Herfindahl-Hirschman index, that is, the concentration within the concentration.

Value

A single numeric measure in decimal form.

References

Garcia Alba Idunate, P. (1994). "Un Indice de dominancia para el analisis de la estructura de los mercados". El Trimestre Economico, 61: 499-524.

See Also

Other Competition/Concentration measures: concstats_all_comp(), concstats_comp(), concstats_hhi(), concstats_hhi_d(), concstats_hhi_min(), concstats_sten()

Examples

# a vector of market shares
x <- c(0.35, 0.4, 0.05, 0.1, 0.06, 0.04)
concstats_dom(x)
# a vector with NA values
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, NA)
concstats_dom(x, na.rm = FALSE)

Shannon Entropy

Description

Shannon Entropy

Usage

concstats_entropy(x, normalized = TRUE, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

normalized

Logical. Argument specifying whether or not a normalized value is required. Must be either TRUE or FALSE. The default is TRUE.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if vector contains NA values.

Value

A single numeric measure.

References

Shannon, C. E. (1948). "A Mathematical Theory of Communication", The Bell System Technical Journal (Nokia Bell Labs).

See Also

Other Concentration and inequality measures: concstats_all_inequ(), concstats_gini(), concstats_grs(), concstats_inequ(), concstats_palma(), concstats_simpson()

Examples

# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
concstats_entropy(x, normalized = TRUE)
# a vector with NA values
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, NA)
concstats_entropy(x, na.rm = FALSE)

Number of firms

Description

Number of firms

Usage

concstats_firm(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

Logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if the vector contains NA values.

Value

A positive integer.

See Also

Other Market structure measures: concstats_all_mstruct(), concstats_mstruct(), concstats_nrs_eq(), concstats_top(), concstats_top3(), concstats_top3_df(), concstats_top5(), concstats_top5_df(), concstats_top_df()

Examples

# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
concstats_firm(x)

Gini coefficient

Description

Gini coefficient

Usage

concstats_gini(x, normalized = TRUE, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

normalized

Logical. Argument specifying whether or not a normalized value is required. Must be either TRUE or FALSE. The default is FALSE.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if vector contains NA values.

Value

A single numeric value.

See Also

Other Concentration and inequality measures: concstats_all_inequ(), concstats_entropy(), concstats_grs(), concstats_inequ(), concstats_palma(), concstats_simpson()

Examples

# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
concstats_gini(x, normalized = TRUE)
# a vector with NA values
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, NA)
concstats_gini(x, na.rm = FALSE)

GRS measure

Description

GRS measure

Usage

concstats_grs(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

a logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if vector contains NA values.

Value

A single numeric measure in decimal form.

References

Ginevicius, R. and S. Cirba (2009). "Additive measurement of market concentration", Journal of Business Economics and Management, 10(3), 191-198.

See Also

Other Concentration and inequality measures: concstats_all_inequ(), concstats_entropy(), concstats_gini(), concstats_inequ(), concstats_palma(), concstats_simpson()

Examples

# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
concstats_grs(x)
# a vector with NA values
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, NA)
concstats_grs(x, na.rm = FALSE)

Herfindahl-Hirschman Index

Description

A measure of industry concentration and widely used in merger control.

Usage

concstats_hhi(x, normalized = FALSE, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

normalized

Logical. Argument specifying whether or not a normalized value is required. Ranges from 0, 1 and often used for comparison over time. Must be either TRUE or FALSE. The default is FALSE.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

Details

concstats_hhi calculates the widely used Herfindahl-Hirschman Index (Herfindahl, 1950 and Hirschman, 1945). The index is calculated by squaring the market share of each firm competing in the market and then summing the resulting numbers.

Value

A single numeric measure in decimal form.

References

Herfindahl, O. C. (1950), "Concentration in the steel industry" (PhD thesis), Columbia University.

Hirschman, A. O. (1945), "National power and structure of foreign trade". Berkeley, CA: University of California Press.

See Also

Other Competition/Concentration measures: concstats_all_comp(), concstats_comp(), concstats_dom(), concstats_hhi_d(), concstats_hhi_min(), concstats_sten()

Examples

# a vector of market shares
x <- c(0.35, 0.4, 0.05, 0.1, 0.06, 0.04)
concstats_hhi(x)
# a vector with NA values
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, NA)
concstats_hhi(x, na.rm = FALSE)

Dual of the Herfindahl-Hirschman Index

Description

The dual of the HHI reflects the fraction of participants that do have market participation.

Usage

concstats_hhi_d(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if the vector contains NA values.

Details

concstats_hhi_d is the dual of the HHI index, which indicates the percentage which represents the fraction of the banks that do not have market participation.

Value

A single numeric measure in decimal form.

References

Chang, E. J., Guerra, S. M., de Souza Penaloza, R. A. & Tabak, B. M. (2005) Banking concentration: the Brazilian case. In Financial Stability Report. Brasilia: Banco Central do Brasil, 4: 109-129.

See Also

Other Competition/Concentration measures: concstats_all_comp(), concstats_comp(), concstats_dom(), concstats_hhi(), concstats_hhi_min(), concstats_sten()

Examples

# a vector of market shares
x <- c(0.35, 0.4, 0.05, 0.1, 0.06, 0.04)
concstats_hhi_d(x)
# a vector with NA values
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, NA)
concstats_hhi_d(x, na.rm = FALSE)

Minimum of Herfindahl-Hirschman Index

Description

Minimum of Herfindahl-Hirschman Index

Usage

concstats_hhi_min(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if the vector contains NA values.

Details

Calculates the minimum of the Herfindahl-Hirschman index, that is, the equivalent of all participants in the market with equal market shares.

Value

A single numeric measure in decimal form.

See Also

Other Competition/Concentration measures: concstats_all_comp(), concstats_comp(), concstats_dom(), concstats_hhi(), concstats_hhi_d(), concstats_sten()

Examples

# a vector of market shares
x <- c(0.35, 0.4, 0.05, 0.1, 0.06, 0.04)
concstats_hhi_min(x)
# a vector with NA values
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, NA)
concstats_hhi_min(x, na.rm = FALSE)

Inequality and Diversity Measures

Description

A set of different inequality and diversity measures.

Usage

concstats_inequ(x, normalized = FALSE, 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_gini specifying whether or not a normalized value is required. Ranges from (0, 1) and often used for comparison over time. Must be either TRUE or FALSE. The default is FALSE.

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 NA values should be excluded or not. If set to FALSE the computation yields NA if vector contains NA values. Must be either TRUE or FALSE. The default is TRUE.

digits

A non-null 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. Significant digits defaults to 7.

Details

  • concstats_inequ is a wrapper for the proposed inequality measures. All measures can be accessed individually.

  • concstats_entropy() returns the Shannon entropy. concstats_entropy You can normalize the entropy measures by setting normalized = TRUE.

  • concstats_gini() calculates the gini coefficient. concstats_gini You can normalize the gini measures by setting normalized = 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.

Value

The calculated numeric measure or a ⁠data frame⁠

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")
# Calculate the entropy measure directly
concstats_entropy(x, normalized = TRUE)
# Calculate the group measures
concstats_inequ(x, type = "all", digits = 2)

Market Structure Measures

Description

Set of different market structure measures to reflect a given market structure.

Usage

concstats_mstruct(x, type = c("firm", "nrs_eq", "top", "top3", "top5",
 "all"), na.rm = TRUE, digits = NULL)

Arguments

x

A non-negative numeric vector.

type

A character string of the measure to be calculated, can be abbreviated with the first letter. Defaults to "firm". Input is not case-sensitive.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if vector contains NA values.

digits

A non-null 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. Significant digits defaults to 7.

Details

  • concstats_mstruct is a wrapper for the proposed structural measures.

  • concstats_firm(), returns the number of firms with a given market share.

  • concstats_nrs_eq() computes the reciprocal of the HHI, which indicates the equivalent number of firms of the same size.

  • concstats_top(), concstats_top3(), and concstats_top5() calculate the cumulative share of the top (top 3 and top 5) firm(s) and returns the value in percentage.

  • concstats_all_mstruct() computes all measures in a one step procedure. All measures can be computed individually.

  • concstats_top_df(), concstats_top3_df(), and concstats_top5_df() are slight variations. Firm id or ranking might be of interest. In this case an additional id or firm variable is needed. The functions will return a data frame. These functions are just individually accessible.

Value

A single calculated numeric measure or ⁠data frame⁠.

Note

The vector of market shares should be in a decimal form corresponding to total shares of individual firms/units.The sum of the vector should sum up to 1. Alternatively, the user might use concstats_shares() to converting raw variables, e.g. loans or sales into shares.

See Also

concstats_concstats(),concstats_comp(),concstats_inequ()

Other Market structure measures: concstats_all_mstruct(), concstats_firm(), concstats_nrs_eq(), concstats_top(), concstats_top3(), concstats_top3_df(), concstats_top5(), concstats_top5_df(), concstats_top_df()

Examples

# a vector of market shares
x <- c(0.35, 0.4, 0.05, 0.1, 0.06, 0.04)

# the number of firms with market share
concstats_mstruct(x, type = "firm")
# Calculate top market share individually
concstats_top(x)
# Calculate the market structure group measures
concstats_mstruct(x, type = "all", digits = 2)

Numbers equivalent

Description

Numbers equivalent

Usage

concstats_nrs_eq(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

Value

A positive numeric value.

See Also

Other Market structure measures: concstats_all_mstruct(), concstats_firm(), concstats_mstruct(), concstats_top(), concstats_top3(), concstats_top3_df(), concstats_top5(), concstats_top5_df(), concstats_top_df()

Examples

# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
concstats_nrs_eq(x)

Palma ratio

Description

Palma ratio

Usage

concstats_palma(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

Details

concstats_palma measures the ratio of inequality (normally used with income inequality) of the top 10 percent to the bottom 40 percent.

Value

A single numeric measure.

References

Palma, J. G. (2006). "Globalizing Inequality: 'Centrifugal' and 'Centripetal' Forces at Work", DESA Working Paper No. 35.

See Also

Other Concentration and inequality measures: concstats_all_inequ(), concstats_entropy(), concstats_gini(), concstats_grs(), concstats_inequ(), concstats_simpson()

Examples

# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
concstats_palma(x)
# a vector with NA values
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, NA)
concstats_palma(x, na.rm = FALSE)

shares

Description

The concstats_shares function is a helper function making it easier to convert numeric variable into individual shares. This might be convenient for larger vectors.

Usage

concstats_shares(x, na.rm = TRUE, digits = NULL)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

digits

Numeric. A non-null value for digits specifies the minimum number of significant digits to be rounded in values. The default is NULL and will use base R print option.

Details

concstats_shares is a helper function. The user can manually convert or provide numerical vectors of shares or use constats_shares.

Value

A numeric vector in decimal form.

Examples

# a vector of loans (without special characters, e.g. currency symbols)
x <- c(538572286.08, 481096.77, 161914143.03, 128796268.59, 69055940.72)
concstats_shares(x, digits = 5)
# a vector with NA values
x2 <- c(538572286.08, 481096.77, 161914143.03, 128796268.59, 69055940.72, NA)
concstats_shares(x2, na.rm = FALSE, digits = 5)

Gini-Simpson Index

Description

Gini-Simpson Index

Usage

concstats_simpson(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

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).

Value

A single numeric value in decimal form.

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)
# a vector with NA values
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, NA)
concstats_simpson(x, na.rm = FALSE)

Stenbacka Index

Description

The measure suggests an approach that classifies when an individual firm has a dominant position and therefore assesses market dominance.

Usage

concstats_sten(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

Details

concstats_sten calculates the Stenbacka index, which indicates the market share of a dominant position.

Value

A single numeric measure in decimal form.

References

Melnik, A., Shy, Oz, Stenbacka, R., (2008), "Assessing market dominance", Journal of Economic Behavior and Organization, 68: pp. 63-72.

See Also

Other Competition/Concentration measures: concstats_all_comp(), concstats_comp(), concstats_dom(), concstats_hhi(), concstats_hhi_d(), concstats_hhi_min()

Examples

# a vector of market shares
x <- c(0.35, 0.4, 0.05, 0.1, 0.06, 0.04)
concstats_sten(x)
# a vector with NA values
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, NA)
concstats_sten(x, na.rm = FALSE)

Top market share

Description

Top market share

Usage

concstats_top(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

Value

A positive numeric value, which indicates the top market share in percent.

See Also

Other Market structure measures: concstats_all_mstruct(), concstats_firm(), concstats_mstruct(), concstats_nrs_eq(), concstats_top3(), concstats_top3_df(), concstats_top5(), concstats_top5_df(), concstats_top_df()

Examples

# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
concstats_top(x)

Top market share data frame

Description

Top market share data frame

Usage

concstats_top_df(x, y, na.rm = TRUE)

Arguments

x

A data frame.

y

A non-negative vector of shares.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

Value

A data frame, which indicates an id or firm column and the top market share in decimal form.

See Also

Other Market structure measures: concstats_all_mstruct(), concstats_firm(), concstats_mstruct(), concstats_nrs_eq(), concstats_top(), concstats_top3(), concstats_top3_df(), concstats_top5(), concstats_top5_df()

Examples

# some data
id <- c(1, 2, 3, 4, 5)
x <- c(0.2, 0.25, 0.4, 0.1, 0.05)
test_df <- data.frame(id, x)

concstats_top_df(test_df, "x")

Top 3 market share

Description

Top 3 market share

Usage

concstats_top3(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

Value

A positive numeric value, which indicates the cumulative sum of the top 3 market shares as a percentage.

See Also

Other Market structure measures: concstats_all_mstruct(), concstats_firm(), concstats_mstruct(), concstats_nrs_eq(), concstats_top(), concstats_top3_df(), concstats_top5(), concstats_top5_df(), concstats_top_df()

Examples

# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
concstats_top3(x)

Top 3 market shares data frame

Description

Top 3 market shares data frame

Usage

concstats_top3_df(x, y, na.rm = TRUE)

Arguments

x

A data frame.

y

A non-negative vector of shares.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

Value

A data frame, which indicates an id or firm column and the top 3 market shares in decimal form.

See Also

Other Market structure measures: concstats_all_mstruct(), concstats_firm(), concstats_mstruct(), concstats_nrs_eq(), concstats_top(), concstats_top3(), concstats_top5(), concstats_top5_df(), concstats_top_df()

Examples

# some data
id <- c(1, 2, 3, 4, 5)
x <- c(0.2, 0.25, 0.4, 0.1, 0.05)
test_df <- data.frame(id, x)

concstats_top3_df(test_df, "x")

Top 5 market share

Description

Top 5 market share

Usage

concstats_top5(x, na.rm = TRUE)

Arguments

x

A non-negative numeric vector.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

Value

A positive numeric value, which indicates the cumulative sum of the top 5 market shares as a percentage.

See Also

Other Market structure measures: concstats_all_mstruct(), concstats_firm(), concstats_mstruct(), concstats_nrs_eq(), concstats_top(), concstats_top3(), concstats_top3_df(), concstats_top5_df(), concstats_top_df()

Examples

# a vector of market shares
x <- c(0.4, 0.2, 0.25, 0.1, 0.05)
concstats_top5(x)

Top 5 market shares data frame

Description

Top 5 market shares data frame

Usage

concstats_top5_df(x, y, na.rm = TRUE)

Arguments

x

A data frame.

y

A non-negative vector of shares.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

Value

A data frame, which indicates an id or firm column and the top 5 market shares in decimal form.

See Also

Other Market structure measures: concstats_all_mstruct(), concstats_firm(), concstats_mstruct(), concstats_nrs_eq(), concstats_top(), concstats_top3(), concstats_top3_df(), concstats_top5(), concstats_top_df()

Examples

# some data
id <- c(1, 2, 3, 4, 5)
x <- c(0.2, 0.25, 0.4, 0.1, 0.05)
test_df <- data.frame(id, x)

Creditcoops

Description

data set with 22 paired Paraguayan credit cooperatives (2016, 2018)

Usage

creditcoops

Format

A data frame with 44 rows and 5 variables:

coop_id

double, ID of the credit cooperative

year

integer, sample year

total_loans

double, total loans granted (USD) per year and cooperative

paired

integer, paires of cooperatives

total_loans_log

double, the natural log of total loans

Note

real names of the cooperatives have been purposely omitted, but are available on request.

Author(s)

Andreas Schneider

Source

http://www.incoop.gov.py/v2/

Examples

data("creditcoops")
head(creditcoops)