Nothing
if (campsis::on_cran()) { cat( "This vignette was not built on CRAN. Please check out the online version [here](https://calvagone.github.io/campsis.doc/articles/v07_iov.html)." ) knitr::knit_exit() }
library(campsis)
This vignette shows how inter-occasion variability (IOV) can be added on a parameter at each administration.
Let's use a 2-compartment model with absorption compartment for this example.
model <- model_suite$nonmem$advan4_trans4
We're going to add a term IOV_KA on parameter KA. This can be done as follows:
model <- model %>% replace(Equation("KA", "THETA_KA*exp(ETA_KA + IOV_KA)"))
This model will not run unless we give some values for IOV_KA. This can achieved by adding IOV to the dataset.
The following code will create a simple dataset with IOV.
ds_iov <- Dataset(50) %>% add(Bolus(time = c(0, 24, 48), amount = 1000, compartment = 1)) %>% add(Observations(times = seq(0, 72, by = 0.5))) %>% add(IOV("IOV_KA", distribution = NormalDistribution(mean = 0, sd = 1)))
To disable IOV on KA, the replace method can be used:
ds_no_iov <- ds_iov %>% replace(IOV("IOV_KA", 0))
We can now run the model with IOV on KA and without.
results_iov <- simulate(model = model, dataset = ds_iov, seed = 1) results_no_iov <- simulate(model = model, dataset = ds_no_iov, seed = 1) gridExtra::grid.arrange( shaded_plot(results_iov, "CONC"), shaded_plot(results_no_iov, "CONC"), nrow = 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.