DescTools (version 0.99.15)

CoefVar: Coefficient of Variation

Description

Calculates the coefficient of variation and its confidence limits using the noncentral t-distribution..

Usage

CoefVar(x, unbiased = FALSE, conf.level = NA, na.rm = FALSE)

Arguments

x
a (non-empty) numeric vector of data values.
unbiased
logical value determining, if a bias correction should be used (see. details). Default is FALSE.
conf.level
confidence level of the interval.
na.rm
logical. Should missing values be removed? Defaults to FALSE.

Value

  • if no confidence intervals are requested: the estimate as numeric value (without any name) else a named numeric vector with 3 elements
  • estestimate
  • lwr.cilower confidence interval
  • upr.ciupper confidence interval

Details

In order for the coefficient of variation to be an unbiased estimate of the true population value, the coefficient of variation is corrected as: $$CV_{korr} = CV \cdot \left( 1 - \frac{1}{4\cdot(n-1)} + \frac{1}{n} \cdot CV^2 + \frac{1}{2 \cdot (n-1)^2} \right)$$

References

Johnson, B. L., Welch, B. L. (1940). Applications of the non-central t-distribution. Biometrika, 31, 362--389. Kelley, K. (2007). Sample size planning for the coefcient of variation from the accuracy in parameter estimation approach. Behavior Research Methods, 39 (4), 755-766 Kelley, K. (2007). Constructing confidence intervals for standardized effect sizes: Theory, application, and implementation. Journal of Statistical Software, 20 (8), 1-24 McKay, A. T. (1932). Distribution of the coefficient of variation and the extended t distribution, Journal of the Royal Statistical Society, 95, 695--698. Smithson, M.J. (2003) Confidence Intervals, Quantitative Applications in the Social Sciences Series, No. 140. Thousand Oaks, CA: Sage. pp. 39-41

See Also

mean, sd

Examples

Run this code
set.seed(15)
x <- runif(100)
CoefVar(x, conf.level=0.95)

#       est    low.ci    upr.ci 
# 0.5092566 0.4351644 0.6151409

Run the code above in your browser using DataCamp Workspace