cv: Coefficient of variation

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

1
2
cv(x, is.sample = TRUE, coefnorm = FALSE, weighting = NULL, 
output = "cv")

Arguments

x

a numeric vector

is.sample

logical argument that indicates if the dataset is a sample or the population (default: is.sample = TRUE, so the denominator of variance is n-1)

coefnorm

logical argument that indicates if the function output is the standardized cv (0 < v* < 1) or not (0 < v < ∞) (default: coefnorm = FALSE)

weighting

a numeric vector containing weighting data to compute the weighted coefficient of variation (instead of the non-weighted cv)

output

determines the output (default: output = "cv"). If output = "sd", the function output is the standard deviation and if output = "mean", the output is the arithmetic mean of x. These alternative output options only make sense if the data is weighted with a vector given in weighting (the non-weighted values could be simply calculated by the base function sd and mean, respectively)

Details

The coefficient of variation, v, is a dimensionless measure of statistical dispersion (0 < v < ∞), based on variance and standard deviation, respectively. From a regional economic perspective, it is closely linked to the concept of sigma convergence (σ) which means a harmonization of regional economic output or income over time, while the other type of convergence, beta convergence (β), means a decline of dispersion because poor regions have a stronger growth than rich regions (Capello/Nijkamp 2009). The cv allows to summarize regional disparities (e.g. disparities in regional GDP per capita) in one indicator and is more frequently used for this purpose than the standard deviation, especially in analyzing of σ convergence over a long period (e.g. Lessmann 2005, Huang/Leung 2009, Siljak 2015). But the cv can also be used for any other types of disparities or dispersion, such as disparities in supply (e.g. density of physicians or grocery stores).

The cv (variance, standard deviation) can be weighted by using a second weighting vector. As there is more than one way to weight measures of statistical dispersion, this function uses the formula for the weighted cv (v_w) from Sheret (1984). The cv can be standardized, while this function uses the formula for the standardized cv (v*, with 0 < v* < 1) from Kohn/Oeztuerk (2013). The vector x is automatically treated as a sample (such as in the base sd function), so the denominator of variance is n-1, if it is not, set is.sample = FALSE.

Value

Single numeric value. If coefnorm = FALSE the function returns the non-standardized cv (0 < v < ∞). If coefnorm = TRUE the standardized cv (0 < v* < 1) is returned. If output = "sd", the functions returns the (weighted) standard deviation. If output = "mean", the functions returns the (weighted) arithmetic mean.

Author(s)

Thomas Wieland

References

Bahrenberg, G./Giese, E./Mevenkamp, N./Nipper, J. (2010): “Statistische Methoden in der Geographie. Band 1: Univariate und bivariate Statistik”. Stuttgart: Borntraeger.

Capello, R./Nijkamp, P. (2009): “Introduction: regional growth and development theories in the twenty-first century - recent theoretical advances and future challenges”. In: Capello, R./Nijkamp, P. (eds.): Handbook of Regional Growth and Development Theories. Cheltenham: Elgar. p. 1-16.

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: The Open Geography Journal, 2, p. 25-34.

Kohn, W./Oeztuerk, R. (2013): “Statistik fuer Oekonomen. Datenanalyse mit R und SPSS”. Berlin: Springer.

Sheret, M. (1984): “The Coefficient of Variation: Weighting Considerations”. In: Social Indicators Research, 15, 3, p. 289-295.

Siljak, D. (2015): “Real Economic Convergence in Western Europe from 1995 to 2013”. In: International Journal of Business and Economic Development, 3, 3, p. 56-67.

See Also

gini, herf, hoover, rca

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Regional disparities / sigma convergence in Germany
data(gdppc)
# GDP per capita for German counties (Landkreise)
cvs <- apply (gdppc[3:17], MARGIN = 2, FUN = cv)
# Calculating cv for the years 2000-2014
years <- 2000:2014
plot(years, cvs, "l", ylim=c(0.3,0.6), xlab = "year", 
ylab = "CV of GDP per capita")
# Plot cv over time

# 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


Search within the REAT package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.