auc {epicalc} | R Documentation |
Compute area under time-concentration curve for individuals
auc(conc, time, id=NULL)
conc |
concentration |
time |
time point where the concentration was measured |
id |
subject identification |
This function compute auc using simple trapezoid summation.
id=NULL is used when concentration (conc) and time are from only one subject.
Virasakdi Chongsuvivatwong <cvirasak@medicine.psu.ac.th>
'auc' in 'PK' package
# Using 'by' and 'sapply' to compute individual auc of Indometh data tmp <- by(data=Indometh, INDICES = Indometh$Subject, FUN = function(x) auc(conc=x$conc, time=x$time, id=NULL)) sapply(tmp, as.numeric) # A better way to compute use(Indometh) auc(conc=conc, time=time, id=Subject)