Learn R Programming

hhi (version 1.2.0)

hhi: Calculates the Herfindahl-Hirschman Index

Description

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

Usage

hhi(x, "s")

Arguments

x

Name of the data frame

s

Name of the vector (variable) from the data frame, x, corresponding with stored market share values

Value

hhi A measure of market concentration

Details

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.

References

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.

Examples

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab