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/v15_pkpd_model_library.html).") knitr::knit_exit() }
library(campsis)
This vignette presents a couple of pharmacodynamic models (PD) from the model library that can be linked to an existing PK model.
In order to not repeat ourselves, all the below pharmacodynamic models will be linked to our reference 2-compartment PK model from the library.
pk <- model_suite$nonmem$advan4_trans4
Load the direct-effect model from the model library:
pd <- model_suite$pd$direct_effect_model pd
Link the PD model to the PK model as follows:
pkpd <- pk %>% add(pd) pkpd <- pkpd %>% replace(Equation("PK_CONC", "A_CENTRAL/S2"))
Simulate the PK/PD model with a basic dataset:
library(campsis) dataset <- Dataset(25) %>% add(Bolus(time=0, amount=1000, compartment=1, ii=12, addl=6)) %>% add(Observations(times=0:168)) results <- pkpd %>% simulate(dataset=dataset, seed=1) gridExtra::grid.arrange(shadedPlot(results, "CONC"), shadedPlot(results, "EFFECT"), ncol=1)
Load the effect-compartment model from the model library:
pd <- model_suite$pd$effect_cmt_model pd
Link the PD model to the PK model as follows:
pkpd <- pk %>% add(pd) pkpd <- pkpd %>% replace(Equation("PK_CONC", "A_CENTRAL/S2"))
Simulate the PK/PD model with a basic dataset:
library(campsis) dataset <- Dataset(25) %>% add(Bolus(time=0, amount=1000, compartment=1, ii=12, addl=2)) %>% add(Observations(times=0:36)) results <- pkpd %>% simulate(dataset=dataset, seed=1) gridExtra::grid.arrange(shadedPlot(results, "CONC"), shadedPlot(results, "EFFECT"), ncol=1)
Load the transit-compartment model from the model library:
pd <- model_suite$pd$transit_cmt_model pd
Link the PD model to the PK model as follows:
pkpd <- pk %>% add(pd) pkpd <- pkpd %>% replace(Equation("PK_CONC", "A_CENTRAL/S2"))
Simulate the PK/PD model with a basic dataset:
library(campsis) dataset <- Dataset(25) %>% add(Bolus(time=0, amount=1000, compartment=1, ii=12, addl=35)) %>% add(Observations(times=0:1000)) results <- pkpd %>% simulate(dataset=dataset, seed=1) gridExtra::grid.arrange(shadedPlot(results, "CONC"), shadedPlot(results, "A_CIRC"), ncol=1)
Load one of the 4 indirect-response model (IRM) present in the model library:
pd <- model_suite$pd$irm_kout_inhibition pd
Link the PD model to the PK model as follows:
pkpd <- pk %>% add(pd) pkpd <- pkpd %>% replace(Equation("PK_CONC", "A_CENTRAL/S2"))
Simulate the PK/PD model with a basic dataset:
library(campsis) dataset <- Dataset(25) %>% add(Bolus(time=0, amount=1000, compartment=1, ii=12, addl=35)) %>% add(Observations(times=0:1000)) results <- pkpd %>% simulate(dataset=dataset, seed=1) gridExtra::grid.arrange(shadedPlot(results, "CONC"), shadedPlot(results, "A_EFFECT"), ncol=1)
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.