Introduction

Using the lixoftConnectors library requires to initialize the connectors:

library(Rsmlx)
library(lixoftConnectors)
initializeLixoftConnectors(software="monolix")

In some non-standard installation cases of Monolix, it may be necessary to specify the path to the installation directory of the Lixoft suite. If no path is given, the one written in the lixoft.ini file is used (usually “C:/ProgramData/Lixoft/MonolixSuite2019R1” for Windows).

initializeLixoftConnectors(software = "monolix", mlxDirectory = "/path/to/MonolixSuite2019R1/")

getEstimatedIndividualParameters2

Get

Example:

We first load the warfarinPKPD project with the results already available

project <- "projects/warfarinPK1.mlxtran"
loadProject(project)

In this example, \(V\) depends on \({\rm wt}\) while \(Cl\) depends on \({\rm sex}\)

getIndividualParameterModel()$covariateModel
## $ka
##   sex   age  lw70    wt 
## FALSE FALSE FALSE FALSE 
## 
## $V
##   sex   age  lw70    wt 
## FALSE FALSE  TRUE FALSE 
## 
## $Cl
##   sex   age  lw70    wt 
## FALSE FALSE FALSE FALSE
p <- getEstimatedIndividualParameters2()
names(p)
## [1] "saem"            "conditionalMean" "conditionalSD"   "conditionalMode"
## [5] "popPopCov"       "popIndCov"
head(p$popPopCov,8)
##    id        ka        V        Cl
## 1 100 0.5594172 7.772386 0.1343697
## 2   1 0.5594172 7.772386 0.1343697
## 3   2 0.5594172 7.772386 0.1343697
## 4   3 0.5594172 7.772386 0.1343697
## 5   4 0.5594172 7.772386 0.1343697
## 6   5 0.5594172 7.772386 0.1343697
## 7   6 0.5594172 7.772386 0.1343697
## 8   7 0.5594172 7.772386 0.1343697
head(p$popIndCov,8)
##    id        ka        V        Cl
## 1 100 0.5691976 7.482658 0.1349938
## 2   1 0.7095464 7.476286 0.1349008
## 3   2 0.5684471 7.463233 0.1347260
## 4   3 0.6272887 8.772129 0.1348159
## 5   4 0.6449007 4.723045 0.1348280
## 6   5 0.7240235 8.322553 0.1349552
## 7   6 0.6356540 6.784286 0.1348601
## 8   7 0.5907157 9.739375 0.1347473
head(p$conditionalMode,8)
##    id        ka         V         Cl
## 1 100 0.2053403  7.382659 0.27474550
## 2   1 0.5494448  7.545219 0.11453703
## 3   2 0.4015868  7.719795 0.13139649
## 4   3 0.6455293  8.458496 0.11440732
## 5   4 0.7542916  4.870141 0.07659949
## 6   5 0.3653399 10.142430 0.18006483
## 7   6 0.8940491  6.115875 0.22535382
## 8   7 1.6231441  8.130109 0.17436857


getEstimatedPredictions

Get the individual predictions obtained with the estimated individual parameters

project <- "projects/warfarinPKPD.mlxtran"
loadProject(project)
r <- getEstimatedPredictions()
names(r)
## [1] "Cc"
head(r$Cc)
##    id time popPopCov popIndCov conditionalMean conditionalMode
## 1 100  0.5  3.125110  3.294518        1.304481        1.309254
## 2 100  1.0  5.460808  5.743453        2.458972        2.466621
## 3 100  2.0  8.488294  8.891441        4.376165        4.385256
## 4 100  3.0 10.126638 10.572286        5.854315        5.860918
## 5 100  6.0 11.505459 11.932067        8.417560        8.407200
## 6 100  9.0 11.276931 11.650951        9.255561        9.228687
head(r$E)
## NULL


getEstimatedResiduals

Get the residuals computed from the individual predictions obtained with the estimated individual parameters.

r <- getEstimatedResiduals()
names(r)
## [1] "y1"
head(r$y1)
##    popPopCov  popIndCov conditionalMean conditionalMode
## 1 -4.0443223 -4.1959265      -2.0418956      -2.0482427
## 2 -3.7702763 -3.9819327      -0.7723387      -0.7823004
## 3 -4.4457200 -4.6724940      -1.2445584      -1.2541024
## 4 -2.7391646 -3.0087331       0.7660833       0.7589204
## 5 -1.7319649 -1.9940951       0.5873834       0.5966913
## 6 -0.3476021 -0.6080139       1.2623709       1.2864144
head(r$y2)
## NULL


getSimulatedPredictions

Get the individual predictions obtained with the simulated individual parameters

r <- getSimulatedPredictions()
names(r)
## [1] "Cc"
head(r$Cc)
##   rep  id time       Cc
## 1   1 100  0.5 1.303916
## 2   1 100  1.0 2.464263
## 3   1 100  2.0 4.407532
## 4   1 100  3.0 5.924433
## 5   1 100  6.0 8.629438
## 6   1 100  9.0 9.594068
head(r$E)
## NULL


getSimulatedResiduals

Get the residuals computed from the individual predictions obtained with the simulated individual parameters.

r <- getSimulatedResiduals()
names(r)
## [1] "y1"
head(r$y1)
##   rep  id time   residual
## 1   1 100  0.5 -2.0411440
## 2   1 100  1.0 -0.7792311
## 3   1 100  2.0 -1.2774269
## 4   1 100  3.0  0.6903906
## 5   1 100  6.0  0.3996595
## 6   1 100  9.0  0.9660358
head(r$y2)
## NULL