Learn R Programming

DescTools (version 0.99.9)

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. In order for the coefficient of variation to be an unbiased estimate of the true population value, calculated value is calculated as CV * ((1 - (1/(4*(n-1))) + (1/n) * CV^2) + (1/(2 * (n-1)^2))). Default is TRUE.
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

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 DataLab