powered by
Calculate coefficient of variation (CV)
cv(x, times, overall = TRUE, interval = 1)
Either a numeric coefficient of variation over the entire dataset or a vector of CV values over windows of the data.
vector of glucose readings
vector of corresponding times, in minutes
a logical, equal to TRUE you want the CV for the entire dataset, or equal to FALSE if you would prefer many CV values over a moving window
size (in hours) of the moving window to be used if overall is false. Null value is 1.
cv(x=c(rep(100, 10), rep(120, 10), 105, 85), times=seq(0, 1260, 60), overall=TRUE)
Run the code above in your browser using DataLab