cv: coefficient of variance

Description Usage Arguments Value Author(s) References Examples

Description

The coefficient of variation (CV) is defined as the ratio of the standard deviation to the mean. As such, it is a measure of dispersion of a probability distribution. It can only be computed on for data on a ratio scale (ie all positive).

Usage

1
  cv(x, as.percent = FALSE, na.rm = TRUE)

Arguments

x

a numeric vector of positive values

as.percent

logical: return result as a percentage?

na.rm

logical: remove NA's ?

Value

a numeric(1)

Author(s)

Mark Cowley, 2012-07-09

References

http://en.wikipedia.org/wiki/Coefficient_of_variation

Examples

1
2
3
4
val <- runif(25)
cv(val)
cv(val, as.percent=TRUE)
cv(c(val, NA), na.rm=FALSE)

drmjc/mjcstats documentation built on May 15, 2019, 2:41 p.m.