I have to calculate AUC for glucose conc above 10, 11, 12......time is independent(x) and glucose concentration(y) dependent variable....I am not sure how to write a loop or something so it calculates only for those intervals above 10, with increment by 1
sapply(split(data,data$ID), function(data), trapz(data$time, data$conc))
get_auc(data, time="time", id="id", dv="conc")