Coefficient of variation

Share:

Description

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

Usage

1
cv(x, norm = FALSE)

Arguments

x

a numeric vector

norm

logical argument that indicates if the function output is the standardized cv or not (default: norm = FALSE)

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 < ∞) or the standardized cv (0 < v* < 1).

Value

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

Author(s)

Thomas Wieland

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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, norm=TRUE)
# standardized cv of sales area per 1.000 inhabitants