Multiple (not repetitive) dosing #242
-
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. 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? Best, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@PascaleRietveld, Thanks for using PKNCA. I've moved this to a discussion since it's a question about use rather than a problem with PKNCA. Here is your original data/code as a reprex showing the specific error and with some minor modifications to highlight the issue. From your code, I added the library(tidyverse)
#> Warning: package 'ggplot2' was built under R version 4.3.1
#> Warning: package 'purrr' was built under R version 4.3.1
library(PKNCA)
#>
#> Attaching package: 'PKNCA'
#> The following object is masked from 'package:stats':
#>
#> filter
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)
my.conc <- PKNCAconc(data_conc, Conc~TAFD|ID)
Dosdata <- Data %>% select(ID, Dose, TAFD, duration, cycle) %>% filter(!is.na(Dose))
my.dose <- PKNCAdose(Dosdata, Dose~TAFD|ID)
#> Error in PKNCAdose.data.frame(Dosdata, Dose ~ TAFD | ID): Rows that are not unique per group and time (column names: TAFD, ID) found within dosing data. Row numbers: 3
Dosdata
#> ID Dose TAFD duration cycle
#> 1 1 700 0.0 0.25 1
#> 2 1 1000 0.4 22.00 1
#> 3 1 500 0.0 0.25 2
#> 4 1 1100 0.5 22.00 2
#> 5 2 700 0.0 0.25 1
#> 6 2 1300 0.5 22.00 1
#> 7 2 700 23.0 0.25 1
#> 8 2 1100 23.5 22.00 1 Created on 2023-09-25 with reprex v2.0.2 The error is saying that row 3 of your data is duplicated for the dosing data. The reason it's duplicated is because The way to clarify the difference between rows 1 and 3 in your data is to include library(tidyverse)
#> Warning: package 'ggplot2' was built under R version 4.3.1
#> Warning: package 'purrr' was built under R version 4.3.1
library(PKNCA)
#>
#> Attaching package: 'PKNCA'
#> The following object is masked from 'package:stats':
#>
#> filter
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)
my.conc <- PKNCAconc(data_conc, Conc~TAFD|cycle+ID)
Dosdata <- Data %>% select(ID, Dose, TAFD, duration, cycle) %>% filter(!is.na(Dose))
my.dose <- PKNCAdose(Dosdata, Dose~TAFD|cycle+ID)
#> Found column named duration, using it for the attribute of the same name. Created on 2023-09-25 with reprex v2.0.2 Another option would be to make the |
Beta Was this translation helpful? Give feedback.
@PascaleRietveld, Thanks for using PKNCA. I've moved this to a discussion since it's a question about use rather than a problem with PKNCA.
Here is your original data/code as a reprex showing the specific error and with some minor modifications to highlight the issue. From your code, I added the
cycle
column toDosdata
, and I added a line to show theDosdata
at the bottom: