billdenney/pknca

Feature request: Interpolating C0 for AUC calculations

john-harrold opened this issue · 4 comments

It's discussed in this comment here:

#82 (comment)

I would like to be able to select an interval starting at 0 where the first observation is NA at 0 or just not there and have C0 be extrapolated and used for the AUC calculations. Perhaps have this be an option that is set, or if you set the interval to start before the first point it does it automatically with a note.

Would adding an IV bolus C0 imputation to the imputation methods described here cover the request?

https://billdenney.github.io/pknca/articles/v08-data-imputation.html

Is what you're suggesting what I'm doing below? When I do that I still get NC for auclast and aucinf.obs.

library(PKNCA)
d <- data.frame(time=c(0.08, 1, 2, 3, 4),
                conc=c(1, 0.5, 0.4, 0.3, 0.2),
                subject=1)
myconc <- PKNCAconc(data=d, conc~time|subject)
mydata <- PKNCAdata(myconc, intervals=data.frame(start=0, end=5, 
      impute="start_conc0",
      cmax        = TRUE, 
      tmax        = TRUE, 
      aucinf.obs  = TRUE,
      aucint.last = TRUE, 
      auclast     = TRUE))
myres <- pk.nca(mydata)

summary(myres)

I think that should work, and yes, that is what I was thinking. I'll take a look.

The underlying issue was that impute needed to be an argument to PKNCAdata() and not only a column in the intervals. That said, allowing it only to be a column in the intervals makes a lot of sense, so I allowed that usage, too.