Compute coefficient of variation for single variables (standard deviation divided by mean) or for fitted linear (mixed effects) models (root mean squared error (RMSE) divided by mean of dependent variable).
cv(x, ...)
x | (Numeric) vector or a fitted linear model of class
|
---|---|
... | More fitted model objects, to compute multiple coefficients of variation at once. |
The coefficient of variation of x
.
The advantage of the cv is that it is unitless. This allows
coefficient of variation to be compared to each other in ways
that other measures, like standard deviations or root mean
squared residuals, cannot be.
“It is interesting to note the differences between a model's CV
and R-squared values. Both are unitless measures that are indicative
of model fit, but they define model fit in two different ways: CV
evaluates the relative closeness of the predictions to the actual
values while R-squared evaluates how much of the variability in the
actual values is explained by the model.”
(source: UCLA-FAQ)
Everitt, Brian (1998). The Cambridge Dictionary of Statistics. Cambridge, UK New York: Cambridge University Press
data(efc) cv(efc$e17age)#> [1] 0.1023027fit <- lm(neg_c_7 ~ e42dep, data = efc) cv(fit)#> [1] 0.3017953#> [1] 0.07851737library(nlme)#> #>#>#> #>#>#> #>#> [1] 0.07851744