FelicienLL / mapbayr

Easy Maximum A Posteriori Bayesian Estimation of PK parameters in R.
21 stars 2 forks source link

doubts #203

Closed PLLS closed 1 year ago

PLLS commented 1 year ago

Hi Felicien,

I am trying to estimate MAP steady state concentrations of adalimumab under different doses and different dosing intervals. I have only one dug level measured at steady state (5.6mcg/ml) with a dose of 40mg every 14 days. A one compartment pharmacokinetic model is assumed (Ternant 2015).

I have a couple of doubts,

The dose is administered in the depot compartment but the concentration is measured in the central compartment. I suppose the value in the "cmt" column is 2, isn`t it?

On the other side, I get different predictions depending on the possition of the the row with the information of the concentration (first row vs second row of the data frame). The full data frames are these:

mydata <- data.frame(ID = 1, time = 0, amt = c(40,80,80,40), ii = c(7,14,28,14), ADDL= 0, evid = c(1,1,1,0), cmt = 2, DV = c(NA,NA,NA,5.6), mdv = c(1,1,1,0), AAA = 0, ss=1)

mydata <- data.frame(ID = 1, time = 0, amt = c(40,40,80,80), ii = c(7,14,14,28), ADDL= 0, evid = c(1,0,1,1), cmt = 2, DV = c(NA,5.6,NA,NA), mdv = c(1,0,1,1), AAA = 0, ss=1) (AAA is a covariate)

I suposse I'm doing something wrong, but I can't see it. Any help? Thank you very much! Pilar

FelicienLL commented 1 year ago

Hi Pilar,

For your first question: Yes, it always depends on the way your model is coded but when you have DEPOT and CENTRAL, these are often compartment 1 and 2.

For your second question: I am not sure of what you tried to do here, but I think your error come from a misunderstanding of how dataset must be constructed in NONMEM / mrgsolve / mapbayr / etc... In a nutshell, information records are read row by row, and each row carries one type of information: either an administration (evid = 1), or an observation (evid = 0). Thus, if you want to transpose "one drug level measured at steady state (5.6mcg/ml) with a dose of 40mg every 14 days.", your dataset should look like this:

  ID time evid cmt amt  DV mdv ss ii
1  1    0    1   1  40  NA   1  1 14
2  1    0    0   2   0 5.6   0  0  0

With what you did, for the first data, the dosing regimen taken into account to analyze your observed concentration is 80 mg every 28 days. For the second data, it is 40 mg every 7 days. This is why you obtain different results. If you want to test for additional alternative dosing regimen, I guess you can do it too within the same dataset, but it should not interfere with the administrations rows that will be used to fit the observation. With ss = 1, the whole system is re-initialized.

mapbayr come with useful functions called "data helpers" to help you with the dataset creation. You can try something like this:

library(magrittr)
library(mapbayr)

possible_dosing <- adm_rows(amt = c(40, 40, 80, 80), ii = c(7, 14, 14, 28), ss = 1, cmt = 1)

data_to_fit <- adm_rows(amt = 40, ii = 14, ss = 1, cmt = 1) %>% 
  obs_rows(time = 0, DV = 5.6, cmt = 2) 

dplyr::bind_rows(data_to_fit, possible_dosing)
#> # A tibble: 6 x 9
#>      ID  time  evid   cmt   amt    DV   mdv    ss    ii
#>   <int> <dbl> <int> <int> <dbl> <dbl> <int> <dbl> <dbl>
#> 1     1     0     1     1    40  NA       1     1    14
#> 2     1     0     0     2     0   5.6     0     0     0
#> 3     1     0     1     1    40  NA       1     1     7
#> 4     1     0     1     1    40  NA       1     1    14
#> 5     1     0     1     1    80  NA       1     1    14
#> 6     1     0     1     1    80  NA       1     1    28

Let me know if you need anything else

Félicien

PLLS commented 1 year ago

Thank you so much, I will follow your suggestions

Pilar

FelicienLL commented 1 year ago

Closing now but feel free to re-open if you need anything else on this topic