cv: Coefficient of variation

Description Usage Arguments Value Original URL Author(s) References Examples

Description

This function computes the coefficient of variation (i.e. sd / mean) of the values in x. If ci is TRUE then confidence intervals are also computed.

Usage

1
2
cv(x, na.rm = FALSE, ci = FALSE, conf.level = 0.95,
  method = c("mckaymod", "mckay", "naive"))

Arguments

x

A numeric vector

na.rm

Logical. Should missing values be removed?

ci

Logical. Should confidence intervals be computed?

conf.level

Confidence level of the interval.

method

The method to compute the confidence intervale. Either the naive (naive), the McKay (mckay) or the modified McKay (mckaymod, default) approximation.

Value

If ci, returns a list with the coefficient of variation. in the first element and the confidence interval in the second.

Original URL

http://tolstoy.newcastle.edu.au/R/e2/help/07/06/19043.html

Author(s)

From Kevin Wright, modified by Mathieu Basille basille@ufl.edu

References

Vangel, M. G. (1996) Confidence intervals for a normal coefficient of variation. The American Statistician, 50: 21-26

Examples

1
2
3
4
xx <- 1:10
cv(xx)
sd(xx)/mean(xx)
cv(xx, ci = TRUE)

basille/basr documentation built on May 11, 2019, 8:32 p.m.