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

Direct-effect model

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)

Effect-compartment model

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)

Transit-compartment model

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)

Indirect-response model

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)


Calvagone/campsis documentation built on April 17, 2024, 5:33 a.m.