This is a test version of Biostars. For the public version, visit https://www.biostars.org.
calculate AUC in R per ID and for glucose levels above 10, 11, 12 etc

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

  1. apply(split(data,data$ID), function(data), trapz(data$time, data$conc))
  2. get_auc(data, time="time", id="id", dv="conc")
auc trapz r

0 answers

No answers yet.

Log in to answer this question.