Entering edit mode
4.4 years ago
arbuni736
•
0
hey guys, I need little help in R, I have to calculate AUC for different glucose intervals using trapezoid method...for each ID, and for intervals, for example conc>10, conc>11. conc>12...I need to adjust the following code for different intervals, do not how:) maybe nested loop, or smth
apply(split(data,data$ID), function(data), trapz(data$time, data$conc))
get_auc(data, time="time", id="id", dv="conc")