billdenney / pknca

An R package is designed to perform all noncompartmental analysis (NCA) calculations for pharmacokinetic (PK) data.
http://billdenney.github.io/pknca/
GNU Affero General Public License v3.0
67 stars 24 forks source link

Multiple (not repetitive) dosing #241

Closed PascaleRietveld closed 11 months ago

PascaleRietveld commented 11 months ago

Hi Bill,

Thank you for your useful tutorial! I am trying to calculate the AUC of my population but because of multiple dosing (not repetitive) I cannot make it seem to work. I have a dataset where each patient receives per cycle (2 cycles per ID) an IV bolus and then a continuous infusion of 22 hours or 44 hours. Then some patients receive a second bolus and continuous infusion after about 22 hours. I use time after first dose (TAFD) because of multiple dosing. My dataset kindoff looks like this:


Data <- data.frame(
  cycle = c(1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1),
  ID = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2),
  Conc = c(0, 0, 2.8, 2.5, 0, 0, 0, 0, 3, 3.2, 0, 0, 5),
  TAFD = c(0, 0.4, 5, 22, 0, 0.5, 0, 0.5, 10, 22, 23, 23.5, 45),
  duration = c(0.25, 22, NA, NA, 0.25, 22, 0.25, 22, NA, NA, 0.25, 22, NA),
  Dose = c(700, 1000, NA, NA, 500, 1100, 700, 1300, NA, NA, 700, 1100, NA))

data_conc <- Data %>% filter(is.na(Dose)) %>% select(-Dose,-duration)

knitr::kable(Data)

my.conc <- PKNCAconc(data_conc, Conc~TAFD|ID)

Dosdata <- Data %>% select(ID, Dose, TAFD, duration) %>% filter(!is.na(Dose))
my.dose <- PKNCAdose(Dosdata, Dose~TAFD|ID)

I am stuck because of this error: Rows that are not unique per group and time (column names: TAFD, ID) found within dosing data.

How can I calculate the PK parameters for this multiple dosing dataset? Thanks a lot in advance!

Best, Pascale