Learn R Programming

REAT (version 1.2.1)

cv: Coefficient of variation

Description

Calculating the coefficient of variation (cv), standardized and non-standardized

Usage

cv(x, coefnorm = FALSE)

Arguments

x
a numeric vector
coefnorm
logical argument that indicates if the function output is the standardized cv or not (default: coefnorm = FALSE)

Value

Single numeric value. If coefnorm = FALSE the function returns the non-standardized cv ($0 < v < \infty$). If coefnorm = TRUE the standardized cv ($0 < v* < 1$) is returned.

Details

The coefficient of variation $v$ is a simple standardized measure of distribution and is used especially in the analysis of regional economic disparities (e.g. disparities in regional GDP per capita) or disparities in supply (e.g. density of physicians or grocery stores). The function returns the non-standardized cv ($0 < v < \infty$) or the standardized cv ($0 < v* < 1$).

References

Lessmann, C. (2005): “Regionale Disparitaeten in Deutschland und ausgesuchten OECD-Staaten im Vergleich”. ifo Dresden berichtet, 3/2005. https://www.cesifo-group.de/link/ifodb_2005_3_25-33.pdf.

Huang, Y./Leung, Y. (2009): “Measuring Regional Inequality: A Comparison of Coefficient of Variation and Hoover Concentration Index”. In: In: The Open Geography Journal, 2, p. 25-34.

Examples

Run this code
# Supply of grocery stores:
data(Goettingen)
# Loads the data
# (Grocery stores in Goettingen, Germany, at the level of 69 statistical districts:
# number and sales area of stores, absolute values and per 1.000 inhabitants)
cv(Goettingen$stores_p1000p)
# cv of stores per 1.000 inhabitants
cv(Goettingen$salesarea_p1000p)
# cv of sales area per 1.000 inhabitants
cv(Goettingen$salesarea_p1000p, coefnorm=TRUE)
# standardized cv of sales area per 1.000 inhabitants

# Supply of physicians:
data(health2)
# Demographic data for 420 small regions
data(health4)
# Medical supply in the 420 regions
supply_physgen <- merge(health4, health2)
supply_physgen$physgen_pop <- supply_physgen$phys_gen/supply_physgen$pop*1000
# Calculation: physicians per 1.000 inhabitants
supply_physgen[is.na(supply_physgen$physgen_pop),]$physgen_pop <- 0
cv(supply_physgen$physgen_pop)
# cv of physician supply

Run the code above in your browser using DataLab