powered by
Calculate coefficient of variation of data
CV(x, log = FALSE)
A numeric
The data
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).
set.seed(139) x1 <- rnorm(1000,mean=5) CV(x1) CV(x1,log=TRUE) x2 <- exp(x1) CV(x2) CV(x2,log=TRUE)
Run the code above in your browser using DataLab