Last chance! 50% off unlimited learning
Sale ends in
Calculates the coefficient of variation and its confidence limits using the noncentral t
-distribution..
CoefVar(x, ...)# S3 method for lm
CoefVar(x, unbiased = FALSE, conf.level = NA, na.rm = FALSE, ...)
# S3 method for aov
CoefVar(x, unbiased = FALSE, conf.level = NA, na.rm = FALSE, ...)
# S3 method for default
CoefVar(x, weights = NULL, unbiased = FALSE, conf.level = NA, na.rm = FALSE, ...)
a (non-empty) numeric vector of data values.
a numerical vector of weights the same length as x
giving the weights to use for elements of x
.
logical value determining, if a bias correction should be used (see. details). Default is FALSE.
confidence level of the interval.
logical. Should missing values be removed? Defaults to FALSE.
further arguments (not used here).
if no confidence intervals are requested: the estimate as numeric value (without any name) else a named numeric vector with 3 elements
estimate
lower confidence interval
upper confidence interval
In order for the coefficient of variation to be an unbiased estimate of the true population value,
the coefficient of variation is corrected as:
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
# NOT RUN {
set.seed(15)
x <- runif(100)
CoefVar(x, conf.level=0.95)
# est low.ci upr.ci
# 0.5092566 0.4351644 0.6151409
# Coefficient of variation for a linear model
r.lm <- lm(Fertility ~ ., swiss)
CoefVar(r.lm)
# }
Run the code above in your browser using DataLab