Title: | Calculate and Visualize the Herfindahl-Hirschman Index |
---|---|
Description: | Based on the aggregated shares retained by individual firms or actors within a market or space, the Herfindahl-Hirschman Index (HHI) measures the level of concentration in a space. This package allows for intuitive and straightforward computation of HHI scores, requiring placement of objects of interest directly into the function. The package also includes a plot function for quick visual display of an HHI time series using any measure of time (year, quarter, month, etc.). For usage, please cite the Journal of Open Source Software paper associated with the package: Waggoner, Philip D. (2018) <doi:10.21105/joss.00828>. |
Authors: | Philip D. Waggoner <[email protected]> |
Maintainer: | Philip D. Waggoner <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.2.0 |
Built: | 2024-11-16 06:45:03 UTC |
Source: | CRAN |
Computes the Herfindahl-Hirschman Index of a market/space, which is a measure of concentration, based on the share size of all individual firms/actors
hhi(x, "s")
hhi(x, "s")
x |
Name of the data frame |
s |
Name of the vector (variable) from the data frame, x, corresponding with stored market share values |
Allows for placing the objects directly from working datasets (including, data frame and the market share variable name in quotes) into the function for intuitive usage.
hhi A measure of market concentration
The vector of "share" values should be comprised of integers corresponding to total share of individual firms/actors (e.g., df$s <- c(35, 40, 5, 10, 6, 4) # 6 firms totaling 100 percent of the market). The measure is often used as a measure of competition, where 0 is perfect competitiveness and 10,000 is a perfect monopoly.
Hirschman, Albert O. 1945. "National power and structure of foreign trade." Berkeley, CA: University of California Press.
Herfindahl, Orris Clemens. 1950. "Concentration in the steel industry." Ph.D. dissertation, Columbia University.
Rhoades, Stephen A. 1993. "The herfindahl-hirschman index." Federal Reserve Bulletin 79: 188.
Waggoner, Philip D. 2018. "The hhi Package: Streamlined Calculation and Visualization of Herfindahl-Hirschman Index Scores." Journal of Open Source Software 3(28), 828.
a <- c(1,2,3,4) # arbitrary firm id b <- c(20,30,40,10) # market share of each firm (should total 100% of market share) x <- data.frame(a,b) # create data frame hhi(x, "b") # calculate market concentration based on firms' share sizes
a <- c(1,2,3,4) # arbitrary firm id b <- c(20,30,40,10) # market share of each firm (should total 100% of market share) x <- data.frame(a,b) # create data frame hhi(x, "b") # calculate market concentration based on firms' share sizes
Generates a plot of a vector of Herfindahl-Hirschman Index (HHI) values over a period of time
plot_hhi(x, "t", "h")
plot_hhi(x, "t", "h")
x |
Name of the data frame |
t |
Name of the vector (variable) from the data frame, x, corresponding with a measure of time (year, month, etc.) |
h |
Name of the vector (variable) from the data frame, x, corresponding with the HHI values |
Allows for placing objects directly from working datasets (including, data frame, measure of time, and stored HHI values in quotes) into the function for intuitive usage. Function supports any measure of time.
hhi.plot A plot of HHI values over time
The "plot_hhi" function is meant for quick visual rendering of a vector of HHI values over a period of time leveraging ggplot2. Users are advised to generate original plots with other plotting packages beyond "hhi" to allow for greater flexibility in customizing visual output according to specific needs.
Hirschman, Albert O. 1945. "National power and structure of foreign trade." Berkeley, CA: University of California Press.
Herfindahl, Orris Clemens. 1950. "Concentration in the steel industry." Ph.D. dissertation, Columbia University.
Rhoades, Stephen A. 1993. "The herfindahl-hirschman index." Federal Reserve Bulletin 79: 188.
Waggoner, Philip D. 2018. "The hhi Package: Streamlined Calculation and Visualization of Herfindahl-Hirschman Index Scores." Journal of Open Source Software 3(28), 828.
hhi <- c(45,60,50,100,94,15,88,200,215,68, 47,62,52,102,96,17,90,202,217,70) year <- c(1990,1991,1992,1993,1994,1995,1996,1997,1998,1999, 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009) data <- data.frame(hhi, year) plot_hhi(data, "year", "hhi")
hhi <- c(45,60,50,100,94,15,88,200,215,68, 47,62,52,102,96,17,90,202,217,70) year <- c(1990,1991,1992,1993,1994,1995,1996,1997,1998,1999, 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009) data <- data.frame(hhi, year) plot_hhi(data, "year", "hhi")