cv | R Documentation |
Compute the coefficient of variation (CV). The CV, also known as relative standard deviation (RSD), is a standardized measure of dispersion of a probability distribution or frequency distribution.
It is defined as the ratio of the standard deviation to the mean and is often expressed as a percentage.
In contrast to the standard deviation, it enables comparison between datasets as the CV is independent of the unit in which the measurement has been taken.
If na.rm
is TRUE
then missing values are removed before computation proceeds.
cv(x, na.rm = FALSE)
x |
a numeric vector |
na.rm |
logical. Should missing values be removed? |
A numeric scalar – the sample coefficient of variation.
The coefficient of variation (CV) should be computed only for data measured on a ratio scale (i.e. data with an absolute zero). The CV may not have any meaning for data on an interval scale.
According to Dormann 2017 CV-values below 0.05 (5%) indicate very high precision of the data, values above 0.2 (20%) low precision. However, this is considered as a rule of thumb. In studies of highly variable systems (e.g. some ecological studies) CV values above 1 may occur.
The CV of a zero-length vector (after removal of NA
s if na.rm = TRUE
) is not defined and gives an error.
If there is only a single value, sd
is NA
and cv
returns NA
.
Dormann, C. (2017). Parametrische Statistik. Verteilungen, maximum likelihood und GLM in R. Springer. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-662-54684-0")}
Frost, J. (2023). Coefficient of variation in statistics. Statistics by Jim. https://statisticsbyjim.com/basics/coefficient-variation/.
sd
## Calculate CV for variable soil depth
cv(schedenenv$soil_depth)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.