CV | R Documentation |
Calculate coefficient of variation of data
CV(x, log = FALSE)
x |
The data |
log |
If TRUE, the geometric coefficient of variation is calculated. This is sqrt(exp(var(log(x))-1). |
This function is intended to be used on data. For a log-normal THETA1*EXP(ETA(1)) 'Nonmem' parameter, do CV=sqrt(exp(OMEGA[1,1])-1).
A numeric
set.seed(139)
x1 <- rnorm(1000,mean=5)
CV(x1)
CV(x1,log=TRUE)
x2 <- exp(x1)
CV(x2)
CV(x2,log=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.