Learn R Programming

sjstats (version 0.17.6)

cv: Compute model quality

Description

Compute the coefficient of variation.

Usage

cv(x, ...)

Arguments

x

Fitted linear model of class lm, merMod (lme4) or lme (nlme).

...

More fitted model objects, to compute multiple coefficients of variation at once.

Value

Numeric, the coefficient of variation.

Details

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)

Examples

Run this code
# NOT RUN {
data(efc)
fit <- lm(barthtot ~ c160age + c12hour, data = efc)
cv(fit)

# }

Run the code above in your browser using DataLab