CoefVar: Coefficient of Variation

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

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
CoefVar(x, ...)

## S3 method for class 'lm'
CoefVar(x, unbiased = FALSE, conf.level = NA, na.rm = FALSE, ...)

## S3 method for class 'aov'
CoefVar(x, unbiased = FALSE, conf.level = NA, na.rm = FALSE, ...)

## Default S3 method:
CoefVar(x, weights = NULL, unbiased = FALSE, conf.level = NA, na.rm = FALSE, ...)

Arguments

x

a (non-empty) numeric vector of data values.

weights

a numerical vector of weights the same length as x giving the weights to use for elements of x.

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.

...

further arguments (not used here).

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 ≤ft( 1 - \frac{1}{4\cdot(n-1)} + \frac{1}{n} \cdot CV^2 + \frac{1}{2 \cdot (n-1)^2} \right)

Value

if no confidence intervals are requested: the estimate as numeric value (without any name)

else a named numeric vector with 3 elements

est

estimate

lwr.ci

lower confidence interval

upr.ci

upper confidence interval

Author(s)

Andri Signorell <andri@signorell.net>,
Michael Smithson <michael.smithson@anu.edu.au> (noncentral-t)

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, (both supporting weights)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

AndriSignorell/DescTools documentation built on April 8, 2021, 5:51 a.m.