Learn R Programming

sjmisc (version 1.0.0)

cv: Compute coefficient of variation

Description

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).

Usage

cv(x)

Arguments

x
a (numeric) vector / variable or a fitted linear model of class lm, merMod (lme4) or lme (nlme).

Value

  • The coefficient of variation of x.

See Also

  • http://www.ats.ucla.edu/stat/mult_pkg/faq/general/coefficient_of_variation.htm{UCLA-FAQ: What is the coefficient of variation?}
  • rmse

Examples

Run this code
data(efc)
cv(efc$e17age)

Run the code above in your browser using DataLab