The R codes and the Mlxtran model files can be found here


In this example,

1. modeling of the modified warfarin PKPD data (the original continuous PD data has transformed into categorical data with levels {0, 1, 2}) is performed first with Monolix,

2. simulation of joint continuous and categorical data is then performed with simulx, using the parameters estimated by Monolix.

Define the project to be used for the simulations (relative paths)

project.file <- 'monolixRuns/pkcat_project.mlxtran'

Simulate a trial with N=20 individuals:

• the designs and the weights of these N patients are sampled from the original dataset with replacement
• individual parameters are sampled from the estimated population distribution.
N=100
out  <- list(name = c('conc','level'), time = c(0,2,4,6,seq(12, 180, by=12)))
p <- c(a_1=0, b_1=0)

res <- simulx(project=project.file,
group     = list(size = N),
output    = out)

Plot the simulated PK data and the distribution of the simulated categorical PD data

library(gridExtra)

plot1 <- ggplot(data=res$conc) + geom_point(aes(x=time, y=conc, colour=id)) + geom_line(aes(x=time, y=conc, colour=id)) + theme(legend.position="none") + ylab("concentration (mg/l)") plot2 <- catplotmlx(res$level)

grid.arrange(plot1, plot2, ncol=2)