Skip to contents

This vignette shows how simple dose adaptations can be implemented.

Adapt the dose based on a covariate

Assume that your drug needs to be dosed according to the subject’s weight, for instance 0.5 mg per kg. To illustrate this, let’s use our 2-compartment PK model with absorption compartment.

model <- model_suite$nonmem$advan4_trans4

We’re going to create a dataset with 4 individuals, weighing respectively 40, 60, 80 and 100 kg.

dataset <- Dataset(4) %>%
  add(Bolus(time = 0, amount = 0.5)) %>% # 0.5mg / kg
  add(Observations(times = 0:24)) %>%
  add(Covariate("WT", c(40, 60, 80, 100)))

Our dataset is almost ready. We just have to define the dose adaptation formula. This is done as follows:

dataset <- dataset %>%
  add(DoseAdaptation("AMT*WT"))

Let’s simulate this simple dataset. In order to check that the dose adaptation formula was well applied, we set the argument dosing to TRUE. Dosing rows will then be returned.

results <- model %>%
  disable("IIV") %>%
  simulate(dataset = dataset, dosing = TRUE, seed = 1)
spaghetti_plot(results, "CONC", "ID")

Let’s now have a look at the dosing information which is returned.

results %>% dosing_only()
## # A tibble: 4 × 12
##      ID  EVID   CMT   AMT  TIME   ARM A_DEPOT A_CENTRAL A_PERIPHERAL A_OUTPUT
##   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>   <dbl>     <dbl>        <dbl>    <dbl>
## 1     1     1     1    20     0     0      20         0            0        0
## 2     2     1     1    30     0     0      30         0            0        0
## 3     3     1     1    40     0     0      40         0            0        0
## 4     4     1     1    50     0     0      50         0            0        0
## # ℹ 2 more variables: CONC <dbl>, CONC_ERR <dbl>

This looks great! The respective amounts that were given are indeed 20, 30, 40 and 50 mg!