if (campsis::onCran()) { cat("This vignette was not built on CRAN. Please check out the online version [here](https://calvagone.github.io/campsis.doc/articles/v09_dose_adaptation.html).") knitr::knit_exit() }
library(campsis)
This vignette shows how simple dose adaptations can be implemented.
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) spaghettiPlot(results, "CONC", "ID")
Let's now have a look at the dosing information which is returned.
results %>% dosingOnly()
This looks great! The respective amounts that were given are indeed 20, 30, 40 and 50 mg!
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.