concstats
concstats: Market Structure, Concentration and Inequality Measures, with R - Published in JOSS (2023)
Science Score: 93.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 9 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org -
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Repository
Market Structure, Concentration, and Inequality Measures
Basic Info
- Host: GitHub
- Owner: ropensci
- License: other
- Language: R
- Default Branch: main
- Homepage: https://docs.ropensci.org/concstats
- Size: 1.98 MB
Statistics
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 2
- Releases: 5
Topics
Metadata Files
README.md
concstats 
Market Structure, Concentration, and Inequality Measures
Introduction
Measures of concentration and competition are important and give a first insight of a given market structure in a particular market. They are important to determine public policies and strategic corporate decisions. However, in research and in practice the most commonly used measure is the Herfindahl Hirschman Index. Various complementary or alternative measures exist, which - used as a set - might reduce uncertainty. The goal of the concstats package is to offer a set of alternative and/or additional measures for researchers in social sciences and practitioners in institutions concerned with competition on a regular basis to better determine a given market structure and therefore reduce uncertainty with respect to a given market situation. Various functions or groups of functions are available to achieve the desired goal.
-concstats_concstats calculates a set of pre-selected concentration
and diversity measures in a one-step procedure.
-concstats_mstruct offers market structure measures, e.g. the sum of
Top3 or Top5 market shares.
-concstats_comp is a wrapper for concentration measures, e.g. the
Herfindahl Hirschman Index.
-concstats_inequ offers diversity or inequality measures, e.g. the
Entropy or the Palma ratio.
-concstats_shares is a helper function converting numeric vectors into
individual shares.
Installation
A stable version of concstats is available on CRAN:
r
install.packages("concstats") # Market structure, concentration and inequality
# measures
You can install the latest development version from GitHub or R-universe.
``` r
install.packages("devtools")
devtools::install_github("ropensci/concstats") ```
r
install.packages("concstats", repos = "https://ropensci.r-universe.dev")
How to use concstats
concstats_concstats
In general, all functions of the concstats package take numeric
vectors as input, that is, ideally relative market shares in decimal
format. However, the user can also use integers which are then converted
to decimal form. concstats_constats has one main function which
calculates a set of pre-selected measures in a one-step procedure.
concstats_mstruct
is a wrapper to calculate different structural measures. Within this
group are measures like the number of firms, numbers equivalent,
cumulative Top 3 and Top 5 market share. The measures might be
calculated as a group or individually. The concstats_top_df functions
also take a data frame as input, since the ranking of firms might be of
interest.
concstats_comp
is a group wrapper to calculate different concentration measures. Within this group are measures like the Herfindahl-Hirschman index (HHI), the dual of the HHI, the Dominance or the Stenbacka index.
concstats_inequ
is a group of inequality and diversity measures, e.g. Entropy, Gini coefficient, Palma ratio. Most functions offer a finite sample correction.
Examples
This is a basic example which shows you how to calculate an individual measure or a set of market structure and concentration measures:
``` r library(concstats)
Create some simple data
x <- c(0.4, 0.2, 0.25, 0.1, 0.05, 0, 0) concstats_hhi(x) # the Herfindahl-Hirschman Index
> [1] 0.275
if you need to convert your data into shares
x <- c(538572286.08, 481096.77, 161914143.03, 128796268.59, 69055940.72) concstats_shares(x, digits = 5)
> [1] 0.59920 0.00054 0.18014 0.14329 0.07683
concstats_dom(x) # the Dominance Index
> [1] 0.4127273
Our simple data
x2 <- c(0.35, 0.4, 0.05, 0.1, 0.06, 0.04) # market shares of each firm in # the market (should sum up to 1)
Calculate a selected set of market structure and concentration measures
concstats_concstats(x2, digits = 2) # calculates a pre-selected set of measures
> Measures Values
> 1 Firms 6.00
> 2 Nrs_equivalent 3.33
> 3 Top (%) 40.00
> 4 Top3 (%) 85.00
> 5 Top5 (%) 96.00
> 6 HHI 0.30
> 7 Entropy(RE) 0.79
> 8 Palma ratio 2.67
```
In this case, the result is a table with eight selected measures: 1) Number of firms, 2) Numbers equivalent of firms, 3) Top firm, share in %, 4) Top 3 firms, share in %, 5) Top 5 firms, share in %, 6) The Herfindahl-Hirschman Index, in decimal form, 7) Normalized Shannon Entropy (RE), a value between 0 and 1, 8) Palma ratio, an inequality score which measures the ratio of the top 10 percent to the bottom 40 percent.
Prior Art
Some functions are already implemented in other R packages. The non-exhaustive summary below is by no means a description of each package.
The Herfindahl Hirschman Index can be found in the hhi and the divseg packages. While the hhi package has just one function, neither of both packages offer a normalized version of the measure.
The latter offers as well functions for the Entropy, Gini and Simpson measures.
The acid and the ineq packages offer functions for inequality and competition measures, e.g. for the Entropy and Gini metric.
Some popular measures, e.g. Gini or the Herfindahl-Hirschman index have also been implemented in Python.
However, almost none of these packages offer a normalized calculation of the respective measure, with the exception of the ineq package. Other functions are new implementations in R, e.g. Dominance Index, Palma ratio, Stenbacka Index, GRS measure, and the dual of the Herfindahl Hirschman Index.
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.
- Cobham, A. and A. Summer (2013). “Is It All About the Tails? The Palma Measure of Income Inequality”, Center for Global Development, Washington, DC.
- Garcia Alba Idunate, P. (1994). “Un Indice de dominancia para el analisis de la estructura de los mercados”. , 61: 499-524.
- Ginevicius, R. and S. Cirba (2009). “Additive measurement of market concentration”, , 10(3), 191-198. https://doi.org/10.3846/1611-1699.2009.10.191-198
- Palma, J. G. (2006). “Globalizing Inequality: ‘Centrifugal’ and ‘Centripetal’ Forces at Work”, DESA Working Paper No. 35.
- Shannon, C. E. (1948). “A Mathematical Theory of Communication”, (Nokia Bell Labs).
- Melnik, A., Shy, Oz, Stenbacka, R., (2008), “Assessing market dominance”, , 68: pp. 63-72.
- Simpson, E. H. (1949). “Measurement of Diversity”, , 163, 688. https://doi.org/10.1038/163688a0
Credits
The hexagon sticker is created by myself with the hexsticker package.
A good overview and a lot of inspiration (adding badges, how to create a
webpage and testing the package) comes from Cosima Meyer and Dennis
Hammerschmidt.
Contact and Issues
If you have any questions or find any bugs requiring fixing, feel free to open an issue or pull request.
Development
Contributions are welcome! For more details on how to contribute to this package please see the CONTRIBUTING file.
Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Owner
- Name: rOpenSci
- Login: ropensci
- Kind: organization
- Email: info@ropensci.org
- Location: Berkeley, CA
- Website: https://ropensci.org/
- Twitter: rOpenSci
- Repositories: 307
- Profile: https://github.com/ropensci
JOSS Publication
concstats: Market Structure, Concentration and Inequality Measures, with R
Tags
market structure concentration inequality diversityCodeMeta (codemeta.json)
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"identifier": "concstats",
"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>.",
"name": "concstats: Market Structure, Concentration and Inequality Measures",
"relatedLink": [
"https://docs.ropensci.org/concstats/(website)",
"https://CRAN.R-project.org/package=concstats"
],
"codeRepository": "https://github.com/ropensci/concstats/",
"issueTracker": "https://github.com/ropensci/concstats/issues/",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.2.0",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"author": [
{
"@type": "Person",
"givenName": "Andreas",
"familyName": "Schneider",
"email": "schneiderconsultingpy@gmail.com",
"@id": "https://orcid.org/0000-0001-5630-1097"
}
],
"maintainer": [
{
"@type": "Person",
"givenName": "Andreas",
"familyName": "Schneider",
"email": "schneiderconsultingpy@gmail.com",
"@id": "https://orcid.org/0000-0001-5630-1097"
}
],
"softwareSuggestions": [
{
"@type": "SoftwareApplication",
"identifier": "rmarkdown",
"name": "rmarkdown",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rmarkdown"
},
{
"@type": "SoftwareApplication",
"identifier": "knitr",
"name": "knitr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=knitr"
},
{
"@type": "SoftwareApplication",
"identifier": "dplyr",
"name": "dplyr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=dplyr"
},
{
"@type": "SoftwareApplication",
"identifier": "devtools",
"name": "devtools",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=devtools"
},
{
"@type": "SoftwareApplication",
"identifier": "kableExtra",
"name": "kableExtra",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=kableExtra"
},
{
"@type": "SoftwareApplication",
"identifier": "ggplot2",
"name": "ggplot2",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=ggplot2"
},
{
"@type": "SoftwareApplication",
"identifier": "testthat",
"name": "testthat",
"version": ">= 3.0.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=testthat"
},
{
"@type": "SoftwareApplication",
"identifier": "covr",
"name": "covr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=covr"
}
],
"softwareRequirements": {
"1": {
"@type": "SoftwareApplication",
"identifier": "R",
"name": "R",
"version": ">= 2.10"
},
"SystemRequirements": null
},
"fileSize": "1182.584KB",
"citation": [
{
"@type": "ScholarlyArticle",
"datePublished": "2023",
"author": [
{
"@type": "Person",
"givenName": "Andreas",
"familyName": "Schneider"
}
],
"name": "concstats: Market Structure, Concentration and Inequality Measures, with R",
"identifier": "10.21105/joss.05885",
"url": "https://doi.org/10.21105/joss.05885",
"pagination": "5885",
"@id": "https://doi.org/10.21105/joss.05885",
"sameAs": "https://doi.org/10.21105/joss.05885",
"isPartOf": {
"@type": "PublicationIssue",
"issueNumber": "89",
"datePublished": "2023",
"isPartOf": {
"@type": [
"PublicationVolume",
"Periodical"
],
"volumeNumber": "8",
"name": "Journal of Open Source Software"
}
}
}
],
"releaseNotes": "https://github.com/ropensci/concstats/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/concstats/blob/master/README.md",
"contIntegration": [
"https://github.com/ropensci/concstats/actions",
"https://app.codecov.io/gh/ropensci/concstats",
"https://github.com/ropensci/concstats/actions?query=workflow%3Apkgcheck"
],
"developmentStatus": "https://www.repostatus.org/#active",
"review": {
"@type": "Review",
"url": "https://github.com/ropensci/software-review/issues/559",
"provider": "https://ropensci.org"
},
"keywords": [
"package-development",
"r",
"concentration",
"diversity",
"business-analytics",
"competition",
"inequality",
"r-package"
]
}
GitHub Events
Total
- Issues event: 1
- Delete event: 1
- Issue comment event: 6
- Push event: 12
- Create event: 2
Last Year
- Issues event: 1
- Delete event: 1
- Issue comment event: 6
- Push event: 12
- Create event: 2
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| schneiderpy | s****y@g****m | 225 |
| Arfon Smith | a****h@g****m | 1 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 4
- Total pull requests: 1
- Average time to close issues: 10 months
- Average time to close pull requests: about 11 hours
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 13.75
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 3
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 1
- Bot pull requests: 0
Top Authors
Issue Authors
- github-actions[bot] (3)
- marberts (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 203 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 3
- Total maintainers: 1
cran.r-project.org: concstats
Market Structure, Concentration and Inequality Measures
- Homepage: https://github.com/ropensci/concstats/
- Documentation: http://cran.r-project.org/web/packages/concstats/concstats.pdf
- License: GPL (≥ 3)
-
Latest release: 0.1.6
published almost 3 years ago
Rankings
Maintainers (1)
Dependencies
- R >= 2.10 depends
- dplyr >= 1.0.7 imports
- readr * imports
- covr * suggests
- devtools * suggests
- ggplot2 * suggests
- kableExtra * suggests
- knitr * suggests
- rmarkdown * suggests
- testthat >= 3.0.0 suggests
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- ropensci-review-tools/pkgcheck-action main composite
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v3 composite
- actions/upload-artifact v3 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
