Select Page

R functions to run Monolix

On the use of the R-functions

We now propose to use Monolix via R-functions. The package lixoftConnectors provides access to the project exactly in the same way as you would do with the interface. All the installation guidelines and initialization procedure can be found here. All the functions of lixoftConnectors are described below. To go beyond what the interface allows, the RsSimulx package provides additional functions for automatic PK model building, bootstrap simulation and likelihood profiling, among others.





List of the R functions

 

Description of the functions concerning the algorithm settings

Description of the functions concerning the bootstrap

Description of the functions concerning the convergence assessment

Description of the functions concerning the covariate model

Description of the functions concerning the dataset

Description of the functions concerning the individual model

Description of the functions concerning the initial values and estimation method

Description of the functions concerning the initialization and path to demo projects

Description of the functions concerning the model building tasks

  • getModelBuildingResults: Get the results of automatic covariate model building or automatic statistical model building.
  • getModelBuildingSettings: Get the current settings for running model building.
  • runModelBuilding: Run model building for automatic covariate model building or automatic statistical model building.

Description of the functions concerning the observation model

Description of the functions concerning the plots

Description of the functions concerning the project management

  • exportProject: Export the current project to another application of the MonolixSuite, and load the exported project.
  • getData: Get a description of the data used in the current project.
  • getInterpretedData: Get data after interpretation done by the software, as it is displayed in the Data tab in the interface.
  • getLibraryModelContent: Get the content of a library model.
  • getLibraryModelName: Get the name of a library model given a list of library filters.
  • getMapping: Get mapping between data and model.
  • getStructuralModel: Get the model file for the structural model used in the current project.
  • importProject: Import a Monolix or a PKanalix project into the currently running application initialized in the connectors.
  • isProjectLoaded: Get a logical saying if a project is currently loaded.
  • loadProject: Load a project in the currently running application initialized in the connectors.
  • newProject: Create a new project.
  • saveProject: Save the current project as a file that can be reloaded in the connectors or in the GUI.
  • setData: Set project data giving a data file and specifying headers and observations types.
  • setMapping: Set mapping between data and model.
  • setStructuralModel: Set the structural model.
  • shareProject: Create a zip archive file from current project and its results.

Description of the functions concerning the project settings and preferences

Description of the functions concerning the reporting

  • generateReport: Generate a project report with default options or from a custom Word template.

Description of the functions concerning the results

  • exportChartDataSet: Export the data of a chart into Lixoft suite compatible data set format.
  • getCorrelationOfEstimates: Get the inverse of the last estimated Fisher matrix computed either by all the Fisher methods used during the last scenario run or by the specific one passed in argument.
  • getEstimatedConfidenceIntervals: Get the confidence interval of population parameters computed either by all the Fisher methods used during the last scenario run or by the specific one passed in argument.
  • getEstimatedIndividualParameters: Get the last estimated values for each subject of the individual parameters present within the current project.
  • getEstimatedLogLikelihood: Get the values computed by using a log-likelihood algorithm during the last scenario run, with or without a method-based filter.
  • getEstimatedPopulationParameters: Get the last estimated value of some of the population parameters present within the current project (fixed effects + individual variances + correlations + latent probabilities + error model parameters).
  • getEstimatedRandomEffects: Get the random effects for each subject of the individual parameters present within the current project.
  • getEstimatedStandardErrors: Get the last estimated standard errors of population parameters computed either by all the Fisher methods used during the last scenario run or by the specific one passed in argument.
  • getEtaShrinkage: Get the shrinkage values for each individual parameter.
  • getLaunchedTasks: Get a list of the tasks which have available results.
  • getSAEMiterations: Retrieve the successive values of some of the population parameters present within the current project (fixed effects + individual variances + correlations + latent probabilities + error model parameters) during the previous run of the SAEM algorithm.
  • getSimulatedIndividualParameters: Get the simulated values for each replicate of each subject of some of the individual parameters present within the current project.
  • getSimulatedRandomEffects: Get the simulated values for each replicate of each subject of some of the individual random effects present within the current project.
  • getTests: Get the results of performed statistical tests.

Description of the functions concerning the scenario


[Monolix] Get conditional distribution sampling settings

Description

Get the conditional distribution sampling settings for the current project.
Associated settings are:

ratio (0 < double < 1) Width of the relative interval for stopping criteria (i.e. 0.05 for 5%).
enableMaxIterations (logical) Enable maximum number of iterations if stopping criteria not met.
nbMinIterations (integer >= 1) Number of iterations to use for evaluating stopping criteria.
nbMaxIterations (integer >= 1) Maximum number of iterations if enableMaxIterations is TRUE.
nbSimulatedParameters (integer >= 1) Number of samples from the conditional distribution to retain per individual for plots.

Usage

getConditionalDistributionSamplingSettings(...)

Arguments

... [optional] (character) Name of the settings whose value should be returned. If no argument is provided, all the settings are returned.

Value

A list with each setting name mapped to its current value.

See Also

setConditionalDistributionSamplingSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

# retrieve all the conditional distribution sampling settings

getConditionalDistributionSamplingSettings() 

# retrieve only certain settings 

getConditionalDistributionSamplingSettings("ratio", "nbMinIterations") 


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get conditional mode estimation settings

Description

Get the conditional mode (EBEs) estimation settings for the current project.
Associated settings are:

nbOptimizationIterationsMode (integer >= 1) Maximum number of iterations.
optimizationToleranceMode (double > 0) Optimization tolerance.

Usage

getConditionalModeEstimationSettings(...)

Arguments

... [optional] (character) Name of the settings whose value should be returned. If no argument is provided, all the settings are returned.

Value

A list with each setting name mapped to its current value.

See Also

setConditionalModeEstimationSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

# retrieve a list of all the conditional mode estimation settings

getConditionalModeEstimationSettings() 

# retrieve only the one setting value

getConditionalModeEstimationSettings("nbOptimizationIterationsMode") 


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get project general settings for chains

Description

Get a summary of the settings related to chains for Monolix algorithms for the current project.
Associated settings are:

autoChains (logical) Automatically adjust the number of chains to have at least a minimum number of subjects.
nbChains (integer > 0) Number of chains to be used if autoChains is set to FALSE.
minIndivForChains (integer > 0) Minimum number of individuals.

Usage

getGeneralSettings(...)

Arguments

... [optional] (character) Name of the settings whose value should be returned. If no argument is provided, all the settings are returned.

Value

A list with each setting name mapped to its current value.

See Also

setGeneralSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

# retrieve a list of all chain settings

getGeneralSettings() 

# retrieve only specified settings

getGeneralSettings("nbChains", "autoChains") 


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get Log-likelihood algorithm settings

Description

Get the log-likelihood estimation settings of the current project. Associated settings are:

nbFixedIterations (integer > 0) Monte Carlo size for importance sampling.
samplingMethod (character) Should the log-likelihood estimation use a given number of
degrees of freedom ("fixed") or test a sequence of degrees of freedom numbers before choosing the
best one ("optimized").
nbFreedomDegrees (integer > 0) Degree of freedom of the Student’s t-distribution.
Used only if "samplingMethod" is "fixed".
freedomDegreesSampling (vector<integer > 0>) Sequence of degrees of freedom
of the Student’s t-distribution to be tested. Used only if "samplingMethod" is "optimized".

Usage

getLogLikelihoodEstimationSettings(...)

Arguments

... [optional] (character) Name of the settings whose value should be returned. If no argument is provided, all the settings are returned.

Value

A list with each setting name mapped to its current value.

See Also

setLogLikelihoodEstimationSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

# retrieve a list of all the loglikelihood estimation settings

getLogLikelihoodEstimationSettings() 

# retrieve only certain settings values

getLogLikelihoodEstimationSettings("nbFixedIterations", "samplingMethod") 


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get settings for transition kernels of the MCMC algorithm

Description

Get the MCMC algorithm settings of the current project.
Associated settings are:

strategy (vector<integer> of length 3) Number of calls for each one of the three MCMC kernels.
acceptanceRatio (double) Target acceptance ratio.

Usage

getMCMCSettings(...)

Arguments

... [optional] (character) Names of the settings whose value should be returned. If no argument is provided, all the settings are returned.

Value

A list with each setting name mapped to its current value.

See Also

setMCMCSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

getMCMCSettings() # retrieve a list of all the MCMC settings

getMCMCSettings("strategy") # retrieve only the strategy setting


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get population parameter estimation settings

Description

Get the population parameter estimation settings for the current project.
Associated settings are:

nbBurningIterations (integer >= 0) Number of iterations for the burn-in phase.
nbExploratoryIterations (integer >= 0) If exploratoryAutoStop is set to FALSE,
the number of iterations in the exploratory phase. Otherwise, if exploratoryAutoStop is set to TRUE,
the maximum number of iterations in the exploratory phase.
exploratoryAutoStop (logical) Should the exploratory phase stop automatically
exploratoryInterval (integer > 0) Minimum number of iterations in the exploratory phase.
Used only if exploratoryAutoStop is TRUE.
exploratoryAlpha (0 <= double <= 1) Convergence memory in the exploratory phase.
Used only if exploratoryAutoStop is TRUE.
nbSmoothingIterations (integer >= 0) If smoothingAutoStop is set to FALSE,
the number of iterations in the smoothing phase. Otherwise, if smoothingAutoStop is set to TRUE,
the maximum number of iterations in the smoothing phase.
smoothingAutoStop (logical) Should the smoothing phase stop automatically.
smoothingInterval (integer > 0) Minimum number of iteration in the smoothing phase.
Used only if smoothingAutoStop is TRUE.
smoothingAlpha (0.5 < double <= 1) Convergence memory in the smoothing phase.
Used only if smoothingAutoStop is TRUE.
smoothingRatio (0 < double < 1) Width of the confidence interval for smoothing.
Used only if smoothingAutoStop is TRUE.
simulatedAnnealing (logical) Should simulated annealing be used.
tauOmega (double > 0) Proportional rate on variance.
Used only if simulatedAnnealing is TRUE.
tauErrorModel (double > 0) Proportional rate on error model.
Used only if simulatedAnnealing is TRUE.
variability (character) Estimation method for parameters without variability:
"firstStage", "decreasing", or "none".
Used only if there are parameters without variability in the project.
nbOptimizationIterations (integer >= 1) Number of optimization iterations.
optimizationTolerance (double > 0) Tolerance for optimization.

Usage

getPopulationParameterEstimationSettings(...)

Arguments

... [optional] (character) Name of the settings whose value should be returned. If no argument is provided, all the settings are returned.

Value

A list with each setting name mapped to its current value.

See Also

setPopulationParameterEstimationSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

# retrieve a list of all the population parameter estimation settings

getPopulationParameterEstimationSettings() 

# retrieve only the setting related to the smoothing phase

getPopulationParameterEstimationSettings("nbSmoothingIterations", "smoothingAutoStop", "smoothingAlpha", "smoothingRatio")


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get standard error estimation settings

Description

Get the standard error estimation settings for the current project.
Associated settings are:

minIterations (integer >= 1) Minimum number of iterations for stochastic approximation.
maxIterations (integer >= 1) Maximum number of iterations for stochastic approximation.
intervalLevel (0 < double < 100) Confidence interval level (percent).

Usage

getStandardErrorEstimationSettings(...)

Arguments

... [optional] (character) Name of the settings whose value should be returned. If no argument is provided, all the settings are returned.

Value

A list with each setting name mapped to its current value.

See Also

setStandardErrorEstimationSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

# retrieve a list of all the standard error estimation settings

getStandardErrorEstimationSettings() 

# retrieve only certain settings

getStandardErrorEstimationSettings("minIterations","maxIterations") 


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set conditional distribution sampling settings

Description

Set the value of one or more of the conditional distribution sampling settings for the current project.
Associated settings are:

ratio (0 < double < 1) Width of the relative interval for stopping criteria (i.e. 0.05 for 5%).
enableMaxIterations (logical) Enable maximum number of iterations if stopping criteria not met.
nbMinIterations (integer >= 1) Number of iterations to use for evaluating stopping criteria.
nbMaxIterations (integer >= 1) Maximum number of iterations if enableMaxIterations is TRUE.
nbSimulatedParameters (integer >= 1) Number of samples from the conditional distribution to retain per individual for plots.

Usage

setConditionalDistributionSamplingSettings(...)

Arguments

... A collection of comma-separated pairs (settingName = settingValue).

See Also

getConditionalDistributionSamplingSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

setConditionalDistributionSamplingSettings(ratio = 0.1, nbSimulatedParameters = 20)

getConditionalDistributionSamplingSettings()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set conditional mode estimation settings

Description

Set the value of one or more of the conditional mode (EBEs) estimation settings for the current project.
Associated settings are:

nbOptimizationIterationsMode (integer >= 1) Maximum number of iterations.
optimizationToleranceMode (double > 0) Optimization tolerance.

Usage

setConditionalModeEstimationSettings(...)

Arguments

... A collection of comma-separated pairs (settingName = settingValue).

See Also

getConditionalModeEstimationSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

setConditionalModeEstimationSettings(nbOptimizationIterationsMode = 100, 

                                     optimizationToleranceMode = 0.001)

getConditionalModeEstimationSettings()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set project general settings for chains

Description

Set the value of one or more of the settings related to chains for Monolix algorithms for the current project.
Associated settings are:

autoChains (logical) Automatically adjust the number of chains to have at least a minimum number of subjects.
nbChains (integer > 0) Number of chains to be used if autoChains is set to FALSE.
minIndivForChains (integer > 0) Minimum number of individuals.

Usage

setGeneralSettings(...)

Arguments

... Comma-separated pairs (settingName = settingValue).

See Also

getGeneralSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

setGeneralSettings(autoChains = FALSE, nbchains = 10)

getGeneralSettings()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set log-likelihood estimation settings

Description

Set the value of the log-likelihood estimation settings for the current project.
Associated settings are:

nbFixedIterations (integer > 0) Monte Carlo size for importance sampling.
samplingMethod (character) Should the log-likelihood estimation use a given number of
degrees of freedom ("fixed") or test a sequence of degrees of freedom numbers before choosing the
best one ("optimized").
nbFreedomDegrees (integer > 0) Degree of freedom of the Student’s t-distribution.
Used only if "samplingMethod" is "fixed".
freedomDegreesSampling (vector<integer > 0>) Sequence of degrees of freedom
of the Student’s t-distribution to be tested. Used only if "samplingMethod" is "optimized".

Usage

setLogLikelihoodEstimationSettings(...)

Arguments

... A collection of comma-separated pairs (settingName = settingValue).

See Also

getLogLikelihoodEstimationSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

setLogLikelihoodEstimationSettings(nbFixedIterations = 20000)

getLogLikelihoodEstimationSettings()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set settings for transition kernels of the MCMC algorithm

Description

Set the value of one or more of the MCMC algorithm settings related to transition kernels of the current project.
Associated settings are:

strategy (vector<integer> of length 3) Number of calls for each of the three MCMC kernels.
acceptanceRatio (double) Target acceptance ratio.

Usage

setMCMCSettings(...)

Arguments

... A collection of comma-separated pairs (settingName = settingValue)

See Also

getMCMCSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

setMCMCSettings(strategy = c(2,1,2))

getMCMCSettings()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set population parameter estimation settings

Description

Set the value of one or more of the population parameter estimation settings for the current project.
Associated settings are:

nbBurningIterations (integer >= 0) Number of iterations for the burn-in phase.
nbExploratoryIterations (integer >= 0) If exploratoryAutoStop is set to FALSE,
the number of iterations in the exploratory phase. Otherwise, if exploratoryAutoStop is set to TRUE,
the maximum number of iterations in the exploratory phase.
exploratoryAutoStop (logical) Should the exploratory phase stop automatically
exploratoryInterval (integer > 0) Minimum number of iterations in the exploratory phase.
Used only if exploratoryAutoStop is TRUE.
exploratoryAlpha (0 <= double <= 1) Convergence memory in the exploratory phase.
Used only if exploratoryAutoStop is TRUE.
nbSmoothingIterations (integer >= 0) If smoothingAutoStop is set to FALSE,
the number of iterations in the smoothing phase. Otherwise, if smoothingAutoStop is set to TRUE,
the maximum number of iterations in the smoothing phase.
smoothingAutoStop (logical) Should the smoothing phase stop automatically.
smoothingInterval (integer > 0) Minimum number of iteration in the smoothing phase.
Used only if smoothingAutoStop is TRUE.
smoothingAlpha (0.5 < double <= 1) Convergence memory in the smoothing phase.
Used only if smoothingAutoStop is TRUE.
smoothingRatio (0 < double < 1) Width of the confidence interval for smoothing.
Used only if smoothingAutoStop is TRUE.
simulatedAnnealing (logical) Should simulated annealing be used.
tauOmega (double > 0) Proportional rate on variance.
Used only if simulatedAnnealing is TRUE.
tauErrorModel (double > 0) Proportional rate on error model.
Used only if simulatedAnnealing is TRUE.
variability (character) Estimation method for parameters without variability:
"firstStage", "decreasing", or "none".
Used only if there are parameters without variability in the project.
nbOptimizationIterations (integer >= 1) Number of optimization iterations.
optimizationTolerance (double > 0) Tolerance for optimization.

Usage

setPopulationParameterEstimationSettings(...)

Arguments

... A collection of comma-separated pairs (settingName = SettingValue).

See Also

getPopulationParameterEstimationSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

setPopulationParameterEstimationSettings(exploratoryAutoStop = TRUE, nbexploratoryiterations = 200)

getPopulationParameterEstimationSettings()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set standard error estimation settings

Description

Set the value of one or more of the standard error estimation settings for the current project.
Associated settings are:

minIterations (integer >= 1) Minimum number of iterations for stochastic approximation.
maxIterations (integer >= 1) Maximum number of iterations for stochastic approximation.
intervalLevel (0 < double < 100) Confidence interval level (percent).

Usage

setStandardErrorEstimationSettings(...)

Arguments

... A collection of comma-separated pairs (settingName = settingValue).

See Also

getStandardErrorEstimationSettings

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

setStandardErrorEstimationSettings(minIterations = 20, maxIterations = 500, intervalLevel = 99)

getStandardErrorEstimationSettings()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get the results of boostrap

Description

Get the results of boostrap.

Usage

getBootstrapResults(removeFailedRuns = FALSE)

Arguments

removeFailedRuns [logical] if TRUE, bootstrap runs with failed convergence (maximum number of iterations reached before triggering of the autostop criterion) are removed from the results (default=FALSE). If all bootstrap runs have a failed convergence, the result is NULL.

Value

The results of boostrap as a list of dataframes:

  • populationEstimates: the population parameters estimated in all bootstrap runs
  • populationSummary: the summary table of population parameter estimates
  • logLikelihoodEstimates: if logLikelihood=TRUE in the bootstrap settings, the log-likelihood (OFV) and information criteria estimated in all bootstrap runs
  • logLikelihoodSummary: if logLikelihood=TRUE in the bootstrap settings, the summary table of the OFV and information criteria
  • standardErrorsEstimates: if standardErrors=TRUE in the bootstrap settings, the relative standard errors of population parameters estimated in all bootstrap runs
  • standardErrorsSummary: if standardErrors=TRUE in the bootstrap settings, the summary table of relative standard errors

See Also

runBootstrap

Click here to see examples

#

# get bootstrap results using all runs

getBootstrapResults()

# get bootstrap results using only runs that converged (during the population parameter estimation, the autostop criterion was triggered before reaching the maximum number of iterations)

getBootstrapResults(removeFailedRuns=TRUE)

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get bootstrap settings

Description

Get the settings that will be used during the run of bootstrap.

Usage

getBootstrapSettings()

Value

The list of settings

  • nbRuns [optional] (integer) number of bootstrap replicates (default=200)
  • method [optional] (character) sampling method: “parametric” or “nonparametric” (default: nonparametric)
  • initialValues [optional] (character) initial values used in the boostrap runs for the estimation of the population parameters: “initial” or “final (default: “initial”)
  • cens [optional] (list) if method=”nonparametric” and there are censored observations in the dataset. A list, or a list of lists with elements obsid, type (“left,”right” or “interval”) and limit (single value or vector of two values). Ex: list(list(obsid=”y1″,type=”left”, limit=0.1), list(obsid=”y2″, type=”interval”, limit=c(0.2,10))
  • tasks [optional] (list of character) tasks to perform in bootstrap runs in addition to population parameter estimation. Available tasks: “standardErrorEstimation”, “logLikelihoodEstimation” (default=list())
  • useLin [optional] (logical) calculation method to estimate standard errors and log-likelihood (default = FALSE). If TRUE, they are estimated via linearization. If FALSE, standard errors are estimated via stochastic approximation and log-likelihood via importance sampling.
  • sampleSize [optional] (integer) the number of individuals in each bootstrap data set (default value is the number of individuals in the original data set).
  • covStrat [optional] (list of character) one or several categorical covariates of the project. The original distribution of this covariate is maintained in each resampled data set if covStrat is defined (default=list()). Notice that if the categorical covariate is varying within the subject (in case of occasions), it will not be taken into account.
  • level [optional] (numeric) level of the bootstrap confidence intervals (default = 0.95)
  • saveResultsFolders [optional] (logical) to choose if bootstrap projects results folders should be saved or deleted (default = FALSE)
  • saveDatasets [optional] (logical) to choose if bootstrap datasets and mlxtran files (Monolix project) should be saved or deleted (default = FALSE)
  • replaceFailedRuns [optional] (logical) to choose if bootstrap runs with failed convergence (maximum number of iterations reached before the autostop criterion) should be replaced by new runs (default=FALSE)
  • maxNbFailedRuns [optional] (integer) if replaceFailedRuns=TRUE, maximum number of runs with failed convergence that can be replaced before bootstrap is stopped (default=20)

See Also

runBootstrap

Click here to see examples

#

# run parametric bootstrap with 100 runs

set = getBootstrapSettings()

set$nbRuns = 100

set$method = "parametric"

runBootstrap(set)

# run nonparametric bootstrap with 500 runs, stratified resampling by STUDY and DOSEGROUP categorical covariates, standard errors and log-likelihood estimated via linearization, and bootstrap datasets and mlxtran files saved in the results.

runBootstrap(nbRuns=500, method="nonparametric", covStrat=list("STUDY", "DOSEGROUP"), tasks=list("standardErrorEstimation", "logLikelihoodEstimation"), useLin=FALSE, saveDatasets=TRUE)

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Run boostrap

Description

Run boostrap.
If no argument is given, it uses the previously used settings if bootstrap has already run in the project, or the default settings otherwise.
In both cases, use getBootstrapSettings to receive all the settings.

Usage

runBootstrap(...)

Arguments

... (list<settings>) Settings to initialize the bootstrap algorithm, given either as a list of settings, or as direct arguments. See getBootstrapSettings.

See Also

getBootstrapSettings getBootstrapResults

Click here to see examples

#

# run bootstrap with default settings

runBootstrap()

# run non-parametric bootstrap with 1000 runs that include the estimation of standard errors and likelihood via linearization, with resampled datasets containing 20 individuals stratified by "group" covariate. Each bootstrap run is saved with its dataset and results folder.

runBootstrap(nbRuns = 1000, tasks= list("standardErrorEstimation", "logLikelihoodEstimation"), useLin = TRUE, sampleSize = 20, covStrat = "group", level = 90, saveResultsFolders = T, saveDatasets = T)

# run parametric bootstrap with 100 runs

set = getBootstrapSettings()

set$nbRuns = 100

set$method = "parametric"

runbootstrap(settings = set)

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get the results of the convergence assessment

Description

Get the results of the convergence assessment. The populationParameters are always included and standardErrors and logLikelihood
are included when extendedEstimation is TRUE in the assessment settings.

Usage

getAssessmentResults()

Value

A vector of lists containing, for each assessment run:

  • populationParameters: results of population parameter estimation using SAEM:
    • nbexploratoryiterations (integer) number of iterations during exploratory phase
    • nbsmoothingiterations (integer) number of iterations during smoothing phase
    • convergence (data.frame) convergence history of estimated population parameters and convergence indicator (-2*log-likelihood)
  • standardErrors: [optional] results of standard errors estimation:
    • method (character) fisher method used (stochasticApproximation or linearization)
    • values (vector) standard error associated to each population parameter
  • loglikelihood: [optional] results of log-likelihood estimation
    • method (character) fisher method used (importanceSampling or linearization)
    • AIC (double) Akaike Information Criterion
    • BIC (double) Bayesian Information Criterion
    • BICc (double) modified BIC
    • LL (double) log likelihood
    • chosenDegree (integer) [importanceSampling]
    • standardError (double) [importanceSampling]
    • convergence (data.frame) [importanceSampling]

See Also

runAssessment to run the assessment

Click here to see examples

#

initializeLixoftConnectors("monolix")

project_file <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran")

loadProject(project_file)

assesSettings <- getAssessmentSettings()

assesSettings$initialParameters$fixed <- rep(FALSE, 3)

assesSettings$initialParameters$min <- rep(0, 3)

assesSettings$initialParameters$max <- c(1.5, 1, 0.5)

assesSettings$extendedEstimation <- TRUE

runAssessment(settings = assesSettings) 

res = getAssessmentResults()

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get convergence assessment settings

Description

Get the current settings for running the convergence assessment. These are the settings that will be used if runAssessment
is called without argument, or they can be used as a template to update and pass to runAssessment in order to change the settings.
Note that ‘fixed’ in the initialParameters data.frame refers to whether the the initial value of the parameter is fixed for the assessment or
whether it should be sampled for each run, not whether the parameter is fixed for estimation purposes.

Usage

getAssessmentSettings()

Value

The list of settings

  • nbRuns: (integer) number of runs
  • extendedEstimation: (logical) if TRUE, standard errors and log-likelihood are estimated
  • useLin: (logical) if TRUE, use linearization to estimate standard errors and log-likelihood instead of stochastic approximation (sd) and importance sampling (ll)
  • initialParameters: (data.frame) a data.frame with columns parameters (name of each parameter), fixed (logical TRUE if its initial value is fixed or else FALSE),
    min, and max (the bounds within which the initial value is drawn for non-fixed parameters)

See Also

runAssessment to run the assesment

Click here to see examples

#

project_file <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran")

loadProject(project_file)

getAssessmentSettings()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Run convergence assessment

Description

Run assessment.
To change the initialization before a run, use getAssessmentSettings to receive all the settings. See example.

Usage

runAssessment(settings = NULL)

Arguments

settings (list<settings>) [optional] Settings to initialize the assessment algorithm. If not provided, current settings are used. See getAssessmentSettings.

See Also

getAssessmentSettings to get the settings
getAssessmentResults to get the results of the run

Click here to see examples

#

initializeLixoftConnectors("monolix")

project_file <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran")

loadProject(project_file)

assesSettings <- getAssessmentSettings()

assesSettings$initialParameters$fixed <- rep(FALSE, 3)

assesSettings$initialParameters$min <- rep(0, 3)

assesSettings$initialParameters$max <- c(1.5, 1, 0.5)

runAssessment(settings = assesSettings) 

res = getAssessmentResults()

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Add transformed categorical covariate

Description

Create a new categorical covariate by transforming an existing one. Transformed covariates cannot be use to produce new covariates.
Call getCovariateInformation to find out which covariates can be transformed.Those of type "categorical" can be used.

Usage

addCategoricalTransformedCovariate(...)

Arguments

... Comma-separated pairs of the format (see example)
transformedCovariateName = list(from = "existingCovariateName",
reference = "transformedCovariateReferenceValue",
transformed = list(newvalue1 = c("oldvalue1", "oldvalue2"), newvalue2 = c("oldvalue3", "oldvalue4")))

See Also

getCovariateInformation get current covariates in the model
addContinuousTransformedCovariate to add a transformation of a continuous covariate
addMixture to add a latent covariate
removeCovariate to remove added covariates

Click here to see examples

#

project_file <- file.path(getDemoPath(), "0.data_formatting", "DoseAndLOQ_byCategory.mlxtran")

loadProject(project_file)

addCategoricalTransformedCovariate( AGG_STUDY = list(from = "STUDY", 

                                                     reference = "SD_low", 

                                                     transformed = list( SD_low = c("SD_400mg", "SD_500mg"), SD_high = c("SD_600mg"))) ) 

getCovariateInformation()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Add transformed continuous covariate

Description

Create a new continuous covariate by transforming an existing one. Transformed covariates cannot be use to produce new covariates.
Call getCovariateInformation to find out which covariates can be transformed. Those of type "continuous" can be used.

Usage

addContinuousTransformedCovariate(...)

Arguments

... Comma-separated pairs {transformedCovariateName = (character)”formula”}

See Also

getCovariateInformation get current covariates in the model
addCategoricalTransformedCovariate to add a transformation of a categorical covariate
addMixture to add a latent covariate
removeCovariate remove added covariates

Click here to see examples

#

project_file <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran")

loadProject(project_file)

addContinuousTransformedCovariate( logtWEIGHT = "log(WEIGHT/70)"  )

getCovariateInformation()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Add latent covariate to the model for a finite mixture model

Description

Add a new latent covariate to the current model giving its name and its modality number (how many subpopulations).

Usage

addMixture(...)

Arguments

... A list of comma-separated pairs latentCovariateName = modalityNumber, where modalityNumber is an integer

See Also

getCovariateInformation get current covariates in the model
addContinuousTransformedCovariate to add a transformation of a continuous covariate
addCategoricalTransformedCovariate to add a transformation of a categorical covariate
removeCovariate to remove added covariates

Click here to see examples

#

project_file <- file.path(getDemoPath(), "5.models_for_individual_parameters", "5.3.mixture_of_distributions", "PKgroup_project.mlxtran")

loadProject(project_file)

addMixture(lcat = 2)

getCovariateInformation()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Remove covariate

Description

Remove any of the transformed covariates (discrete and continuous) and/or latent covariates.
Call getCovariateInformation to know which covariates can be removed (only those with type “categoricaltransformed”,
“continuoustransformed” or “latent”).

Usage

removeCovariate(...)

Arguments

... Covariate names (comma separated).

See Also

getCovariateInformation get current covariates in the model
addContinuousTransformedCovariate to add a transformation of a continuous covariate
addCategoricalTransformedCovariate to add a transformation of a categorical covariate
addMixture to add a latent covariate

Click here to see examples

#

project_file <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran")

loadProject(project_file)

addContinuousTransformedCovariate( logtWEIGHT = "log(WEIGHT/70)"  )

getCovariateInformation()

removeCovariate("logtWEIGHT")

getCovariateInformation()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Add an additional covariate

Description

Create an additional covariate for stratification purpose. Notice that these covariates are available only if they are not
contant through the dataset.
Available column transformations are:

[continuous] ‘firstDoseAmount’ (first dose amount)
[continuous] ‘doseNumber’ (dose number)
[discrete] ‘administrationType’ (admninistration type)
[discrete] ‘administrationSequence’ (administration sequence)
[discrete] ‘dosingDesign’ (dose multiplicity)
[continuous] ‘observationNumber’ (observation number per individual, for a given observation type)

Usage

addAdditionalCovariate(transformation, base = "", name = "")

Arguments

transformation (character) applied transformation.
base (character) [optional] base data on which the transformation is applied.
name (character) [optional] name of the covariate.

See Also

deleteAdditionalCovariate

Click here to see examples

#

addAdditionalCovariate("firstDoseAmount")

addAdditionalCovariate(transformation = "observationNumberPerIndividual", headerName = "CONC")

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Apply filter

Description

Apply a filter on the current data.

Usage

applyFilter(filter, name = "")

Arguments

filter (list< list< action = “headerName-comparator-value” > > or “complement”) filter definition.
Existing actions are “selectLines”, “selectIds”, “removeLines” and “removeIds”. First vector level is for set unions, the second one for set intersection.
It is possible to give only a list of actions if there is only no high-level union.
name (character) [optional] created data set name. If not defined, the default name is “currentDataSet_filtered”.

Details

The possible actions are line selection (selectLines), line removal (removeLines), Ids selection (selectIds) or removal (removeIds).
The selection is a string containing the header name, a comparison operator and a value
selection = <character> “headerName*-comparator**-value” (ex: “id==’100′”, “WEIGHT<70”, “SEX!=’M'”)
Notice that :
– The headerName corresponds to the data set header or one of the header aliases defined in MONOLIX software preferences
– The comparator possibilities are “==”, “!=” for all types of value and “<=”, “<“, “>=”, “>” only for numerical types

Syntax:
* apply a simple filter:
applyFilter( filter = list(act = sel)), e.g. applyFilter( filter = list(removeIds = “WEIGHT<50”))
=> apply a filter with the action act on the selection sel. In this example, we apply a filter that removes all subjects with a weight less than 50.
* apply a filter with several concurrent conditions, i.e AND condition:
applyFilter( list(act1 = sel1, act2 = sel2)), e.g. applyFilter( filter = list(removeIds = “WEIGHT<50″, removeIds = ” AGE<20″))
=> apply a filter with both the action act1 on sel1 AND the action act2 on sel2. In this example, we apply a filter that removes all subjects with a weight less than 50 and an age less than 20.
It corresponds to the intersecton of the subjects with a weight less than 50 and the subjects with an age less than 20.
* apply a filter with several non-concurrent conditions, i.e OR condition:
applyFilter(filter = list(list(act1 = sel1), list(act2 = sel2)) ), e.g. applyFilter( filter = list(list(removeIds = “WEIGHT<50″),list(removeIds = ” AGE<20″)))
=> apply a filter with the action act1 on sel1 OR the action act2 on sel2. In this example, we apply a filter that removes all subjects with a weight less than 50 and an age less than 20.
It corresponds to the union of the subjects with a weight less than 50 and the subjects with an age less than 20.
* It is possible to have any combination:
applyFilter(filter = list(list(act1 = sel1), list(act2 = sel2, act3 = sel3)) ) <=> act1,sel1 OR ( act2,sel2 AND act3,sel3 )
* It is possible to apply the complement of an existing filter:
applyFilter(filter = “complement”)

See Also

getAvailableData createFilter removeFilter

Click here to see examples

#

----------------------------------------------------------------------------------------

LINE [ integer ]

applyFilter( filter = list(removeLines = "line>10") ) # keep only the 10th first rows

----------------------------------------------------------------------------------------

ID [ character | integer ]

If there are only integer identifiers within the data set, ids will be considered as integers. On the contrary, they will be treated as character data.

applyFilter( filter = list(selectIds = "id==100") ) # select the subject called '100'

applyFilter( filter = list(list(removeIds = "id!='id_2'")) ) # select all the subjects excepted the one called 'id_2'

----------------------------------------------------------------------------------------

ID INDEX [integer]

applyFilter( filter = list(list(removeIds = "idIndex!=2"), list(selectIds = "id<5")) ) # select the 4 first subjects excepted the second one

----------------------------------------------------------------------------------------

OCC [ integer ]

applyFilter( filter = list(selectIds = "occ1==1", removeIds = "occ2!=3") ) # select the subjects whose first occasion level is '1' and whose second one is different from '3'

----------------------------------------------------------------------------------------

TIME [ double ]

applyFilter( filter = list(removeIds='TIME>120') ) # remove the subjects who have time over 120

applyFilter( filter = list(selectLines='TIME>120') ) # remove the all the lines where the time is over 120

----------------------------------------------------------------------------------------

OBSERVATION [ double ]

applyFilter( filter = list(selectLines = "CONC>=5.5", removeLines = "CONC>10")) # select the lines where CONC value superior or equal to 5.5 or strictly higher than 10

applyFilter( filter = list(removeIds = "CONC<0") ) # remove subjects who have negative CONC values

applyFilter( filter = list(removeIds = "E==0") ) # remove subjects for who E equals 0

----------------------------------------------------------------------------------------

OBSID [ character ]

applyFilter( filter = list(removeIds = "y1==1") ) # remove subject who have at least one observation for y1

applyFilter( filter = list(selectLines = "y1!=2") ) # select all lines corresponding to observations exepected those for y2

----------------------------------------------------------------------------------------

AMOUNT [ double ]

applyFilter( filter = list(selectIds = "AMOUT==10") ) # select subjects who have a dose equals to 10

----------------------------------------------------------------------------------------

INFUSION RATE AND INFUSION DURATION [ double ]

applyFilter( filter = list(selectIds = "RATE<10") ) # select subjects who have dose with a rate less than 10

----------------------------------------------------------------------------------------

COVARIATE [ character (categorical) | double (continuous) ]

applyFilter( filter = list(selectIds = "SEX==M", selectIds = "WEIGHT<80") ) # select subjects who are men and whose weight is lower than 80kg

----------------------------------------------------------------------------------------

REGERSSOR [ double ]

applyFilter( filter = list(selectLines = "REG>10") ) # select the lines where the regressor value is over 10

----------------------------------------------------------------------------------------

COMPLEMENT

applyFilter(origin = "data_filtered", filter = "complement" )

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Create filter

Description

Create a new filtered data set by applying a filter on an existing one and/or complementing it.

Usage

createFilter(filter, name = "", origin = "")

Arguments

filter (list< list< action = “headerName-comparator-value” > > or “complement”) [optional] filter definition.
Existing actions are “selectLines”, “selectIds”, “removeLines” and “removeIds”. First vector level is for set unions, the second one for set intersection.
It is possible to give only a list of actions if there is only no high-level union.
name (character) [optional] created data set name. If not defined, the default name is “currentDataSet_filtered”.
origin (character) [optional] name of the data set to be filtered. The current one is used by default.

Details

The possible actions are line selection (selectLines), line removal (removeLines), Ids selection (selectIds) or removal (removeIds).
The selection is a string containing the header name, a comparison operator and a value
selection = <character> “headerName*-comparator**-value” (ex: "id=='100'", "WEIGHT<70", "SEX!='M'")
Notice that :
– The headerName corresponds to the data set header or one of the header aliases defined in MONOLIX software preferences
– The comparator possibilities are “==”, “!=” for all types of value and “<=”, “<“, “>=”, “>” only for numerical types

Syntax:
* create a simple filter:
createFilter( filter = list(act = sel)), e.g. createFilter( filter = list(removeIds = “WEIGHT<50”))
=> create a filter with the action act on the selection sel. In this example, we create a filter that removes all subjects with a weight less than 50.
* create a filter with several concurrent conditions, i.e AND condition:
createFilter( list(act1 = sel1, act2 = sel2)), e.g. createFilter( filter = list(removeIds = “WEIGHT<50″, removeIds = ” AGE<20″))
=> create a filter with both the action act1 on sel1 AND the action act2 on sel2. In this example, we create a filter that removes all subjects with a weight less than 50 and an age less than 20.
It corresponds to the intersecton of the subjects with a weight less than 50 and the subjects with an age less than 20.
* create a filter with several non-concurrent conditions, i.e OR condition:
createFilter(filter = list(list(act1 = sel1), list(act2 = sel2)) ), e.g. createFilter( filter = list(list(removeIds = “WEIGHT<50″),list(removeIds = ” AGE<20″)))
=> create a filter with the action act1 on sel1 OR the action act2 on sel2. In this example, we create a filter that removes all subjects with a weight less than 50 and an age less than 20.
It corresponds to the union of the subjects with a weight less than 50 and the subjects with an age less than 20.
* It is possible to have any combinaison:
createFilter(filter = list(list(act1 = sel1), list(act2 = sel2, act3 = sel3)) ) <=> act1,sel1 OR ( act2,sel2 AND act3,sel3 )
* It is possible to create the complement of an existing filter:
createFilter(filter = “complement”)

See Also

applyFilter

Click here to see examples

#

----------------------------------------------------------------------------------------

LINE [ integer ]

createFilter( filter = list(removeLines = "line>10") ) # keep only the 10th first rows

----------------------------------------------------------------------------------------

ID [ character | integer ]

If there are only integer identifiers within the data set, ids will be considered as integers. On the contrary, they will be treated as character data.

createFilter( filter = list(selectIds = "id==100") ) # select the subject called '100'

createFilter( filter = list(list(removeIds = "id!='id_2'")) ) # select all the subjects excepted the one called 'id_2'

----------------------------------------------------------------------------------------

ID INDEX [integer]

createFilter( filter = list(list(removeIds = "idIndex!=2"), list(selectIds = "id<5")) ) # select the 4 first subjects excepted the second one

----------------------------------------------------------------------------------------

OCC [ integer ]

createFilter( filter = list(selectIds = "occ1==1", removeIds = "occ2!=3") ) # select the subjects whose first occasion level is '1' and whose second one is different from '3'

----------------------------------------------------------------------------------------

TIME [ double ]

createFilter( filter = list(removeIds='TIME>120') ) # remove the subjects who have time over 120

createFilter( filter = list(selectLines='TIME>120') ) # remove the all the lines where the time is over 120

----------------------------------------------------------------------------------------

OBSERVATION [ double ]

createFilter( filter = list(selectLines = "CONC>=5.5", removeLines = "CONC>10")) # select the lines where CONC value superior or equal to 5.5 or strictly higher than 10

createFilter( filter = list(removeIds = "CONC<0") ) # remove subjects who have negative CONC values

createFilter( filter = list(removeIds = "E==0") ) # remove subjects for who E equals 0

----------------------------------------------------------------------------------------

OBSID [ character ]

createFilter( filter = list(removeIds = "y1==1") ) # remove subject who have at least one observation for y1

createFilter( filter = list(selectLines = "y1!=2") ) # select all lines corresponding to observations exepected those for y2

----------------------------------------------------------------------------------------

AMOUNT [ double ]

createFilter( filter = list(selectIds = "AMOUT==10") ) # select subjects who have a dose equals to 10

----------------------------------------------------------------------------------------

INFUSION RATE AND INFUSION DURATION [ double ]

createFilter( filter = list(selectIds = "RATE<10") ) # select subjects who have dose with a rate less than 10

----------------------------------------------------------------------------------------

COVARIATE [ character (categorical) | double (continuous) ]

createFilter( filter = list(selectIds = "SEX==M", selectIds = "WEIGHT<80") ) # select subjects who are men and whose weight is lower than 80kg

----------------------------------------------------------------------------------------

REGERSSOR [ double ]

createFilter( filter = list(selectLines = "REG>10") ) # select the lines where the regressor value is over 10

----------------------------------------------------------------------------------------

COMPLEMENT

createFilter(origin = "data_filtered", filter = "complement" )

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Delete additional covariate

Description

Delete a created additinal covariate.

Usage

deleteAdditionalCovariate(name)

Arguments

name (character) name of the covariate.

See Also

addAdditionalCovariate

Click here to see examples

#

deleteAdditionalCovariate("firstDoseAmount")\cr

deleteAdditionalCovariate("observationNumberPerIndividual_y1")

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Delete filter

Description

Delete a data set. Only filtered data set which are not active and whose children are not active either can be deleted.

Usage

deleteFilter(name)

Arguments

name (character) data set name.

See Also

createFilter

Click here to see examples

#

deleteFilter(name = "filter2")

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Edit filter

Description

Edit the definition of an existing filtered data set. Refere to createFilter for more details about syntax, allowed parameters and examples.
Notice that all the filtered data set which depend on the edited one will be deleted.

Usage

editFilter(filter, name = "")

Arguments

filter (list< list< action = “headerName-comparator-value” > >) filter definition.
name (character) [optional] data set name to edit (current one by default)

See Also

createFilter


[Monolix – PKanalix] Adapt and export a data file as a MonolixSuite formatted data set.

Description

Adapt and export a data file as a MonolixSuite formatted data set.

Usage

formatData(
  dataFile,
  formattedFile,
  headerLines = 1,
  headers,
  linesToExclude = NULL,
  observationSettings = NULL,
  observations = NULL,
  treatmentSettings = NULL,
  treatments = NULL,
  additionalColumns = NULL,
  sheet = NULL
)

Arguments

dataFile (character) Path to the original data file (csv, xlsx, xlsx, sas7bdat, xpt or txt). Can be absolute or relative to the current working directory.
formattedFile (character) Path to the data file that will be exported (must end with the .csv, .txt, .tsv or .xpt extension).
headerLines (optional) (integer or vector<integer>) Line numbers containing headers (if multiple numbers are given, formatted headers will contain values from all header lines concatenated with the “_” character) – default: 1.
headers (list) List of headers or indexes for columns containing information about ID, time, volume (in case of urine data) and sort columns. If the headers are changed by Data Formatting, the original headers should be given.

  • id (character) – Name of the column distinguishing data from different individuals.
  • time (character) – Name of the column containing observation times (in case of plasma data).
  • sort (character or vector<character>) – Name of the column(s) distinguishing different profiles.
  • start (character) – Name of the column containing urine collection start times (in case of urine data).
  • end (character) – Name of the column containing urine collection end times (in case of urine data).
  • volume (character) – Name of the column containing collected volume of urine samples (in case of urine data).
linesToExclude (optional) (integer or vector<integer>) Numbers of lines that should be removed from the data set.
observationSettings (optional) (list) List containing settings applied when different observation columns are merged into a single column.

  • distinguishWithObsId (logical) – If TRUE, different observations will be distinguished with the observation ID column (default), otherwise they will be distinguished with occasions.
  • duplicateInformation (logical) – If TRUE, information from undefined columns will be duplicated (default) in the newly created rows.
observations (optional) (list) List of lists containing information about different observation types:

  • header (character) – Name of the column containing observations. If the header is changed by Data Formatting, the original header should be given.
  • censoring (list) – List of lists containing information about different types of censored data (not necessary if there is no censored data):
    • type (character) – Type of censoring, one of “LLOQ”, “ULOQ”, or “interval”.
    • tags (character or vector<character>) – Strings in the observation column indicating that the data is censored (e.g., “BLQ”, “LLOQ”, …).
    • limits – Define limits of censored data. If censoring type is “LLOQ” or “ULOQ”, the lower and upper limit is defined with one of the following arguments. If censoring type is “interval”, the lower and upper limits of the censoring interval are defined with a list of two of the following arguments:
      • as character – The column with the indicated header will be used to define limits.
      • as double – The value will be used as a lower/upper limit.
      • as list – Used to give different values for different categories. List needs to be have two arguments:
        • category (character) – Name of the column containing the category.
        • values (list) – List containing modalities as keys and limit values as values (e.g., list(method1 = 0.06, method2 = 0.1)).
treatmentSettings (optional) (list) List containing settings applied to all treatments.

  • infusionType (“rate”|”duration”, default = “duration”) – Type of values defining infusion.
  • doseIntervalsAsOccasions (default = FALSE) (logical) – If TRUE, occasions will be created for each dose interval.
  • duplicateObservationsAtDoseTimes (default = FALSE) (logical) – If TRUE and doseIntervalsAsOccasions is TRUE, doses will duplicate observations if both are at the same time.
treatments (optional) (list or character) List that can contain lists with information about different treatments or strings with paths to files that contain treatment information.
Lists with information about different treatments need to have the following elements:

  • times (double or vector<double>) – Times at which the dose is administered (R function seq can be used to define regular treatments).
  • amount (character, double or list) – Administered amount. Can be defined in the same way as censoring limits (through a column name, as a fixed value or as values depending on categories).
  • infusion (character, double or list) – Infusion rate or duration (see the treatmentSettings argument for more information). Can be defined in the same way as censoring limits (through a column name, as a fixed value or as values depending on categories). Does not need to be provided if the drug is not administered through an infusion.
  • admId (character, double or list) – Administration ID. Can be defined in the same way as censoring limits (through a column name, as a fixed value or as values depending on categories). If not provided, default of 1 will be used.
  • repeatCycle (list) – List containing repetition information (does not need to be provided if the treatment is not repeated):
    • duration (double) – Duration of a cycle.
    • number (integer) – Number of repetitions.

Path to files that contain treatment information can be just one path (csv, xlsx, xlsx, sas7bdat, xpt or txt, absolute or relative to the current working directory),
or a list of paths (to combine several treatments):

  • file (character) File path 1
  • file (character) File path 2
  • file (character) etc

or a list of lists with 2 elements to specify for each treatment an xls/xlsx file and sheet in the excel file:

  • list with
    • file (character) File path 1
    • sheet [optional] (character): Name of the sheet in first xlsx/xls file.
  • list with
    • file (character) File path 2
    • sheet [optional] (character): Name of the sheet in second xlsx/xls file.
  • etc
additionalColumns (optional) (character or vector<character>) Path(s) to the file(s) containing additional columns (needs to have the ID column). Accepted formats are csv, xlsx, xlsx, sas7bdat, xpt or txt. It can be just one path, or a list of paths (to use columns from several external files):

  • file (character) File path 1
  • file (character) File path 2
  • file (character) etc

or a list of lists with 2 elements to specify an xls/xlsx file and sheet in the excel file:

  • list with
    • file (character) File path 1
    • sheet [optional] (character): Name of the sheet in first xlsx/xls file.
  • list with
    • file (character) File path 2
    • sheet [optional] (character): Name of the sheet in second xlsx/xls file.
  • etc
sheet [optional] (character): Name of the sheet in xlsx/xls file. If not provided, the first sheet is used.

Details

Data formatting can be performed as in the Data Formatting Tab of Monolix and PKanalix interface. Look at the examples to see how each data formatting demo project could be created with the connectors.

See Also

getFormatting

Click here to see examples

#

initializeLixoftConnectors(software = "pkanalix")

FormattedDataPath = tempfile("formatted_data", fileext = ".csv")

formatData(paste0(getDemoPath(),"/0.data_formatting/data/units_BLQ_tags_data.csv"),

           formattedFile = FormattedDataPath,

           headerLines = c(1,2),

           headers = c(id="ID", time="TIME"),

           observations = list(header="CONC",

                               censoring = list(type="interval", tags = c("BLQ"), 

                                                limits=list(0,"LLOQ"))),

           treatments = list(times=0, amount=100))

colnames(read.csv(FormattedDataPath)) # to check column names of the generated file and tag them as desired

newProject(data = list(dataFile = FormattedDataPath, headerTypes = c("id","time","observation","contcov","contcov","catcov","ignore","amount","cens","limit")))

plotObservedData()

# demo merge_occ_ParentMetabolite.pkx

formatData(paste0(getDemoPath(),"/0.data_formatting/data/parent_metabolite_data.csv"),

           formattedFile = FormattedDataPath,

           headers = c(id="ID", time="TIME"),

           observations = list(list(header="PARENT",

                                    censoring = list(type="interval", tags = c("BLQ"), limits=list(0,0.01))),

                               list(header="METABOLITE")),

           observationSettings = list(distinguishWithObsId = FALSE),

           treatments = list(times=0, amount="DOSE"))

# demo merge_obsID_ParentMetabolite.pkx

formatData(paste0(getDemoPath(),"/0.data_formatting/data/parent_metabolite_data.csv"),

           formattedFile = FormattedDataPath,

           headers = c(id="ID", time="TIME"),

           observations = list(list(header="PARENT",

                                    censoring = list(type="interval", tags = c("BLQ"), limits=list(0,0.01))),

                               list(header="METABOLITE")),

           treatments = list(times=0, amount="DOSE"))

# demo DoseAndLOQ_byCategory.pkx

formatData(paste0(getDemoPath(),"/0.data_formatting/data/units_BLQ_tags_data.csv"),

           formattedFile = FormattedDataPath,

           headerLines = c(1,2),

           headers = c(id="ID", time="TIME"),

           observations = list(header="CONC",

                               censoring = list(type="interval", tags = c("BLQ"), 

                                                limits=list(0,list(category="STUDY",

                                                                   values=list("SD_400mg"=0.01, "SD_500mg"=0.1, "SD_600mg"=0.1))))),

           treatments = list(times=0, amount=list(category="STUDY",

                                                  values=list("SD_400mg"=400, "SD_500mg"=500, "SD_600mg"=600))))

# demo DoseAndLOQ_fromData.pkx

formatData(paste0(getDemoPath(),"/0.data_formatting/data/units_BLQ_tags_data.csv"),

           formattedFile = FormattedDataPath,

           headerLines = c(1,2),

           headers = c(id="ID", time="TIME"),

           observations = list(header="CONC",

                               censoring = list(type="interval", tags = c("BLQ"), 

                                                limits=list(0,"LLOQ"))),

           treatments = list(times=0, amount="STUDY"))

# demo DoseAndLOQ_manual.pkx

formatData(paste0(getDemoPath(),"/0.data_formatting/data/units_multiple_BLQ_tags_data.csv"),

           formattedFile = FormattedDataPath,

           headerLines = c(1,2),

           headers = c(id="ID", time="TIME"),

           observations = list(header="CONC",

                               censoring = list(list(type="interval", tags = c("BLQ1"), limits=list(0,0.06)),

                                                list(type="interval", tags = c("BLQ2"), limits=list(0,0.1)))),

           treatments = list(times=0, amount=600))

# demo Urine_LOQinObs.pkx

formatData(paste0(getDemoPath(),"/0.data_formatting/data/urine_LOQinObs_data.csv"),

           formattedFile = FormattedDataPath,

           headers = c(id="ID", start="START TIME", end="END TIME", volume="VOLUME"),

           observations = list(header="CONC", 

                               censoring=list(type="LLOQ", tags="<LOQ=1>", limits="CONC")),

           treatments = list(paste0(getDemoPath(),"/0.data_formatting/data/urine_data_doses.csv")))

# demo CreateOcc_AdmIdbyCategory.pkx

formatData(paste0(getDemoPath(),"/0.data_formatting/data/two_formulations_data.csv"),

           formattedFile = FormattedDataPath,

           linesToExclude = 1, headerLines = c(2,3),

           headers = c(id="ID", time="TIME", sort="FORM"),

           observations = list(header="CONC",

                               censoring=list(type="LLOQ", tags="BLQ", limits=0.06)),

           treatments = list(times=0, amount=600, admId=list(category="FORM", values=list("ref"=1,"test"=2))))

# MONOLIX EXAMPLES

initializeLixoftConnectors(software = "monolix")

FormattedDataPath = tempfile("formatted_data")

# demo doseIntervals_as_Occ.mlxtran

formatData(paste0(getDemoPath(),"/0.data_formatting/data/data_multidose.csv"),

           formattedFile = FormattedDataPath,

           headers = c(id="ID", time="TIME"),

           observations = list(header="CONC"),

           treatments = list(times=seq(0,by=12,length=7), amount=40),

           treatmentSettings = list(doseIntervalsAsOccasions = TRUE))

# demo warfarin_PKPDseq_project.mlxtran

formatData(paste0(getDemoPath(),"/0.data_formatting/data/warfarin_data.csv"),

           formattedFile = FormattedDataPath,

           headers = c(id="id", time="time"),

           additionalColumns = paste0(getDemoPath(),"/0.data_formatting/data/warfarinPK_regressors.txt"))


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Get data sets descriptions

Description

Get information about the data sets and filters defined in the project.

Usage

getAvailableData()

Value

A list containing a list containing elements that describe the data set:

  • name: (character) the name of the data set
  • file: (character) the path of the data set file
  • current: a logical indicating if the data set is applied (currently in use)
  • children: a list containing lists with information about data sets created from this one using filters
  • filter (only if the dataset was created using filters): a list containing name of the parent and details about filter definition

Click here to see examples

#

getAvailableData()

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Get covariates information

Description

Get the name, the type and the values of the covariates present in the project.

Usage

getCovariateInformation()

Value

A list containing the following fields :

  • name (vector<character>): covariate names
  • type (vector<character>): covariate types. Existing types are “continuous”, “continuoustransformed”, “categorical”, “categoricaltransformed”./
    In Monolix mode, “latent” covariates are also allowed.
  • range (vector<pair<double>>): continuous covariate ranges
  • categories (vector<vector<character>>): discrete covariates modalities
  • [Monolix] modalityNumber (vector<integer>): number of modalities (for latent covariates only)
  • covariate: a data frame giving the values of continuous and categorical covariates for each subject.
    Latent covariate values exist only if they have been estimated, ie if the covariate is used and if the population parameters have been estimated.
    Call getEstimatedIndividualParameters to retrieve them.

Click here to see examples

#

info = getCovariateInformation() # Monolix mode with latent covariates

info

  -> $name

     c("sex","wt","lcat")

  -> $type

     c(sex = "categorical", wt = "continuous", lcat = "latent")

  -> $range

     list(wt = c(55, 73.5))

  -> $categories

     c(sex = c("F", "M"))

  -> $modalityNumber

     c(lcat = 2)

  -> $covariate

     id   sex    wt

      1    M   66.7

      .    .      .

      N    F   59.0

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Get data formatting from a loaded project

Description

Get data formatting settings from a loaded project.
It returns a list with the same items as the arguments of formatData, where the header items correspond to formatted headers if they have been changed by Data Formatting, and in addition:

  • originalHeaders (character) – list of original names of the columns used for data formatting.

Usage

getFormatting()

See Also

formatData

Click here to see examples

#

initializeLixoftConnectors(software = "pkanalix")

loadProject(paste0(getDemoPath(),"/0.data_formatting/DoseAndLOQ_manual.pkx"))

getFormatting()

}


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Get observations information

Description

Get the name, the type and the values of the observations present in the project.

Usage

getObservationInformation()

Value

A list containing the following fields :

  • name (vector<character>): observation names.
  • type (vector<character>): observation generic types. Existing types are “continuous”, “discrete”, “event”.
  • [Monolix] detailedType (vector<character>): observation specialized types set in the structural model. Existing types are “continuous”, “bsmm”, “wsmm”, “categorical”, “count”, “exactEvent”, “intervalCensoredEvent”.
  • [Monolix] mapping (vector<character>): mapping between the observation names (defined in the mlxtran project) and the name of the corresponding entry in the data set.
  • [“obsName”] (data.frame): observation values for each observation id.

In PKanalix mode, the observation type is not provided as only continuous observations are allowed. Neither do the mapping as dataset names are always used.

Click here to see examples

#

info = getObservationInformation()

info

  -> $name

     c("concentration")

  -> $type # [Monolix]

     c(concentration = "continuous")

  -> $detailedType # [Monolix]

     c(concentration = "continuous")

  -> $mapping # [Monolix]

     c(concentration = "CONC")

  -> $concentration

       id   time concentration

        1    0.5     0.0

        .    .      .

        N    9.0    10.8

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Get treatments information

Description

Get information about doses present in the loaded dataset.

Usage

getTreatmentsInformation()

Value

A dataframe whose columns are:

  • id and occasion level names (character)
  • time (double)
  • amount (double)
  • [optional] administrationType (integer)
  • [optional] infusionTime (logical)
  • [optional] isArtificial (logical): is created from SS or ADDL column
  • [optional] isReset (logical): IOV case only

Click here to see examples

#

## Not run: 

initializeLixoftConnectors("monolix")

project_name <- file.path(getDemoPath(), "6.PK_models", "6.3.multiple_doses", "ss1_project.mlxtran")

loadProject(project_name)

getTreatmentsInformation()

## End(Not run)

}


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Remove filter

Description

Remove the last filter applied on the current data set.

Usage

removeFilter()

See Also

applyFilter selectData

Click here to see examples

#

removeFilter()

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Rename additional covariate

Description

Rename an existing additional covariate.

Usage

renameAdditionalCovariate(oldName, newName)

Arguments

oldName (character) current name of the covariate to rename
newName (character) new name.

See Also

addAdditionalCovariate

Click here to see examples

#

renameAdditionalCovariate(oldName = "observationNumberPerIndividual_y1", newName = "nbObsForY1")

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Rename filter

Description

Rename an existing filtered data set.

Usage

renameFilter(newName, oldName = "")

Arguments

newName (character) new name.
oldName (character) [optional] current name of the filtered data set to rename (current one by default)

See Also

createFilter editFilter

Click here to see examples

#

renameFilter("newFilter")\cr

renameFilter(oldName = "filter", newName = "newFilter")  

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Select data set

Description

Select the new current data set within the previously defined ones (original and filters).

Usage

selectData(name)

Arguments

name (character) data set name.

See Also

getAvailableData

Click here to see examples

#

selectData(name = "filter1")

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get individual parameter model

Description

Get a summary of the individual parameter model. The available information is the following:

  • name: (character) vector of names of the individual parameters
  • distribution: (character) vector giving the probability distribution of each parameter. The distribution can be one of
    "normal", "logNormal", or "logitNormal".
  • limits: (double) a list giving the distribution limits for each parameter with a "logitNormal" distribution
  • formula: (character) the formula used for each parameter
  • variability: (logical) a list giving, for each variability level, a vector with TRUE for each individual parameter that has variability or FALSE if not.
  • covariateModel: (logical) a list giving, for each individual parameter, a vector with TRUE for each covariate that is included in the model for that parameter or FALSE if not.
    If there are no covariates in the model, this is an empty list.
  • correlationBlocks: (character) a list with, for each variability level, a list of correlations, where each correlation block is a vector of the parameter names included in that correlation.
    If there are no correlations in the model, this is omitted.

Usage

getIndividualParameterModel()

Value

A list containing the individual parameter model elements

See Also

setIndividualParameterModel to change the individual parameter model

The components of the individual parameter model can be updated individually:
setIndividualParameterDistribution to update just the individual parameter distributions
setIndividualLogitLimits to update just the limits for parameters with a logit distribution
setIndividualParameterVariability to update just the individual parameter variability
setCovariateModel to update just the covariate model
setCorrelationBlocks to update just the correlation structure

Click here to see examples

#

project_file <- file.path(getDemoPath(), "5.models_for_individual_parameters", "5.1.probability_distribution", "warfarin_distribution3_project.mlxtran")

loadProject(project_file)

indivModel <- getIndividualParameterModel()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get variability levels

Description

Get a summary of the variability levels (inter-individual and/or intra-individual variability, i.e. random effects)
present in the current project.

Usage

getVariabilityLevels()

Value

A vector of the variability levels present in the currently loaded project.

See Also

getIndividualParameterModel to see the current individual parameter model settings

Click here to see examples

#

project_file <- file.path(getDemoPath(), "5.models_for_individual_parameters", "5.4.inter_occasion_variability", "iov1_project.mlxtran")

loadProject(project_file)

getVariabilityLevels()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set correlation block structure

Description

Define the correlation block structure associated to some of the variability levels of the current project.
Call getVariabilityLevels to get a list of the variability levels and getIndividualParameterModel
to get a list of the available individual parameters within the current project.

Usage

setCorrelationBlocks(...)

Arguments

... A list of comma-separated pairs {variabilityLevel = list(vector<character>)parameterNames}) } (see example).

See Also

getVariabilityLevels to see the variability levels
getIndividualParameterModel to see the current individual parameter model settings
setIndividualParameterModel to change the individual parameter model

The components of the individual parameter model can be updated individually:
setIndividualParameterDistribution to update just the individual parameter distributions
setIndividualLogitLimits to update just the limits for parameters with a logit distribution
setIndividualParameterVariability to update just the individual parameter variability
setCovariateModel to update just the covariate model

Click here to see examples

#

# creating multiple correlation blocks

loadProject( file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "warfarinPK_project.mlxtran") )

setCorrelationBlocks(id = list(  c("ka","Cl"), c("Tlag","V") ) )

getIndividualParameterModel()$correlationBlocks

# creating blocks at multiple variability levels

loadProject( file.path(getDemoPath(), "5.models_for_individual_parameters", "5.4.inter_occasion_variability", "iov1_project.mlxtran") )

setIndividualParameterVariability(list(OCC = c(Cl = TRUE))) # parameter must have variability to be included in correlation

setCorrelationBlocks(id = list( c("ka","V", "Cl") ), OCC = list( c("Cl","V") ) )

getIndividualParameterModel()$correlationBlocks


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set covariate model

Description

Set which are the covariates influencing individual parameters present in the project.
Call getIndividualParameterModel to get a list of the individual parameters present within the current project.
and getCovariateInformation to know which are the available covariates for a given level of variability and a given individual parameter.

Usage

setCovariateModel(...)

Arguments

... A list of comma-separated pairs {parameterName = { covariateName = (logical)isIncluded, …} } (see example)

See Also

getCovariateInformation to see available covariates
getIndividualParameterModel to see the current individual parameter model settings
setIndividualParameterModel to change the individual parameter model

The components of the individual parameter model can be updated individually:
setIndividualParameterDistribution to update just the individual parameter distributions
setIndividualLogitLimits to update just the limits for parameters with a logit distribution
setIndividualParameterVariability to update just the individual parameter variability
setCorrelationBlocks to update just the correlation structure

Click here to see examples

#

loadProject( file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran") )

setCovariateModel( ka = c( SEX = TRUE, WEIGHT = TRUE),

                   V = c( WEIGHT = TRUE ) )

getIndividualParameterModel()$covariateModel


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set individual parameter distribution limits

Description

Set the minimum and the maximum values for an individual parameter.
Limits only apply to parameters with a "logitNormal" distribution.
Call getIndividualParameterModel to get a list of the available
parameters within the current project. The initial estimate of the
parameter must be inside the limits, which can be set with setPopulationParameterInformation.

Usage

setIndividualLogitLimits(...)

Arguments

... Comma-separated pairs {parameterName = c((double)min,(double)max) } (see example)

See Also

getIndividualParameterModel to see the current individual parameter model settings
setIndividualParameterModel to change the individual parameter model
getPopulationParameterInformation to see the parameter initial values
setPopulationParameterInformation to change the parameter initial values

The components of the individual parameter model can be updated individually:
setIndividualParameterDistribution to update just the individual parameter distributions
setIndividualParameterVariability to update just the individual parameter variability
setCovariateModel to update just the covariate model
setCorrelationBlocks to update just the correlation structure

Click here to see examples

#

project_file <- file.path(getDemoPath(), "5.models_for_individual_parameters", "5.1.probability_distribution", "warfarin_distribution3_project.mlxtran")

loadProject(project_file)

setIndividualParameterDistribution(V = "logitNormal", ka = "logitNormal")

setPopulationParameterInformation(V_pop  = list(initialValue = 0.5))

setIndividualLogitLimits( V = c(0, 1), ka = c(-1, 2) )

getIndividualParameterModel()$limits


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set individual parameter distribution

Description

Set the distribution of the estimated parameters.
Available distributions are “normal”, “logNormal” and “logitNormal”.
Call getIndividualParameterModel to get a list of the available individual parameters within the current project.

Usage

setIndividualParameterDistribution(...)

Arguments

... A list of comma-separated pairs (character) {parameterName = “distribution”} (see example).

See Also

getIndividualParameterModel to see the current individual parameter model settings
setIndividualParameterModel to change the individual parameter model

The components of the individual parameter model can be updated individually:
setIndividualLogitLimits to update just the limits for parameters with a logit distribution
setIndividualParameterVariability to update just the individual parameter variability
setCovariateModel to update just the covariate model
setCorrelationBlocks to update just the correlation structure

Click here to see examples

#

project_file <- file.path(getDemoPath(), "5.models_for_individual_parameters", "5.1.probability_distribution", "warfarin_distribution3_project.mlxtran")

loadProject(project_file)

setIndividualParameterDistribution(V = "normal")

setIndividualParameterDistribution(Cl = "normal", V = "logNormal")

getIndividualParameterModel()$distribution


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set individual parameter model

Description

Update the individual parameter model. The following information is editable:

  • distribution: (character) vector giving the probability distribution of each parameter.
    The distribution can be one of "normal", "logNormal", or "logitNormal".
  • limits: (double) a list giving the distribution limits for each parameter with a
    "logitNormal" distribution
  • variability: (logical) a list giving, for each variability level, a vector
    with TRUE for each individual parameter that has variability or FALSE if not.
  • covariateModel: (logical) a list giving, for each individual parameter,
    a vector with TRUE for each covariate that is included in the model for that parameter or FALSE if not.
  • correlationBlocks: a list with, for each variability level, a list of correlations,
    where each correlation block is a vector of the parameter names included in that correlation.
    Parameters must have random effects to be included in correlations.

Usage

setIndividualParameterModel(...)

Arguments

... A list of comma-separated pairs {[info] = [value]} (See example).

See Also

getIndividualParameterModel to see the current individual parameter model settings

The components of the individual parameter model can be updated individually:
setIndividualParameterDistribution to update just the individual parameter distributions
setIndividualLogitLimits to update just the limits for parameters with a logit distribution
setIndividualParameterVariability to update just the individual parameter variability
setCovariateModel to update just the covariate model
setCorrelationBlocks to update just the correlation structure

Click here to see examples

#

project_file <- file.path(getDemoPath(), "5.models_for_individual_parameters", "5.1.probability_distribution", "warfarin_distribution3_project.mlxtran")

loadProject(project_file)

# change the distribution of parameter V to be a logitNormal between 0 and 30

setIndividualParameterModel(list(distribution = c(V = "logitNormal"), limits = list(V = c(0, 30))))

getIndividualParameterModel()

# remove correlation and add covariate wt on Cl

setIndividualParameterModel(list( correlationBlocks = list(id = list()), 

                                  covariateModel = list(Cl = c(sex = FALSE, age = FALSE, wt = TRUE))) )

getIndividualParameterModel()

# remove variability (random effects) on parameter ka

setIndividualParameterModel(list(variability = list(id = c(ka = FALSE))))

getIndividualParameterModel()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Individual variability management

Description

Add or remove inter-individual and/or intra-individual variability (i.e. random effects) from some of the individual parameters present in the project.
Call getIndividualParameterModel to get a list of the available parameters within the current project.

Usage

setIndividualParameterVariability(...)

Arguments

... A list of comma-separated pairs {variabilityLevel = {individualParameterName = (logical)hasVariability} } (see example).

See Also

getIndividualParameterModel to see the current individual parameter model settings
getVariabilityLevels to get a list of the variability levels
setIndividualParameterModel to change the individual parameter model

The components of the individual parameter model can be updated individually:
setIndividualParameterDistribution to update just the individual parameter distributions
setIndividualLogitLimits to update just the limits for parameters with a logit distribution
setCovariateModel to update just the covariate model
setCorrelationBlocks to update just the correlation structure

Click here to see examples

#

loadProject( file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran") )

setIndividualParameterVariability(ka = TRUE, V = FALSE)

getIndividualParameterModel()$variability

# multiple variability levels

loadProject( file.path(getDemoPath(), "5.models_for_individual_parameters", "5.4.inter_occasion_variability", "iov1_project.mlxtran") )

setIndividualParameterVariability(id = list(ka = FALSE, V = FALSE), OCC = list(ka = TRUE))

getIndividualParameterModel()$variability


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Automatically estimate initial parameter values

Description

Compute initial values for fixed-effect population parameters. The values are returned in the same format
as getPopulationParameterInformation and can be passed to setPopulationParameterInformation to
set the inital values.

Usage

getFixedEffectsByAutoInit(ids = NULL)

Arguments

ids (integer) [optional] if included, a vector of indices of individuals to use to estimate
initial values, otherwise all individuals are included (can be used to speed up estimation in the case of many individuals)

See Also

getPopulationParameterInformation to get the current population parameter information, including initial values
setPopulationParameterInformation to set the population parameter information (e.g. with the results of this method)
setInitialEstimatesToLastEstimates to set the population parameter initial values to the last estimated values

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

initValues <- getFixedEffectsByAutoInit()

setPopulationParameterInformation(initValues)

# restrict initial value estimation to only certain individuals

# (most useful when there are many similar individuals and estimation takes a long time)

initValues <- getFixedEffectsByAutoInit(ids = 1:10)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get population parameters information

Description

Get population parameters information.
Get the name, the initial value, the estimation method and, if relevant, MAP (Maximum A Posteriori) parameter values
of the population parameters in the project.
Information is available for fixed effects (with suffix “pop”), random effects (with prefix “omega“),
error model parameters (i.e. a, b, c), covariates (with prefix “beta_”) including latent covariate
probabilities (with prefix “p” and numeric suffix), and correlations (with prefix “corr_”).

Usage

getPopulationParameterInformation()

Details

Available estimation methods are:

"FIXED" Fixed parameter No estimation
"MLE" Maximum Likelihood Estimation SAEM algorithm
"MAP" Maximum A Posteriori Estimation Bayesian estimation

 

Value

A data frame giving, for each population parameter, the following information:

  • name: (character) parameter name
  • initialValue: (double) initial value
  • method: (character) estimation method (see Details)
  • priorValue: (double) [MAP only] typical value for prior
  • priorSD: (double) [MAP only] standard deviation for prior

See Also

setPopulationParameterInformation to set the population parameter information
getEstimatedPopulationParameters to get the population parameters estimated values
setInitialEstimatesToLastEstimates to set the population parameter initial values to the last estimated values
getFixedEffectsByAutoInit to estimate initial values for the population parameters

Click here to see examples

#

# simple model (MLE/FIXED)

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

getPopulationParameterInformation()

# model with MAP

loadProject(file.path(getDemoPath(), "7.miscellaneous", "7.2.bayesian_estimation", "theobayes1_project.mlxtran"))

getPopulationParameterInformation()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Initialize population parameters with the last estimated ones

Description

Set the initial value of all the population parameters in the current project to the ones previously estimated.
These the values will be used in the population parameter estimation algorithm the next time the scenario is run.
WARNING: If there are changes to the model after the last run, it will not be possible to set the
initial values, as the structure of the project has changed since the last results. Call runPopulationParameterEstimation
to rerun the estimates before calling this method.

Usage

setInitialEstimatesToLastEstimates(fixedEffectsOnly = FALSE)

Arguments

fixedEffectsOnly (logical) If set to TRUE, only the fixed effects (with suffix “_pop”) are initialized to their last estimated values.
Otherwise, if FALSE, all population parameters, including fixed effect, error model, covariate, and correlation parameters,
are re-initialized too. FALSE by default.

See Also

getEstimatedPopulationParameters to get the population parameters estimated values
(that values that will be used by this method_)
getPopulationParameterInformation to get the current population parameter information, including initial values
runPopulationParameterEstimation to estimate the population parameters
setPopulationParameterInformation to set the population parameter information
getFixedEffectsByAutoInit to estimate initial values for the population parameters

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

getPopulationParameterInformation()

runPopulationParameterEstimation()

# set only initial values for fixed effects to the last estimated values

setInitialEstimatesToLastEstimates(fixedEffectsOnly = TRUE)

getPopulationParameterInformation()

# set all parameter initial values to last estimated values

setInitialEstimatesToLastEstimates() 

getPopulationParameterInformation()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set population parameters initialization and estimation method

Description

Set population parameters initialization and estimation method.
Set the initial value, the estimation method and, if relevant, the MAP parameters of one or more
of the population parameters present within the current project. This includes fixed effects,
random effects, error model, covariate, and correlation parameters.

Usage

setPopulationParameterInformation(...)

Arguments

... A set of comma-separated lists, where any omitted list entry will remain unchanged
paramName = list( initialValue = (double), method = (character) “method” ).
(See Details for additional list entries for the MAP method)

Details

Available estimation methods are:

"FIXED" Fixed parameter No estimation
"MLE" Maximum Likelihood Estimation SAEM algorithm
"MAP" Maximum A Posteriori Estimation Bayesian estimation

Call getPopulationParameterInformation to get a list of the initializable population parameters present within the current project.

For the "MAP" estimation method, the user can specify the associated typical value and standard deviation values by using additional list elements:

paramName = list( initialValue = (double), method = “MAP”, priorValue = (double), priorSD = (double) )

By default, the prior value corresponds to the the population parameter and the prior standard deviation is set to 1. See example.

See Also

getPopulationParameterInformation to get the population parameter information
setInitialEstimatesToLastEstimates to set the population parameter initial values to the last estimated values
getFixedEffectsByAutoInit to estimate initial values for the population parameters which can be passed to this method

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

setPopulationParameterInformation(Cl_pop = list(initialValue = 0.5, method = "FIXED"), 

                                  V_pop  = list(initialValue = 1),

                                  ka_pop = list(method = "MAP", priorValue = 1, priorSD = 0.1))

getPopulationParameterInformation()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Initialize lixoftConnectors API

Description

Initialize lixoftConnectors API for a given software.

Usage

initializeLixoftConnectors(software = "monolix", path = "", force = FALSE)

Arguments

software (character) [optional] Name of the software to be loaded. By default, “monolix” software is used.
path (character) [optional] Path to installation directory of the Lixoft suite.
If lixoftConnectors library is not already loaded and no path is given, the directory written in the lixoft.ini file is used for initialization.
force (logical) [optional] Should software switch security be overpassed or not. Equals FALSE by default.

Value

A logical equaling TRUE if the initialization has been successful and FALSE if not.

Click here to see examples

#

initializeLixoftConnectors(software = "monolix", path = "/path/to/lixoftRuntime/")

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Get Lixoft demos path

Description

Get the path to the demo projects. The path depends on the software used to initialize the connectors with initializeLixoftConnectors.

Usage

getDemoPath()

Value

The Lixoft demos path corresponding to the currently active software.

Click here to see examples

#

  getDemoPath()

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get the results of the model building

Description

Get the results of automatic covariate model building or automatic statistical model building. The exact details
of what is returned depend on the strategy used when running the model building.

Usage

getModelBuildingResults()

Value

A list containing the results of model building with one element for each model run.
For all strategies, each list item contains the following:

  • LL: result of -2*Log-Likelihood
  • BICc: modified BIC
  • individualModels: (data.frame of logical values) where the rows are the parameters
    in the model and the columns are the covariates, and the TRUE/FALSE value indicates if a covariate is used for that parameter

COSSAC returns two additional fields:

  • tested: (vector<character>) which parameter-covariate pair was testing in this run with respect to the
    previous model, where the first element is the individual model parameter and the second one is the covariate
  • bestModel: (logical) whether this model is the best model amongst all the tested models according to the chosen criterion

SAMBA returns the error model and covariance model information if they exist:

  • errorModels: (data.frame) onservation model where each row specifies the observation id and the error model chosen
  • covarianceModels: list with one element for each variability level consisting of two elements: level, specifying the
    variability level, and correlations, a list of the chosen correlations between individual model parameters in the groups element

See Also

getModelBuildingSettings for a description of settings
runModelBuilding to run model building

Click here to see examples

#

project_file <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran")

loadProject(project_file)

runModelBuilding(strategy = "samba")

res <- getModelBuildingResults()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get model building settings

Description

Get the current settings for running model building. These are the settings that will be used if runModelBuilding
is called without argument, or they can be used as a template to update and pass to runModelBuilding in order to change the settings.

Usage

getModelBuildingSettings()

Value

The list of settings (default values indicated by square brackets)

  • covariates: (vector<character>) covariate names to be considered in the model building
  • parameters: (vector<character>) parameters names to be considered in the model building
  • strategy: (character) strategy to use for model building
    (["cossac"], "samba", "covsamba", "scm"), where cossac, covsamba, and scm are algorithms for
    automatic covariate model building and samba is an algorithm for automatic statistical model building,
    which includes the residual error model and correlations between random effects in addition to the covariate effects
  • criterion: (character) criterion to determine best model (["BIC"], "LRT")
  • relationships: (data.frame with columns: parameters, covariates, locked)
    Use to force specific parameter-covariate relationships to be included (locked = TRUE) or excluded (locked = FALSE),
    See runModelBuilding for an example. By default, all the combinations are possible (i.e. this data.frame is empty).
  • threshold$lrt: threshold used by criterion LRT whether or not to continue to improve the model
    (first element is for forward and the second one is for the backward method)
  • threshold$correlation: threshold used by cossac to choose what combinations (parameter-covariate)
    must be tried as next candidate model (first element is for forward and the second one is for the backward method)
  • useLin: (logical) computation done using linearization ([TRUE]) or importance sampling (FALSE)

See Also

runModelBuilding to run model building

Click here to see examples

#

project_file <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran")

loadProject(project_file)

getModelBuildingSettings()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Run model building

Description

Run model building for automatic covariate model building or automatic statistical model building.
The current settings for running model building can been seen by calling getModelBuildingSettings
and the returned settings can be modified and used for the settings argument. See example.

Usage

runModelBuilding(...)

Arguments

... [optional] Settings to initialize the model building algorithm. See getModelBuildingSettings for a description
of settings. Settings can be passed individually as name-value pairs or together in a single list.

See Also

getModelBuildingSettings for a description of settings
getModelBuildingResults to get results

Click here to see examples

#

project_file <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran")

loadProject(project_file)

## Not run: 

# these two lines are equivalent

runModelBuilding()

runModelBuilding(settings = getModelBuildingSettings())

## End(Not run)

# settings can be set individually as name-value pairs

runModelBuilding(useLin = FALSE, covariates = "SEX", strategy = "cossac")

# or settings can be modified in the list returned from getModelBuildingSettings, then passed to runModelBuilding

mbSettings <- getModelBuildingSettings()

# for example, to force including the covariate SEX on parameter ka, 

# and to exclude the covaraite WEIGHT from parameter V

mbSettings$covariates <- c("SEX", "WEIGHT")

mbSettings$relationships[1,] = c("ka", "SEX", TRUE)

mbSettings$relationships[2,] = c("V", "WEIGHT", FALSE)

mbSettings$relationships

runModelBuilding(settings = mbSettings)

getModelBuildingResults()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get continuous observation statistical model information

Description

Get a summary of the information concerning the continuous observation statistical model(s) in the project.
The following information is returned for each continuous observation:

  • prediction: (vector<character>) name of the associated prediction (i.e. variable in the structural model).
  • formula: (vector<character>) formula applied to the observations, which depends on the mapping and error model chosen.
  • distribution: (vector<character>) distribution of the observations in the Gaussian space.
    The distribution type can be "normal", "logNormal", or "logitNormal".
  • limits: (vector< pair<double,double> >) lower and upper limits imposed on the observation.
    Used only if the distribution is "logitNormal", otherwise this field is not included.
  • errormodel: (vector<character>) type of the associated error model.
    The error model type can be "constant", "proportional", "combined1", or "combined2".
  • parameters: (vector<character>) a vector of parameters for the residual error model.
  • autocorrelation: (vector<logical>) "TRUE" to estimate autocorrelation, or "FALSE" otherwise
    (legacy only and not recommended to enable for new projects).

Usage

getContinuousObservationModel()

Value

A list specifying the statistical model properties for each continuous observation model.

See Also

getObservationInformation to get the continuous observations present in the current project

Set components of the continuous observation model(s):
setObservationDistribution
setObservationLimits
setErrorModel

Click here to see examples

#

# single observation

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

getContinuousObservationModel()

# multiple observations

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "warfarinPKPD_project.mlxtran"))

getContinuousObservationModel()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set auto-correlation

Description

Add or remove auto-correlation from the error model used on some of the observation models. This is a legacy feature
and not recommended for new projects.

Usage

setAutocorrelation(...)

Arguments

... Sequence of comma-separated pairs {(character)”observationModel”,(logical)hasAutoCorrelation}.

See Also

getContinuousObservationModel get the current observation model for the current project
getObservationInformation to get the continuous observations present in the current project
setPopulationParameterInformation to update error model parameters to be estimated

Set components of the continuous observation model:
setObservationDistribution
setObservationLimits
setErrorModel


[Monolix] Set error model

Description

Set the error model type to be used for the observation model(s).
Call getObservationInformation to get a list of
the available observation names within the current project.

Usage

setErrorModel(...)

Arguments

... A list of comma-separated pairs {observationModel = (character)errorModelType}.

Details

Available error model types are :

"constant" obs = pred + a*err
"proportional" obs = pred + (b*pred)*err
"combined1" obs = pred + (b*pred^c + a)*err
"combined2" obs = pred + sqrt(a^2 + (b^2)*pred^(2c))*err

where a, b, and c are parameters, obs is the observed data, pred is the prediction from the structural model,
and err is normally distributed with mean 0 and variance 1.
Error model parameters will be initialized to 1 by default.
Call setPopulationParameterInformation to modify their initial value.
The value of the exponent parameter c is fixed by default when using the "combined1" and "combined2" models.
Use setPopulationParameterInformation to enable its estimation.

See Also

getContinuousObservationModel get the current observation model for the current project
getObservationInformation to get the continuous observations present in the current project
setPopulationParameterInformation to update error model parameters to be estimated

Set components of the continuous observation model(s):
setObservationDistribution
setObservationLimits

Click here to see examples

#

project <- file.path(getDemoPath(), "1.creating_and_using_models",  "1.1.libraries_of_models", "warfarinPKPD_project.mlxtran")

loadProject(project)

# get observation model names available in the current project, how they are mapped to the data,

# and how they are mapped to the predictions

getObservationInformation()$name

getObservationInformation()$mapping

getContinuousObservationModel()$prediction

# update the error model

setErrorModel(y1 = "proportional", y2 = "combined1")

getContinuousObservationModel()$errorModel

getContinuousObservationModel()$formula


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set observation model distribution

Description

Set observation model distribution.
Set the distribution in the Gaussian space for the observation
model(s). Available distribution types are "normal", "logNormal", or
"logitNormal". Call getObservationInformation to get a list of
the available observation model names within the current project. Only specified
observation models will be changed. Call setObservationLimits to set
limits for any logitNormal distributions.

Usage

setObservationDistribution(...)

Arguments

... A list of comma-separated pairs {observationModel =
(character) “distribution”}.

See Also

getContinuousObservationModel get the current observation model for the current project
getObservationInformation to get the continuous observations present in the current project

Set components of the continuous observation model(s):
setObservationDistribution
setErrorModel

Click here to see examples

#

project <- file.path(getDemoPath(), "1.creating_and_using_models",  "1.1.libraries_of_models", "warfarinPKPD_project.mlxtran")

loadProject(project)

# get observation model names available in the current project

getObservationInformation()$name

# set the distributions and the limits for the logitNormal distribution

setObservationDistribution(y1 = "logNormal", y2 = "logitNormal")

setObservationLimits(y2 = c(0, 100))

getContinuousObservationModel()$distribution


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Set observation model distribution limits for logitNormal observations

Description

Set observation model distribution limits for logitNormal observations.
Set the minimum and the maximum values between which observations
must fall. Used only if the distribution of the error model is
“logitNormal”. To set the observation distribution to “logitNormal”, use
setObservationDistribution. Call getObservationInformation to get the
observation model names present in the current project. Only specified observations will be changed.

Usage

setObservationLimits(...)

Arguments

... A list of comma-separated pairs {observationModel = c((double) min,
(double) max) }

See Also

getContinuousObservationModel get the current observation model for the current project
getObservationInformation to get the continuous observations present in the current project

Set components of the continuous observation model:
setObservationDistribution
setErrorModel

Click here to see examples

#

project <- file.path(getDemoPath(), "1.creating_and_using_models",  "1.1.libraries_of_models", "warfarinPKPD_project.mlxtran")

loadProject(project)

# get observation model names available in the current project

getObservationInformation()$name

# set the distribution to logitNormaland then set the limits

setObservationDistribution(y2 = "logitNormal")

setObservationLimits(y2 = c(0, 100))

getContinuousObservationModel()$limits


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Generate Bivariate observations plots

Description

Plot the bivariate viewer.

Usage

plotBivariateDataViewer(
  obs1 = NULL,
  obs2 = NULL,
  settings = list(),
  stratify = list(),
  preferences = list()
)

Arguments

obs1 (character) Name of the observation to display in x axis (in dataset header).
By default the first observation is considered.
obs2 (character) Name of the observation to display in y axis (in dataset header).
By default the second observation is considered.
settings List with the following settings

  • dots (logical) – If TRUE individual observations are displayed as dots (default TRUE).
  • lines (logical) – If TRUE individual observations are displayed as lines (default TRUE).
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (logical) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (logical) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (character) label on x axis (Name of obs1 by default).
  • ylab (character) label on y axis (Name of obs2 by default).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • xlim (c(double, double)) limits of the x axis.
  • ylim (c(double, double)) limits of the y axis.
  • fontsize (integer) Plot text font size.
  • units (logical) Set units in axis labels (only available with PKanalix).
  • scales (character) Should scales be fixed (“fixed”),
    free (“free”, the default), or free in one dimension (“free_x”, “free_y”) (default “free”).
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.
  • color (vector<character>) – Vector of covariates used for coloring (by default no coloring is applied). For instance c("FORM","AGE").
  • colors – Vector of colors to use when color argument is used. Takes precedence over colors defined in preferences. For instance c("#ebecf0","#cdced1","#97989c").
  • individualSelection – Ids to display (by default the 12 first ids are displayed) defined as:
    • indices (vector<integer>) – Indices of the individuals to display (by default, the 12 first individuals are selected). If occasions are present, all occasions of the selected individuals will be displayed. Takes precedence over ids. For instance c(5,6,10,11).
    • isRange (logical) – If TRUE, all individuals whose index is inside [min(indices), max[indices]] are selected (FALSE by default).
      Forced to FALSE if ids is defined.
    • ids (vector<character>) – Names of the individuals to display. If occasions are present, all occasions of the selected individuals will be displayed. For instance c("101-01","101-02","101-03"). If ids are integers, can also be c(1,3,6).
      Ignored if indices is defined.
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotBivariateDataViewer”) to check available displays.

Value

A ggplot object

See Also

getPlotPreferences

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "warfarinPKPD_project.mlxtran")

  loadProject(project)

  plotBivariateDataViewer(obs1 = "y1", obs2 = "y2")

  plotBivariateDataViewer(settings = list(lines = FALSE))

  # stratification

  plotBivariateDataViewer(obs1 = "y1", obs2 = "y2", stratify = list(individualSelection = list(indices = 10)))

  plotBivariateDataViewer(stratify = list(split = "age",

                                          filter = list("sex", "1"),

                                          groups = list(name = "age", definition = c(25))))

  plotBivariateDataViewer(stratify = list(color = "wt",

                                          groups = list(name = "wt", definition = 75)))

  plotBivariateDataViewer(stratify = list(split = c("age", "sex"),

                                          groups = list(name = "age", definition = 25)))

  # update plot settings or preferences

  plotBivariateDataViewer(preferences = list(obs = list(color = "#32CD32")))


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Generate Covariate plots

Description

Plot the covariates.

Usage

plotCovariates(
  covariatesRows = NULL,
  covariatesColumns = NULL,
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

covariatesRows vector with the name of covariates to display on rows
(by default the first 4 covariates are displayed).
covariatesColumns vector with the name of covariates to display on columns
(by default the first 4 covariates are displayed).
settings List with the following settings

  • regressionLine (logical) If TRUE, Add regression line in scatterplots (default TRUE).
  • spline (logical) If TRUE, Add xpline in scatterplots (default FALSE).
  • histogramColors (vector<character>) List of colors to use in histograms plots.
  • histogramPosition (character) Type of histogram: “stacked”, “grouped” or
    “default” (histograms with categorical covariates in xaxis the plot is grouped else it is stacked),
    (Default is “default”)
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • bins (integer) number of bins for the histogram (default 10)
  • fontsize (integer) Plot text font size.
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotCovariates”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.
  • color (vector<character>) – Vector of covariates used for coloring (by default no coloring is applied). For instance c("FORM","AGE").
  • colors – Vector of colors to use when color argument is used. Takes precedence over colors defined in preferences. For instance c("#ebecf0","#cdced1","#97989c").
  • individualSelection – Ids to display (by default the 12 first ids are displayed) defined as:
    • indices (vector<integer>) – Indices of the individuals to display (by default, the 12 first individuals are selected). If occasions are present, all occasions of the selected individuals will be displayed. Takes precedence over ids. For instance c(5,6,10,11).
    • isRange (logical) – If TRUE, all individuals whose index is inside [min(indices), max[indices]] are selected (FALSE by default).
      Forced to FALSE if ids is defined.
    • ids (vector<character>) – Names of the individuals to display. If occasions are present, all occasions of the selected individuals will be displayed. For instance c("101-01","101-02","101-03"). If ids are integers, can also be c(1,3,6).
      Ignored if indices is defined.

Details

Generate scatterplots between two continuous covariates or bar plot between categorical covariates.

Value

  • A ggplot object if one element in covariatesRows and covariatesColumns,
  • A TableGrob object if multiple plots (output of grid.arrange)

See Also

getPlotPreferences

Click here to see examples

#

  project <- file.path(getDemoPath(), "2.case_studies/project_Theo_extravasc_SD.pkx")

  loadProject(project)

  # covariate distribution when only one covariate is specified

  plotCovariates(covariatesRows = "HT", settings = list(bins = 10))

  # scatter plot when both covariates are continuous

  plotCovariates(covariatesRows = "HT", covariatesColumns = "AGE", settings = list(spline = TRUE))

  plotCovariates(covariatesRows = "HT", covariatesColumns = c("AGE", "FORM"))

  # box plot when one covariate is categorical and the othe one is continuous

  preferences <- list(boxplot = list(fill = "#2075AE"), boxplotOutlier = list(shape = 3))

  plotCovariates(covariatesRows = "FORM", covariatesColumns = "AGE", preferences = preferences)

  # histogram when covariate on column is categorical

  plotCovariates(covariatesRows = "FORM", covariatesColumns = "SEQ",

                 settings = list(histogramColors = c("#5DC088", "#DBA92B")))

  plotCovariates(covariatesRows = "AGE", covariatesColumns = "SEQ",

                 settings = list(histogramColors = c("#5DC088", "#DBA92B")))

  # stratification

  plotCovariates(covariatesRows = "HT", covariatesColumns = "WT",

                 stratify = list(split = "AGE",

                                 filter = list("Period", 1),

                                 groups = list(name = "AGE", definition = 25)))

  preferences <- list(regressionLine = list(color = "#E5551B"))

  plotCovariates(covariatesRows = "AGE", covariatesColumns = "WT",

                 stratify = list(color = "HT",

                                 groups = list(name = "HT", definition = 181),

                                 colors = c("#2BB9DB", "#DD6BD2")),

                 preferences = preferences)

  plotCovariates(covariatesRows = "HT", covariatesColumns = "WT",

                 stratify = list(split = c("AGE", "SEQ"),

                                 groups = list(name = "AGE", definition = 25)))

  # Mulitple covariates

  plotCovariates()

  plotCovariates(covariatesRows = c("AGE", "SEQ", "HT"), covariatesColumns = c("AGE", "SEQ", "HT"))

  plotCovariates(stratify = list(filter = list("AGE", 2),

                                 groups = list(name = "AGE", definition = c(25, 30))))


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Generate Observed data plot

Description

Plot the observed data.

Usage

plotObservedData(
  obsName = NULL,
  settings = list(),
  stratify = list(),
  preferences = list()
)

Arguments

obsName (character) Name of the observation (if several OBS ID).
By default the first observation is considered.
settings List with the following settings:
[CONTINUOUS – DISCRETE] Settings specific to continuous and discrete data

  • dots (logical) – If TRUE individual observations are displayed as dots (default TRUE).
  • lines (logical) – If TRUE individual observations are displayed as lines (default TRUE).
  • mean (logical) – If TRUE mean of observations is displayed (default FALSE for Monolix, TRUE for PKanalix).
  • error (logical) If TRUE error bar is displayed (default FALSE for Monolix, TRUE for PKanalix).
  • meanMethod (character) – When mean is set to TRUE, display arithmetic mean (“arithmetic”) or
    geometric mean (“geometric”). Default value is “arithmetic”.
  • errorMethod (character) – When error is set to TRUE, display standard deviation (“standardDeviation”) or
    standard error (“standardError”). Default value is “standardDeviation”.
  • useCensored (logical) If TRUE, use censored data to compute mean and error (default FALSE)
  • timeAfterLastDose (logical) If TRUE, display observations as relative to the previous dose for the x-axis (default FALSE)
    Can be applied only for continuous and discrete data with dose information, and if xvariable is different from “regressor”.
  • xvariable (character) Choose information to use on x-axis, one of “time”, “nominalTime” or a regressor name (default “time”)
    For event data, plot against regressor value is not available.
  • binLimits (logical) – If TRUE, bins limits are displayed as vertical lines (default FALSE).
  • binsSettings a list of settings for time axis binning for observation statistics computation:
    • criteria (character) – Binning criteria, one of ‘equalwidth’, ‘equalsize’, or ‘leastsquare’ methods.
      (default “leastsquare”).
    • is.fixedNbBins (logical) – If TRUE, a fixed number of bins is used (see nbBins). If FALSE (default), the number of bins is optimized using binRange and nbBinData.
    • nbBins (integer) – Number of bins (default 10). Ignored if is.fixedNbBins=FALSE.
    • binRange (vector(integer, integer)) – Minimum and maximum number of bins when bins are optimized (default c(5, 100)).
    • nbBinData (vector(integer, integer)) – Minimum and maximum number of data points per bin when bins are optimized (default c(10, 200) for Monolix and c(3, 200) for PKanalix).

[DISCRETE] Settings specific to discrete data

  • plot (character) Type of plot: “continuous” (default), “stacked” or “grouped”.
  • histogramColors (vector<character>) List of colors to use in histograms plots.

[EVENT] Settings specific to event data

  • eventPlot – Display Survival function (“survivalFunction”) or mean number of
    events per subject (“averageEventNumber”) (default “survivalFunction”).

Other settings

  • cens (logical) – If TRUE censored data are displayed as dots (default TRUE).
  • dosingTimes (logical) – If TRUE, dosing times are displayed as vertical lines (default FALSE). Cannot be used if timeAfterLastDose=TRUE.
  • legend (logical) – If TRUE, plot legend is displayed (default FALSE).
  • grid (logical) – If TRUE, plot grid is displayed (default TRUE).
  • xlog (logical) – If TRUE, log-scale on x axis is used (default FALSE).
  • ylog (logical) – If TRUE, log-scale on y axis is used (default FALSE).
  • xlab (character) – Label on x axis (default “time”).
  • ylab (character) – Label on y axis (default obsName).
  • ncol (integer) – Number of columns when using split (default 4).
  • xlim (c(double, double)) – Limits of the x axis.
  • ylim (c(double, double)) – Limits of the y axis.
  • fontsize (integer) – Font size of text elements (default 11).
  • units (logical) – If TRUE, units are added in axis labels (default TRUE) (only available with PKanalix).
  • scales (character) Should scales be fixed (“fixed”), free (“free”, default), or free in one dimension (“free_x”, “free_y”).
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • mergedSplits (logical) – When “split” is used and mean=T, should the means of the different groups be displayed on the same plot (TRUE)
    or on different subplots (FALSE, default). Not available for count/categorical data. When mergedSplits=T, the “color” argument is ignored and the coloring is done according to the splitted groups.
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.
  • color (vector<character>) – Vector of covariates used for coloring (by default no coloring is applied). For instance c("FORM","AGE").
  • colors – Vector of colors to use when color argument is used. Takes precedence over colors defined in preferences. For instance c("#ebecf0","#cdced1","#97989c").
  • individualSelection – Ids to display (by default the 12 first ids are displayed) defined as:
    • indices (vector<integer>) – Indices of the individuals to display (by default, the 12 first individuals are selected). If occasions are present, all occasions of the selected individuals will be displayed. Takes precedence over ids. For instance c(5,6,10,11).
    • isRange (logical) – If TRUE, all individuals whose index is inside [min(indices), max[indices]] are selected (FALSE by default).
      Forced to FALSE if ids is defined.
    • ids (vector<character>) – Names of the individuals to display. If occasions are present, all occasions of the selected individuals will be displayed. For instance c("101-01","101-02","101-03"). If ids are integers, can also be c(1,3,6).
      Ignored if indices is defined.
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotObservedData”) to check available options.

Value

A ggplot object

See Also

getPlotPreferences

Click here to see examples

#

  project <- paste0(getDemoPath(), "/2.case_studies/project_aPCSK9_SAD.pkx")

  loadProject(project)

  # by default, individual profiles and mean curve are displayed

  plotObservedData()

  # displaying dots and mean curve by dose group, merged on a single plot

  plotObservedData(settings=list(lines=F,

                            mean=T,

                            meanMethod="geometric",

                            ylog=T,

                            ylab="mAb concentration (ug/mL)"),

              stratify=list(split="DOSE_mg",

                            mergedSplits=T),

              preferences=list(observationStatistics=list(lineWidth=0.8),

                               obs=list(radius=2)))

  # coloring by ID, without mean curve

  plotObservedData(settings=list(mean=F,error=F),

              stratify = list(color=c("id")))

  # changing the settings to display only the mean curve with SE, with bin limits and dosing times

  plotObservedData(settings=list(dots=F,

                            lines=F,

                            mean=T,

                            error=T,

                            meanMethod="geometric",

                            errorMethod="standardError",

                            useCensored=T,

                            binLimits=T,

                            binsSettings=list(criteria="leastsquare", is.fixedNbBins=T, nbBins=20),

                            cens=F,

                            dosingTimes=T,

                            legend=T,

                            grid=F,

                            xlog=F,ylog=T,

                            xlab="Time since first dose (days)",

                            ylab="mAb concentration (ug/mL)",

                            xlim=c(0,96),

                            ylim=c(0.1,70),

                            fontsize=12,

                            units=F))

  # changing preferences for observations, censored observations and bin limits

  plotObservedData(settings=list(dots=T, lines=T, legend=T, dosingTimes=T, mean=F, error=F, ylog=T, cens=T),

              preferences=list(obs=list(color="#161617",

                                        radius=2,

                                        shape=18,

                                        lineWidth=0.2,

                                        lineType="dashed",

                                        legend="Observations"),

                               censObs=list(color="#cdced1",

                                            radius=2,

                                            shape=16,

                                            legend="Censored observations"),

                               dosingTimes=list(color="#fcba03",

                                                lineWidth=0.5,

                                                lineType="solid",

                                                legend="Time of doses")))

  # changing preferences for mean and bin limits

  plotObservedData(settings=list(dots=F, lines=F, legend=T, binLimits=T, grid=F),

              preferences=list(observationStatistics=list(color="#161617",

                                                          whiskersWidth=3,

                                                          lineWidth=0.7,

                                                          lineType="solid",

                                                          legend="mean and standard deviation over bins"),

                               binsValues=list(color="#cdced1",

                                               lineWidth=0.5,

                                               lineType="dashed",

                                               legend="bins")))

  # color and split by DOSE_mg but grouping two doses levels together

  plotObservedData(settings=list(mean=F,error=F,ylim=c(0,120)),

              stratify = list(groups=list(name="DOSE_mg",definition=list(c("150mg"), c("300mg","800mg"))),

                              color="DOSE_mg",

                              split="DOSE_mg"))

  # selecting only one individual

  plotObservedData(settings=list(mean=F,error=F),

                   stratify = list(individualSelection=list(indices=1)))

  plotObservedData(settings=list(mean=F,error=F),

                   stratify = list(individualSelection=list(ids="1")))

  #============= projects with several covariates to stratify

initializeLixoftConnectors(software = "pkanalix", force=T)

project <- file.path(getDemoPath(), "/2.case_studies/project_Theo_extravasc_SD.pkx")

loadProject(project)

# defining groups for AGE and HT, coloring by HT and filtering by AGE

plotObservedData(settings=list(mean=F,error=F),

            stratify = list(groups=list(list(name="AGE", definition=c(24, 34)),

                                        list(name="HT", definition=c(184.5))),

                            color="HT",

                            colors=c("#cdced1","#161617"),

                            filter=list("AGE",c(1,3))))

# filter to keep only second sequence (TR) and FORM=test

plotObservedData(settings=list(mean=F,error=F),

            stratify = list(filter=list(list("SEQ",2),list("FORM","test"))))

  #============= project with time-to-event data

initializeLixoftConnectors(software = "monolix", force=T)

project <- file.path(getDemoPath(), "/4.joint_models/4.2.continuous_noncontinuous/PKrtte_project.mlxtran")

loadProject(project)

# survival Kaplan-Meier curve

plotObservedData(obsName="Hemorrhaging")

# mean number of events

plotObservedData(obsName="Hemorrhaging",

                 settings=list(eventPlot="averageEventNumber"))

#============= project with categorical data

initializeLixoftConnectors(software = "monolix", force=T)

project <- file.path(getDemoPath(), "/4.joint_models/4.2.continuous_noncontinuous/warfarin_cat_project.mlxtran")

loadProject(project)

# display is the same as for continuous data by default

plotObservedData(obsName="Level")

# display as stacked or as grouped

plotObservedData(obsName="Level", settings=list(plot="stacked"))

plotObservedData(obsName="Level", settings=list(plot="grouped"))

# splitting by sex

plotObservedData(obsName="Level", 

                 settings=list(plot="stacked", ylim=c(0,30), legend=T),

                 stratify=list(split="sex"))

#============== project with multiple-dose to show timeAfterLastDose

initializeLixoftConnectors(software = "monolix", force=T)

project <- file.path(getDemoPath(), "/6.PK_models/6.3.multiple_doses/addl_project.mlxtran")

loadProject(project)

# with "time after first dose" by default

plotObservedData()

# with "time since previous dose"

plotObservedData(settings=list(timeAfterLastDose=T))

#============= project with regressor to show regressor on x-axis

initializeLixoftConnectors(software = "monolix", force=T)

project <- file.path(getDemoPath(), "/7.miscellaneous/7.1.regression_variables/reg3_warfarinPD_linearInterp_project.mlxtran")

loadProject(project)

# with "time" on x-axis by default

plotObservedData()

# with regressor "Cc" (concentration) on x-axis

plotObservedData(settings=list(xvariable="Cc"))

#============= project with nominal time on x-axis

initializeLixoftConnectors(software = "pkanalix", force=T)

project <- file.path(getDemoPath(), "/1.basic_examples/project_nominal_time.pkx")

loadProject(project)

# with "actual time" by default

plotObservedData()

# with nominal time on x-axis

plotObservedData(settings=list(xvariable="nominalTime"))


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Plot Importance sampling convergence.

Description

Plot iterations of the likelihood estimation by importance sampling.

Usage

plotImportanceSampling(settings = list())

Arguments

settings a list of optional settings:

  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • fontsize (integer) Plot text font size.

Value

A ggplot object

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  runLogLikelihoodEstimation()

  plotImportanceSampling()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Plot MCMC convergence

Description

Plot iterations and convergence for the conditional distribution task.

Usage

plotMCMC(settings = list())

Arguments

settings a list of optional settings:

  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • fontsize (integer) Plot text font size.

Value

A TableGrob object if multiple plots (output of grid.arrange)

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  runConditionalDistributionSampling()

  plotMCMC()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Plot SAEM convergence

Description

Plot iterations and convergence for the SAEM algorithm (population parameters estimation).

Usage

plotSaem(settings = list())

Arguments

settings a list of optional settings:

  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • fontsize (integer) Plot text font size.

Value

A TableGrob object if multiple plots (output of grid.arrange)

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  plotSaem()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Distribution of the individual parameters computed by Monolix

Description

Plot the distribution of the individual parameters.

Usage

plotParametersDistribution(
  parameters = NULL,
  plot = "pdf",
  settings = list(),
  preferences = NULL,
  stratify = list()
)

Arguments

parameters vector of parameters to display.
(by default the first 4 computed parameters are displayed).
plot (character) Type of plot: probability density distribution (“pdf”),
cumulative density distribution (“cdf”) (default “pdf)
settings a list of optional plot settings:

  • indivEstimate Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”), conditional distribution (“simulated”)
    (default “simulated”).
  • empirical (logical) If TRUE, plot empirical density distribution (default TRUE).
  • theoretical (logical) If TRUE, plot theoretical density distribution (default TRUE).
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • fontsize (integer) Plot text font size.
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotParametersDistribution”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.

Value

  • A ggplot object if one parameter,
  • A TableGrob object if multiple plots (output of grid.arrange)

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  runConditionalDistributionSampling()

  plotParametersDistribution(parameters = "ka")

  plotParametersDistribution(parameters = "Cl", plot = "pdf")

  plotParametersDistribution(parameters = "ka", plot = "cdf")

  plotParametersDistribution(parameters = "ka", plot = "cdf",

                             settings = list(indivEstimate = "simulated"))

  plotParametersDistribution(parameters = "Cl", plot = "pdf",

                             settings = list(theoretical = F))

  # stratification

  plotParametersDistribution(stratify = list(filter = list("WEIGHT", 1),

                                             groups = list(name = "WEIGHT", definition = 75)))

  plotParametersDistribution(parameters = "Cl", stratify = list(split = "SEX"))

  # update preferences

  preferences = list(theoretical = list(color = "#B4468A", lineType = "solid", lineWidth = 0.8))

  plotParametersDistribution(parameters = "ka", plot = "cdf", preferences = preferences)

  # multiple plots

  plotParametersDistribution(parameters = c("ka", "Cl"))

  plotParametersDistribution(plot = "pdf")

  plotParametersDistribution(plot = "cdf")

  plotParametersDistribution(plot = "cdf", settings = list(indivEstimate = "simulated"))

  plotParametersDistribution(plot = "pdf", settings = list(theoretical = F))


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Individual monolix parameter vs covariate plot.

Description

Plot individual parameters vs covariates.

Usage

plotParametersVsCovariates(
  parameters = NULL,
  covariates = NULL,
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

parameters vector of parameters to display.
(by default the first 4 computed parameters are displayed).
covariates vector of covariates to display.
(by default the first 4 computed covariates are displayed).
settings List with the following settings

  • indivEstimate Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”), conditional distribution (“simulated”)
    (default “simulated”).
  • parameterType (character) display random effect vs covariates (“randomEffect”),
    or transformed individual parameters vs covariates (“indivParameter”)
    (default “indivParameter”).
  • boxplotData (character) for categorical covariate, if boxplotData
    is not NULL, data are added as dots over the boxplot. They can be either “spread” on the box
    or “aligned” (default NULL)
  • regressionLine (logical) If TRUE, Add regression line in scatterplots (default TRUE).
  • spline (logical) If TRUE, Add xpline in scatterplots (default FALSE).
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • fontsize (integer) Plot text font size.
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotParametersVsCovariates”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.
  • color (vector<character>) – Vector of covariates used for coloring (by default no coloring is applied). For instance c("FORM","AGE").
  • colors – Vector of colors to use when color argument is used. Takes precedence over colors defined in preferences. For instance c("#ebecf0","#cdced1","#97989c").

Value

  • A ggplot object if one covariate and one parameter in argument,
  • A TableGrob object if multiple plots (output of grid.arrange)

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  runConditionalDistributionSampling()

  # Individual parameters

  plotParametersVsCovariates(covariates = "SEX", parameters = "Cl")

  plotParametersVsCovariates(covariates = "WEIGHT", parameters = "V", settings = list(spline = T))

  plotParametersVsCovariates(covariates = "WEIGHT", parameters = "V",

                             settings = list(indivEstimate = "simulated"))

  # Random effects

  plotParametersVsCovariates(covariates = "SEX", parameters = "V",

                             settings = list(parameterType = "randomEffect"))

  plotParametersVsCovariates(covariates = "WEIGHT", parameters = "V",

                             settings = list(indivEstimate = "simulated", parameterType = "randomEffect"))

  # Stratification

  plotParametersVsCovariates(covariates = "SEX", parameters = "ka",

                             stratify = list(filter = list("WEIGHT", 1),

                                             groups = list(name = "WEIGHT", definition = 75)))

  plotParametersVsCovariates(covariates = "WEIGHT", parameters = "ka",

                             stratify = list(split = "SEX"))

  plotParametersVsCovariates(covariates = "SEX", parameters = "Cl",

                             stratify = list(color = "WEIGHT",

                                             groups = list(name = "WEIGHT", definition = 75)))

  plotParametersVsCovariates(covariates = "WEIGHT", parameters = "V",

                             stratify = list(color = "SEX"))

  plotParametersVsCovariates(covariates = "WEIGHT", parameters = "V",

                             stratify = list(color = c("SEX", "WEIGHT"),

                                             groups = list(name = "WEIGHT", definition = 70)))

  # multiple plots

  plotParametersVsCovariates()

  plotParametersVsCovariates(covariates = "WEIGHT")

  plotParametersVsCovariates(settings = list(indivEstimate = "simulated"))

  plotParametersVsCovariates(settings = list(parameterType = "randomEffect"))

  plotParametersVsCovariates(settings = list(parameterType = "randomEffect", indivEstimate = "simulated"))

  plotParametersVsCovariates(stratify = list(color = "WEIGHT",

                                             groups = list(name="WEIGHT", definition = 75)))

  plotParametersVsCovariates(stratify = list(color = "SEX"))


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Correlations between random effect.

Description

Plot correlations between random effects.

Usage

plotRandomEffectsCorrelation(
  parametersRows = NULL,
  parametersColumns = NULL,
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

parametersRows vector with the name of parameters to display on rows
(by default the first 4 computed parameters are displayed).
parametersColumns vector with the name of parameters to display on columns
(by default parametersColumns = parametersRows).
settings List with the following settings

  • indivEstimate Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”), conditional distribution (“simulated”)
    (default “simulated”).
  • variabilityLevel (character) In case of IOV and if the conditional distribution is computed plot is displayed for
    one given level of variability (default NULL)
    If NULL, the variability level is ID + Occasions
    Run getVariabilityLevels() to see the available levels of variability
  • decorrelated (logical) If TRUE, plot the decorrelated random effects instead of the random effects (default FALSE).
    Decorrelated random effects are available only if the model contains correlations terms between the random effects.
  • regressionLine (logical) If TRUE, Add regression line in scatterplots (default TRUE).
  • spline (logical) If TRUE, Add xpline in scatterplots (default FALSE).
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • fontsize (integer) Plot text font size.
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotRandomEffectsCorrelation”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.
  • color (vector<character>) – Vector of covariates used for coloring (by default no coloring is applied). For instance c("FORM","AGE").
  • colors – Vector of colors to use when color argument is used. Takes precedence over colors defined in preferences. For instance c("#ebecf0","#cdced1","#97989c").

Value

  • A ggplot object if one element in parametersRows and parametersColumns,
  • A TableGrob object if multiple plots (output of grid.arrange)

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  runConditionalDistributionSampling()

  plotRandomEffectsCorrelation()

  plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",

                               settings = list(indivEstimate = "simulated"))

  plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",

                               settings = list(spline = TRUE))    

  plotRandomEffectsCorrelation(settings = list(indivEstimate = "mean"))

  plotRandomEffectsCorrelation(parametersRows = c("ka", "V"))

  # stratification

  plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",

                               stratify = list(filter = list("SEX", "M")))

  plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",

                               stratify = list(color = "WEIGHT",

                                               groups = list(name = "WEIGHT", definition = 75),

                                               colors = c("#46B4AF", "#B4468A")))

  plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",

                               stratify = list(split = "SEX"))

  plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",

                               stratify = list(split = c("SEX", "WEIGHT"),

                                               groups = list(name = "WEIGHT", definition = 70)))


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Distribution of the standardized random effects.

Description

Plot the distribution of the standardized random effects.

Usage

plotStandardizedRandomEffectsDistribution(
  parameters = NULL,
  plot = "boxplot",
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

parameters vector of parameters to display.
(by default the first 4 computed parameters are displayed).
plot Type of plot: probability density distribution (“pdf”),
cumulative density distribution (“cdf”), boxplot (“boxplot”)
(default “boxplot”).
settings a list of optional plot settings:

  • indivEstimate Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”), conditional distribution (“simulated”)
    (default “mode”).
  • variabilityLevel (logical) In case of IOV and if the conditional distribution is computedplot is displayed for
    one given level of variability (default NULL)
    If NULL, the variability level is ID + Occasions
    Run getVariabilityLevels() to see the available levels of variability
  • empirical (logical) If TRUE, plot empirical density distribution(default TRUE).
    To define when plot is “pdf” or “cdf”
  • theoretical (logical) If TRUE, plot theoretical density distribution(default TRUE).
    To define when plot is “pdf” or “cdf”
  • median (logical) If TRUE, add median line (default TRUE).
    To define when plot is “boxplot”
  • quartile (logical) If TRUE, add quartile line (default TRUE).
    To define when plot is “boxplot”
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • fontsize (integer) Plot text font size.
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotStandardizedRandomEffectsDistribution”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.

Value

  • A ggplot object if one parameter,
  • A TableGrob object if multiple plots (output of grid.arrange)

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  runConditionalDistributionSampling()

  runConditionalModeEstimation()

  # Random effect distribution as boxplot

  plotStandardizedRandomEffectsDistribution(parameters = "ka", plot = "boxplot")

  plotStandardizedRandomEffectsDistribution(parameters = "ka", plot = "boxplot",

                                            settings = list(indivEstimate = "mode"))

  plotStandardizedRandomEffectsDistribution(parameters = "ka", plot = "boxplot",

                                            settings = list(quartile = F))

  # Random effect distribution as pdf

  plotStandardizedRandomEffectsDistribution(parameters = "ka", plot = "pdf")

  plotStandardizedRandomEffectsDistribution(parameters = "ka", plot = "pdf",

                                            settings = list(empirical = F))

  plotStandardizedRandomEffectsDistribution(parameters = "ka", plot = "pdf",

                                            settings = list(theoretical = F))

  # Random effect distribution as cdf

  plotStandardizedRandomEffectsDistribution(parameters = "ka", plot = "cdf")

  plotStandardizedRandomEffectsDistribution(parameters = "ka", plot = "cdf",

                                            settings = list(indivEstimate = "simulated"))

  plotStandardizedRandomEffectsDistribution(parameters = "ka", plot = "cdf",

                                            settings = list(theoretical = F))

  # stratification

  plotStandardizedRandomEffectsDistribution(stratify = list(filter = list("WEIGHT", 1),

                                                            groups = list(name = "WEIGHT", definition = 75)))

  plotStandardizedRandomEffectsDistribution(parameters = "Cl",

                                            stratify = list(split = "SEX"))

  plotStandardizedRandomEffectsDistribution(parameters = c("ka", "Cl"))

  plotStandardizedRandomEffectsDistribution(plot = "boxplot")

  plotStandardizedRandomEffectsDistribution(plot = "pdf")

  plotStandardizedRandomEffectsDistribution(plot = "cdf")

  plotStandardizedRandomEffectsDistribution(plot = "pdf", settings = list(theoretical = F))


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Plot Monolix Individual Fits

Description

Plot the individual fits.

Usage

plotIndividualFits(
  obsName = NULL,
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

obsName (character) Name of the observation (in dataset header).
By default the first observation is considered.
settings List with the following settings

  • indivEstimate (character) Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”)
    (default “mode”) .
  • obsDots (logical) – If TRUE individual observations are displayed as dots (default TRUE).
  • obsLines (logical) – If TRUE individual observations are displayed as lines (default FALSE).
  • cens (logical) – If TRUE censored intervals are displayed (default TRUE).
  • indivFits (logical) – If TRUE individual fits are displayed (default TRUE).
  • popFits (logical) – If TRUE population fits (typical individual) are displayed (default FALSE).
  • popCov (logical) – If TRUE population fits (individual covariates) are displayed (default FALSE).
  • predMedian (logical) – If TRUE median of individual fits computed based on multiple simulations (default FALSE).
  • predInterval (logical) – If TRUE 90 % prediction interval of individual fits computed based on multiple simulations (default FALSE).
  • splitOccasions (logical) – If TRUE occasions are displayed on separate plots (default TRUE).
  • dosingTimes (logical) – Add dosing times as vertical lines (default FALSE).
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (logical) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (logical) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (character) label on x axis (default “Time”).
  • ylab (character) label on y axis (default obsName).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • xlim (c(double, double)) limits of the x axis.
  • ylim (c(double, double)) limits of the y axis.
  • fontsize (integer) Plot text font size.
  • scales (character) Should scales be fixed (“fixed”),
    free (“free”, the default), or free in one dimension (“free_x”, “free_y”) (default “free”).
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotIndividualFits”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.
  • color (vector<character>) – Vector of covariates used for coloring (by default no coloring is applied). For instance c("FORM","AGE").
  • colors – Vector of colors to use when color argument is used. Takes precedence over colors defined in preferences. For instance c("#ebecf0","#cdced1","#97989c").
  • individualSelection – Ids to display (by default the 12 first ids are displayed) defined as:
    • indices (vector<integer>) – Indices of the individuals to display (by default, the 12 first individuals are selected). If occasions are present, all occasions of the selected individuals will be displayed. Takes precedence over ids. For instance c(5,6,10,11).
    • isRange (logical) – If TRUE, all individuals whose index is inside [min(indices), max[indices]] are selected (FALSE by default).
      Forced to FALSE if ids is defined.
    • ids (vector<character>) – Names of the individuals to display. If occasions are present, all occasions of the selected individuals will be displayed. For instance c("101-01","101-02","101-03"). If ids are integers, can also be c(1,3,6).
      Ignored if indices is defined.

Details

Only available for Continuous data.

Value

A ggplot object

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  runConditionalDistributionSampling()

  runConditionalModeEstimation()

  plotIndividualFits()

  plotIndividualFits(settings=list(popFits = T))

  plotIndividualFits(settings=list(obsLines = T, obsDots = F, predInterval = T))

  plotIndividualFits(settings=list(dosingTimes = T))

  # stratification options

  plotIndividualFits(stratify = list(individualSelection = list(ids = c(1, 2, 3, 4))))

  plotIndividualFits(stratify = list(individualSelection = list(indices = c(1, 4), isRange = TRUE)))

  plotIndividualFits(stratify = list(filter = list("WEIGHT", 2),

                                     groups = list(name = "WEIGHT", definition = c(60, 75))))

  plotIndividualFits(stratify = list(filter = list("SEX", "F")))

  plotIndividualFits(stratify = list(color = "SEX",

                                     colors=c("#5DC088", "#DBA92B")))

  plotIndividualFits(settings = list(legend = T),

                     stratify = list(color = c("SEX", "WEIGHT"),

                                     groups = list(name = "WEIGHT", definition = 70)))

  # settings and preferences options

  plotIndividualFits(settings = list(ylog = T, ylim = c(0.8, 11)))

  preferences <- list(popFits = list(lineType = "solid", legend = "Population fits"))

  plotIndividualFits(settings = list(popFits = T), preferences = preferences)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Plot Observation VS Prediction

Description

Plot the observation vs the predictions.

Usage

plotObservationsVsPredictions(
  obsName = NULL,
  predictions = c("indiv"),
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

obsName (character) Name of the observation (in dataset header).
By default the first observation is considered.
predictions (character) LIst of predictions to display: population prediction (“pop”),
individual prediction (“indiv”)
(default c(“indiv”)).
settings List with the following settings

  • indivEstimate (character) Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”), conditional distribution (“simulated”)
    (default “mode”).
  • useCensored (logical) Choose to use BLQ data (TRUE) or to ignore it (FALSE)
    to compute the statistics (default TRUE).
  • censoring (character) BLQ data can be simulated (‘simulated’),
    or can be equal to the limit of quantification (‘loq’) (default ‘simulated’).
  • obs (logical) – If TRUE observations are displayed as dots (default TRUE).
  • cens (logical) – If TRUE censoring data are displayed as red dots (default TRUE).
  • spline (logical) – If TRUE add spline (default FALSE).
  • identityLine (logical) – If TRUE add identity line (default TRUE).
  • predInterval (logical) – If TRUE add 90% prediction interval (default FALSE).
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (logical) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (logical) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • xlim (c(double, double)) limits of the x axis.
  • ylim (c(double, double)) limits of the y axis.
  • fontsize (integer) Plot text font size.
  • scales (character) Should scales be fixed (“fixed”),
    free (“free”, the default), or free in one dimension (“free_x”, “free_y”) (default “free”).
  • ylab (character) label on y axis (default “Observations”).
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotObservationsVsPredictions”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.
  • color (vector<character>) – Vector of covariates used for coloring (by default no coloring is applied). For instance c("FORM","AGE").
  • colors – Vector of colors to use when color argument is used. Takes precedence over colors defined in preferences. For instance c("#ebecf0","#cdced1","#97989c").
  • individualSelection – Ids to display (by default the 12 first ids are displayed) defined as:
    • indices (vector<integer>) – Indices of the individuals to display (by default, the 12 first individuals are selected). If occasions are present, all occasions of the selected individuals will be displayed. Takes precedence over ids. For instance c(5,6,10,11).
    • isRange (logical) – If TRUE, all individuals whose index is inside [min(indices), max[indices]] are selected (FALSE by default).
      Forced to FALSE if ids is defined.
    • ids (vector<character>) – Names of the individuals to display. If occasions are present, all occasions of the selected individuals will be displayed. For instance c("101-01","101-02","101-03"). If ids are integers, can also be c(1,3,6).
      Ignored if indices is defined.

Value

  • A ggplot object if one prediction type,
  • A TableGrob object if multiple plots (output of grid.arrange)

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  runConditionalDistributionSampling()

  runConditionalModeEstimation()

  plotObservationsVsPredictions()

  plotObservationsVsPredictions(predictions = "pop")

  plotObservationsVsPredictions(prediction = "indiv", settings = list(indivEstimate = "simulated"))

  plotObservationsVsPredictions(settings = list(indivEstimate = "mean", spline = TRUE))

  plotObservationsVsPredictions(settings = list(indivEstimate = "mode", predInterval = TRUE))

  plotObservationsVsPredictions(settings = list(ylog = TRUE, xlog = TRUE))

  # stratification

  plotObservationsVsPredictions(stratify = list(filter = list("SEX", "F")))

  plotObservationsVsPredictions(stratify = list(split = "WEIGHT",

                                                groups = list(name = "WEIGHT", definition = 75)))

  plotObservationsVsPredictions(stratify = list(color = "WEIGHT",

                                                groups = list(name = "WEIGHT", definition = 75)))

  plotObservationsVsPredictions(settings = list(legend = T),

                                stratify = list(color = c("SEX", "WEIGHT"),

                                                groups = list(name = "WEIGHT", definition = 70)))

  # display multiple predictions

  plotObservationsVsPredictions(predictions = c("pop", "indiv"))


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Generate Distribution of the residuals

Description

Plot the distribution of the residuals.

Usage

plotResidualsDistribution(
  obsName = NULL,
  residuals = c("indiv", "npde"),
  plots = c("pdf", "cdf"),
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

obsName (character) Name of the observation (in dataset header).
By default the first observation is considered.
residuals (character) List of residuals to display:
population residuals (“pop”), individual residuals (“indiv”),
normalized prediction distribution error (“npde”)
(default c(“indiv”, “npde)).
plots Type of plots: probability density distribution (“pdf”),
cumulative density distribution (“cdf”)
(default c(“pdf”, “cdf”)).
settings List with the following settings

  • indivEstimate (character) Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”), conditional distribution (“simulated”)
    (default “simulated”).
  • useCensored (logical) Choose to use BLQ data (TRUE) or to ignore it (FALSE) to compute the statistics (default TRUE).
    For continuous data only.
  • censoring (character) BLQ data can be simulated (‘simulated’), or can be equal to the limit of quantification (‘loq’)
    (default ‘simulated’).
    For continuous data only.
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • fontsize (integer) Plot text font size.
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotResidualsDistribution”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.

Value

  • A ggplot object if one prediction type,
  • A TableGrob object if multiple plots (output of grid.arrange)

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  runConditionalDistributionSampling()

  plotResidualsDistribution()

  plotResidualsDistribution(residuals = "indiv", settings = list(indivEstimate = "simulated"))

  plotResidualsDistribution(residuals = "indiv", settings = list(indivEstimate = "mode"))

  plotResidualsDistribution(residuals = "pop", plots = "pdf")

  plotResidualsDistribution(residuals = "npde", plots = "cdf")

  plotResidualsDistribution(stratify = list(filter=list("SEX", "F")))

  plotResidualsDistribution(stratify = list(split = "WEIGHT",

                                            groups = list(name = "WEIGHT", definition = c(75))))

  plotResidualsDistribution(residuals = "indiv", settings = list(legend = T),

                            stratify = list(split = c("SEX", "WEIGHT"),

                                            groups = list(name = "WEIGHT", definition = 70)))

  plotResidualsDistribution()

  plotResidualsDistribution(residuals = c("indiv", "npde"), settings = list(indivEstimate = "simulated"))

  plotResidualsDistribution(residuals = c("pop", "indiv"), settings = list(indivEstimate = "mode"))

  plotResidualsDistribution(plots = c("pdf", "cdf"))

  plotResidualsDistribution(plots = c("cdf"))

  plotResidualsDistribution(residuals = "npde")


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Generate Scatter plots of the residuals

Description

Plot the scatter plots of the residuals.

Usage

plotResidualsScatterPlot(
  obsName = NULL,
  residuals = c("indiv"),
  xaxis = c("time", "prediction"),
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

obsName (character) Name of the observation (in dataset header).
By default the first observation is considered.
residuals (character) List of residuals to display:
population residuals (“pop”), individual residuals (“indiv”),
normalized prediction distribution error (“npde”)
(default c(“indiv”)).
xaxis (character) List of x-axis to display:
time (“time”), prediction (“prediction”)
(default c(“time”, “prediction”) for continuous data, c(“time”) for discrete data).
settings List with the following settings

  • indivEstimate (character) Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”), conditional distribution (“simulated”)
    (default “mode”).
    For continuous data only
  • level (integer) level for prediction intervals computation (default 90).
  • higherPercentile (integer) Higher percentile for empirical and predicted percentiles computation (default 90).
  • useCensored (logical) Choose to use BLQ data (TRUE) or to ignore it (FALSE) to compute the statistics (default TRUE).
    For continuous data only.
  • censoring (character) BLQ data can be simulated (‘simulated’), or can be equal to the limit of quantification (‘loq’)
    (default ‘simulated’).
    For continuous data only.
  • binsSettings a list of settings for bins:
    • criteria (character) Bining criteria, one of ‘equalwidth’, ‘equalsize’, or ‘leastsquare’ methods.
      (default leastsquare).
    • is.fixedNbBins (logical) If TRUE define a fixed number of bins, else define a range for automatic selection
      (default TRUE).
    • nbBins (integer) Define a fixed number of bins (default 10).
    • binRange (vector(integer, integer)) Define a range for the number of bins (default c(5, 100)).
    • nbBinData (vector(integer, integer)) Define a range for the number of data points per bin (default c(10, 200)).
  • residuals (logical) – If TRUE display residuals (default TRUE).
  • cens (logical) – If TRUE display censored data (default TUE).
  • empPercentiles (logical) – If TRUE display empirical percentiles (default FALSE).
  • predPercentiles (logical) – If TRUE display predicted percentiles (default FALSE).
  • predInterval (logical) – If TRUE, Prediction interval is displayed (default FALSE).
  • outlierDots (logical) – If TRUE Add red dots indicating empirical percentiles that are outside prediction intervals (default TRUE).
  • outlierAreas (logical) – If TRUE Add red areas indicating empirical percentiles that are outside prediction intervals (default TRUE).
  • spline (logical) – If TRUE display spline (default FALSE).
  • binLimits (logical) – If TRUE Add bins limits as vertical lines (default FALSE).
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (logical) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • xlim (c(double, double)) limits of the x axis.
  • ylim (c(double, double)) limits of the y axis.
  • fontsize (integer) Plot text font size.
  • scales (character) Should scales be fixed (“fixed”),
    free (“free”, the default), or free in one dimension (“free_x”, “free_y”) (default “free”).
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotResidualsScatterPlot”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.
  • color (vector<character>) – Vector of covariates used for coloring (by default no coloring is applied). For instance c("FORM","AGE").
  • colors – Vector of colors to use when color argument is used. Takes precedence over colors defined in preferences. For instance c("#ebecf0","#cdced1","#97989c").

Details

Note that ‘prediction interval’ setting is not available in 2021 version for this connector.

Value

  • A ggplot object if one prediction type,
  • A TableGrob object if multiple plots (output of grid.arrange)

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  runConditionalDistributionSampling()

  runConditionalModeEstimation()

  plotResidualsScatterPlot()

  plotResidualsScatterPlot(residuals = "indiv", settings = list(indivEstimate = "simulated"))

  plotResidualsScatterPlot(residuals = "indiv", settings = list(indivEstimate = "mode"))

  plotResidualsScatterPlot(xaxis = "prediction", residuals = "pop")

  plotResidualsScatterPlot(xaxis = "time", residuals = "pop")

  plotResidualsScatterPlot(residuals = "npde")

  plotResidualsScatterPlot(settings = list(spline = T))

  plotResidualsScatterPlot(settings = list(empPercentiles = T, level = 90,

                                           binsSettings = list(is.fixedNbBins = T, nbBins = 5),

                                           binLimits = T))

  plotResidualsScatterPlot(residuals = c("indiv", "pop"),

                           settings = list(indivEstimate = "simulated"))

  plotResidualsScatterPlot(residuals = "indiv", xaxis = c("prediction"),

                           settings = list(indivEstimate = "mode"))

  plotResidualsScatterPlot(xaxis = c("prediction"), residuals = c("indiv", "pop"))

  plotResidualsScatterPlot(residuals = "npde")

  # Stratification

  plotResidualsScatterPlot(stratify = list(filter = list("SEX", "F")))

  plotResidualsScatterPlot(stratify = list(split = "WEIGHT",

                                           groups = list(name = "WEIGHT", definition = c(75))))

  plotResidualsScatterPlot(stratify = list(color = "WEIGHT",

                                           groups = list(name = "WEIGHT", definition = c(75))))


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Plot BLQ predictive checks

Description

Plot the BLQ predictive checks.

Usage

plotBlqPredictiveCheck(
  obsName = NULL,
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

obsName (character) Name of the observation (in dataset header).
By default the first observation is considered.
settings a list of optional plot settings:

  • level (integer) level for prediction intervals computation (default 90).
  • nbPoints (integer) Number of points for grid computation (default 200).
  • censoredInterval (c(double, double)) Censored interval c(min, max) for censored data.
    By default, the limit and the censored values are used.
  • empirical (logical) If TRUE Empirical data is displayed (default TRUE).
  • theoretical (logical) If TRUE theoretical data is displayed (default FALSE):
  • predInterval (logical) If TRUE Prediction intervalis displayed (default TRUE).
  • outlierAreas (logical) If TRUE Add red areas indicating empirical percentiles that are outside prediction intervals (default TRUE).
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (logical) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (logical) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (character) label on x axis (default “Time”).
  • ylab (character) label on y axis (default obsName).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • xlim (c(double, double)) limits of the x axis.
  • ylim (c(double, double)) limits of the y axis.
  • fontsize (integer) Plot text font size.
  • scales (character) Should scales be fixed (“fixed”),
    free (“free”, the default), or free in one dimension (“free_x”, “free_y”) (default “free”).
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotBlqPredictiveCheck”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.

Value

a ggplot2 object

See Also

getPlotPreferences

Click here to see examples

#

  # continuous data

  project <- file.path(getDemoPath(), "2.models_for_continuous_outcomes",

                       "2.2.censored_data", "censoring1_project.mlxtran")

  loadProject(project)

  runScenario()

  plotBlqPredictiveCheck(obsName = "Y")


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Plot Numerical predictive checks

Description

Plot the numerical predictive checks.

Usage

plotNpc(
  obsName = NULL,
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

obsName (character) Name of the observation (in dataset header).
By default the first observation is considered.
settings a list of optional settings:

  • level (integer) level for prediction intervals computation (default 90).
  • nbPoints (integer) Number of points for cdf grid computation (default 100).
  • useCensored (logical) Choose to use BLQ data (TRUE) or to ignore it (FALSE) to compute the VPC (default TRUE).
    For continuous data only.
  • censoring (character) BLQ data can be simulated (‘simulated’),
    or can be equal to the limit of quantification (‘loq’)
    (default ‘simulated’). For continuous data only.
  • empirical (logical) – If TRUE, Empirical data is displayed (default TRUE):
    empirical percentiles for continuous data; empirical probability for discrete data;
    empirical curve for event data
  • theoretical (logical) – If TRUE, median is displayed (default FALSE): median of predicted percentiles
  • predInterval (logical) – If TRUE, Prediction interval is displayed (default TRUE).
  • outlierAreas (logical) -If TRUE Add red areas indicating empirical percentiles that are outside prediction intervals (default TRUE).
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (logical) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (logical) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (character) label on x axis (default “Time”).
  • ylab (character) label on y axis (default obsName).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • xlim (c(double, double)) limits of the x axis.
  • ylim (c(double, double)) limits of the y axis.
  • fontsize (integer) Plot text font size.
  • scales (character) Should scales be fixed (“fixed”),
    free (“free”, the default), or free in one dimension (“free_x”, “free_y”) (default “free”).
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotNpc”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.

Value

a ggplot2 object

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  # continuous data

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  plotNpc(obsName = "CONC")


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Plot distribution of the predictions

Description

Plot the prediction distribution.

Usage

plotPredictionDistribution(
  obsName = NULL,
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

obsName (character) Name of the observation (in dataset header).
By default the first observation is considered.
settings a list of optional settings

  • perc (logical) – If TRUE display 9 Bands for each percentile (default TRUE).
  • median (logical) – If TRUE display Median (default TRUE).
  • nbBands (integer) – Number of bands to display (default 9).
  • higherPercentile (integer) – Percentile level (default 90).
  • obs (logical) – If TRUE display observations as dots (default FALSE).
  • cens (logical) – If TRUE display censored observations as dots (default FALSE).
  • binLimits (logical) If TRUE display limits of bins (default FALSE).
    For discrete data only.
  • binsSettings a list of settings for time axis binning for observation statistics computation (discrete data only):
    • criteria (character) – Bining criteria, one of ‘equalwidth’, ‘equalsize’, or ‘leastsquare’ methods.
      (default leastsquare).
    • is.fixedNbBins (logical) – If TRUE define a fixed number of bins, else define a range for automatic selection
      (default FALSE).
    • nbBins (integer) – Define a fixed number of bins (default 10).
    • binRange (vector(integer, integer)) – Define a range for the number of bins (default c(5, 100)).
    • nbBinData (vector(integer, integer)) – Define a range for the number of data points per bin (default c(10, 200) for Monolix and c(3, 200) for PKanalix).
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (logical) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (logical) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (character) label on x axis (default “Time”).
  • ylab (character) label on y axis (default obsName).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • xlim (c(double, double)) limits of the x axis.
  • ylim (c(double, double)) limits of the y axis.
  • fontsize (integer) Plot text font size.
  • scales (character) Should scales be fixed (“fixed”),
    free (“free”, the default), or free in one dimension (“free_x”, “free_y”) (default “free”).
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotPredictionDistribution”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.
  • color (vector<character>) – Vector of covariates used for coloring (by default no coloring is applied). For instance c("FORM","AGE").
  • colors – Vector of colors to use when color argument is used. Takes precedence over colors defined in preferences. For instance c("#ebecf0","#cdced1","#97989c").

Details

Note that computation settings are not available for this connector in 2021 version:
Number of bands is set to 9 and Level is set to 90

Note that stratification options are not available for this connector in 2021 version:

Value

a ggplot2 object

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  # continuous data

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  plotPredictionDistribution()

  plotPredictionDistribution(stratify = list(color = "SEX"), settings = list(obs = TRUE))

  plotPredictionDistribution(stratify = list(split = "SEX"))


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Plot Visual predictive checks

Description

Plot the visual predictive checks.

Usage

plotVpc(
  obsName = NULL,
  eventPlot = NULL,
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

obsName (character) Name of the observation (in dataset header).
By default the first observation is considered.
eventPlot (character) Display Survival function (“survivalFunction”) or average number of event (“averageEventNumber)
(default “survivalFunction”).
For event data only.
settings a list of optional settings:

  • level (integer) level for prediction intervals computation (default 90).
    For continuous and discrete data only.
  • higherPercentile (integer) Higher percentile for empirical and predicted percentiles computation (default 90).
    For continuous and event data only.
  • useCorrpred (logical) if TRUE, pcVPC are computed using Uppsala prediction correction (default FALSE).
    For continuous data only.
  • useCensored (logical) Choose to use BLQ data (TRUE) or to ignore it (FALSE) (default TRUE).
    For continuous data only.
  • censoring (character) BLQ data can be simulated (‘simulated’), or can be equal to the limit of quantification (‘loq’)
    (default ‘simulated’).
    For continuous data only.
  • timeAfterLastDose (logical) display observations only after last dose (default FALSE)
    For continuous and discrete data with dose information only.
  • xvariable (character) choose plot abscissa if available, one of “time”, “nominalTime” or a regressor name (default “time”)
    For event data, plot against regressor value is not available.
  • nbDataPoints (integer) Number of data point in event time grid (default 100)
    For event data only.
  • xBinsSettings a list of optional settings for time axis binning
    For continuous and discrete data only

    • criteria (character) Bining criteria, one of ‘equalwidth’, ‘equalsize’, or ‘leastsquare’ methods.
      (default leastsquare).
    • is.fixedNbBins (logical) If TRUE define a fixed number of bins, else define a range for automatic selection
      (default FALSE).
    • nbBins (integer) Define a fixed number of bins (default 10).
    • binRange (vector(integer, integer)) Define a range for the number of bins (default c(5, 100)).
    • nbBinData (vector(integer, integer)) Define a range for the number of data points per bin (default c(10, 200)).
  • yBinsSettings a list of optional settings for y axis binning.
    For countable discrete data only

    • criteria (character) Binning criteria, one of ‘equalwidth’, ‘equalsize’, or ‘leastsquare’ methods.
      (default leastsquare).
    • is.fixedNbBins (logical) If TRUE define a fixed number of bins, else define a range for automatic selection
      (default TRUE).
    • nbBins (integer) Define a fixed number of bins (default 10).
    • binRange (vector(integer)) Define a range for the number of bins (default c(5, 100)).
    • nbBinData (vector(integer, integer)) Define a range for the number of data points per bin (default c(10, 200)).
  • obs (logical) – If TRUE, Observed data is displayed as dots (default FALSE).
  • cens (logical) – If TRUE, Censored data is displayed as dots (default FALSE).
  • empirical (logical) – If TRUE, Empirical data is displayed (default TRUE):
    empirical percentiles for continuous data; empirical probability for discrete data;
    empirical curve for event data
  • theoretical (logical) – If TRUE, median is displayed (default FALSE): median of predicted percentiles for continuous data, median of predicted probability for discrete data, median of KM curves for event data
  • predInterval (logical) – If TRUE, Prediction interval is displayed (default TRUE).
  • linearInterpolation (logical) – If TRUE set piece wise display for prediction intervals,
    else show bins as rectangular (default TRUE).
  • outlierDots (logical) – If TRUE, Add red dots indicating empirical percentiles that are outside prediction intervals (default TRUE).
  • outlierAreas (logical) – If TRUE Add red areas indicating empirical percentiles that are outside prediction intervals (default TRUE).
  • binLimits (logical) – Add/remove vertical lines on the scatter plots to indicate the bins (default FALSE).
  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (logical) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (logical) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (character) label on x axis (default “Time”).
  • ylab (character) label on y axis (default obsName).
  • ncol (integer) number of columns when facet = TRUE (default 4).
  • xlim (c(double, double)) limits of the x axis.
  • ylim (c(double, double)) limits of the y axis.
  • fontsize (integer) Plot text font size.
  • scales (character) Should scales be fixed (“fixed”),
    free (“free”, the default), or free in one dimension (“free_x”, “free_y”) (default “free”).
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotVpc”) to check available displays.
stratify List with the stratification arguments:

  • groups – Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:
    name character covariate name (e.g "AGE")
    definition (vector<double>(continuous) || list<vector<character>>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))
  • split (vector<character>) – Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").
  • filter (list< list<character, vector<integer>> >) – List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.
  • color (vector<character>) – Vector of covariates used for coloring (by default no coloring is applied). For instance c("FORM","AGE").
  • colors – Vector of colors to use when color argument is used. Takes precedence over colors defined in preferences. For instance c("#ebecf0","#cdced1","#97989c").

Value

a ggplot2 object

See Also

getPlotPreferences

Click here to see examples

#

  # continuous data

  project <- file.path(getDemoPath(), "1.creating_and_using_models",

                       "1.1.libraries_of_models", "theophylline_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  plotVpc(obsName = "CONC",

          settings = list(outlierDots = FALSE, grid = FALSE,

                          ylab = "Concentration", xlab = "time (in hour)"))

  plotVpc(obsName = "CONC",

          settings = list(outlierDots = FALSE, grid = FALSE,

                          ylab = "Concentration", xlab = "time (in hour)"),

          stratify = list(split = "SEX"))

  plotVpc(obsName = "CONC",

          settings = list(outlierDots = FALSE, grid = FALSE, obs = TRUE,

                          ylab = "Concentration", xlab = "time (in hour)"),

          stratify = list(color = "SEX"))

  # categorical data

  project <- file.path(getDemoPath(), "3.models_for_noncontinuous_outcomes",

                       "3.1.categorical_data_model", "categorical1_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  plotVpc(obsName = "level",

          settings = list(theoretical = TRUE, outlierDots = FALSE))

  # countable data

  project <- file.path(getDemoPath(), "3.models_for_noncontinuous_outcomes",

                       "3.2.count_data_model", "count1a_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  plotVpc(obsName = "Y")

  # time to event data

  project <- file.path(getDemoPath(), "3.models_for_noncontinuous_outcomes",

                       "3.3.time_to_event_data_model", "tte1_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  plotVpc(obsName = "Event", eventPlot = "survivalFunction")


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Define Preferences to customize plots

Description

Define the preferences to customize plots.

Usage

getPlotPreferences(plotName = NULL, update = NULL, ...)

Arguments

plotName (character) Name of the plot function.
if plotName is NULL, all preferences are returned
update list containing the plot elements to be updated.
... additional arguments – dataType for some plots

Details

This function creates a theme that customizes how a plot looks, i.e. legend, colors
fills, transparencies, linetypes an sizes, etc.
For each curve, list of available customizations:

  • color: color (when lines or points)
  • fill: color (when surfaces)
  • opacity: color transparency
  • radius: size of points
  • shape: shape of points
  • lineType: linetype
  • lineWidth: line size
  • legend: name of the legend (if NULL, no legend is displayed for the element)

Value

A list with theme specifiers

See Also

setPlotPreferences resetPlotPreferences

Click here to see examples

#

  preferences <- getPlotPreferences(update = list(

    obs = list(color = "red", legend = "Observations"),

    obsCens = list(color = rgb(70, 130, 180, maxColorValue = 255))

  ))

  # preferences that are used by default in the plots

  preferences <- getPlotPreferences()

  # preferences that are used by default in plotObservedData

  preferences <- getPlotPreferences(plotName = "plotObservedData")

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Reset plot preferences to go back to default preferences

Description

Reset plot preferences to go back to default preferences.

Usage

resetPlotPreferences()

See Also

getPlotPreferences setPlotPreferences

Click here to see examples

#

  getPlotPreferences()$obs[c("color", "legend")]

  update = list(obs = list(color = "green", legend = "Observation"))

  setPlotPreferences(update = update)

  getPlotPreferences()$obs[c("color", "legend")]

  resetPlotPreferences()

  getPlotPreferences()$obs[c("color", "legend")]

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Set preferences to customize plots

Description

Set preferences to customize plots.
When preferences are set, the updated preferences will used in all the plots.

Usage

setPlotPreferences(update = NULL)

Arguments

update list containing the plot elements to be updated.

Details

This function creates a theme that customizes how a plot looks, i.e. legend, colors
fills, transparencies, linetypes an sizes, etc.
For each curve, list of available customizations:

  • color: color (when lines or points)
  • fill: color (when surfaces)
  • opacity: color transparency
  • radius: size of points
  • shape: shape of points
  • lineType: linetype
  • lineWidth: line size
  • legend: name of the legend (if NULL, no legend is displayed for the element)

See Also

getPlotPreferences resetPlotPreferences

Click here to see examples

#

  getPlotPreferences()$obs[c("color", "legend")]

  update = list(obs = list(color = "green", legend = "Observation"))

  setPlotPreferences(update = update)

  getPlotPreferences()$obs[c("color", "legend")]

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Export current project to Monolix, PKanalix or Simulx

Description

Export the current project to another application of the MonolixSuite, and load the exported project.
NOTE: This action switches the current session to the target software. Current unsaved modifications will be lost.
The extensions are .mlxtran for Monolix, .pkx for PKanalix, .smlx for Simulx and .dxp for Datxplore.
WARNING: R is sensitive between ‘\’ and ‘/’, only ‘/’ can be used.

Usage

exportProject(settings, force = F)

Arguments

settings (character) Export settings:

  • targetSoftware (character) Target software (“monolix” | “simulx” | “pkanalix”)
  • filesNextToProject (logical) [optional][Monolix – PKanalix] Save data and/or structural model file next to exported project ([TRUE] | FALSE). Forced to TRUE for Simulx.
  • dataFilePath (character) [optional][Monolix – Simulx] Path (filesNextToProject == FALSE) or name (filesNextToProject == TRUE) of the exported data file. Available only for generated datasets in Monolix (vpc, individual fits)
  • dataFileType (character) [optional][Monolix] Dataset used in the exported project ([“original”] | “vpc” | “individualFits”)
  • modelFileName (character) [optional][Simulx] Name of the exported model file.
  • exportedUnusedCovariates (list) [optional][Monolix – PKanalix => Simulx] Covariates not used in the individual model (if present) to be exported to Simulx. A list with:
    • all (logical) Export all unused covariates. FALSE by default.
    • name (vector<character>) List of exported unused covariate names. Required if all == FALSE, ignored if not.
force (logical) [optional] Should software switch security be overpassed or not. Equals FALSE by default.

Details

At export, a new project is created in a temporary folder. By default, the file is created with a project setting filesNextToProject = TRUE, which means that file dependencies such as data and model files are copied and kept next to the new project (or in the result folder for Simulx). This new project can be saved to the desired location withsaveProject.

Exporting a Monolix or a PKanalix project to Simulx automatically creates elements that can be used for simulation, exactly as in the GUI.

To see which elements of some type have been created in the new project, you can use the get..Element functions: getOccasionElements, getPopulationElements, getPopulationElements, getIndividualElements, getCovariateElements, getTreatmentElements, getOutputElements, getRegressorElements.

See Also

newProject, loadProject, importProject

Click here to see examples

#

[PKanalix only]

exportProject(settings = list(targetSoftware = "monolix", filesNextToProject = F))

exportProject(settings = list(targetSoftware = "monolix", filesNextToProject = F, exportedUnusedCovariates = list(all = FALSE, name = c("sex", "weight"))))

[Monolix only]

exportProject(settings = list(targetSoftware = "simulx", filesNextToProject = T, dataFilePath = "data.txt", dataFileType = "vpc"))

exportProject(settings = list(targetSoftware = "simulx", filesNextToProject = F, dataFilePath = "/path/to/data/data.txt"))

[Simulx only]

exportProject(settings = list(targetSoftware = "pkanalix", dataFilePath = "data.txt", modelFileName = "model.txt"))

exportProject(settings = list(targetSoftware = "pkanalix", dataFilePath = "/path/to/data/data.txt"))

## End(Not run)

# Working example to export a Monolix project to Simulx. The resulting .smlx file can be opened from Simulx GUI.

initializeLixoftConnectors(software = "monolix", force = TRUE)

loadProject(file.path(getDemoPath(),"1.creating_and_using_models","1.1.libraries_of_models","warfarinPK_project.mlxtran"))

runScenario()

exportProject(settings = list(targetSoftware = "simulx"), force = TRUE)

saveProject("importFromMonolix.smlx")


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Get project data

Description

Get a description of the data used in the current project. Available informations are:

  • dataFile (character): Path to the data file (csv, xlsx, xlsx, sas7bdat, xpt or txt). Can be absolute or relative to the current working directory.
  • header (vector<character>): vector of header names
  • headerTypes (vector<character>): vector of header types
  • observationNames (vector<character>): vector of observation names
  • observationTypes (vector<character>): vector of observation types
  • nbSSDoses (integer): number of doses (if there is a SS column)
  • regressorsSettings (character): regressors interpolation method (either last carried forward or linear)
  • sheet (character): Name of the sheet in xlsx/xls file. If not provided, the first sheet is used.

Usage

getData()

Value

A list describing project data.

See Also

setData

Click here to see examples

#

data = getData()

data

-> $dataFile

     "/path/to/data/file.txt"

   $header

     c("ID","TIME","CONC","SEX","OCC")

   $headerTypes

     c("ID","TIME","OBSERVATION","CATEGORICAL COVARIATE","IGNORE")

   $observationNames

     c("concentration")

   $observationTypes

     c(concentration = "continuous")

   $sheet

     "sheet1"

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Get interpreted project data

Description

Get data after interpretation done by the software, as it is displayed in the Data tab in the interface.
Interpretation of data includes, but is not limited to, data formatting, filters, addition of doses through the ADDL column and steady state settings, addition of additional covariates, interpolation of regressors.
It returns as dataframe with all columns of type “character”.

Usage

getInterpretedData()

[Monolix – PKanalix – Simulx] Get a library model’s content.

Description

Get the content of a library model.

Usage

getLibraryModelContent(filename, print = TRUE)

Arguments

filename (character) The filename of the requested model. Can start with “lib:”, end with “.txt”, but neither are mandatory.
print (logical) If TRUE (default), model’s content is printed with human-readable line breaks (alongside regular output with “\n”).

Value

The model’s content as a single string.

Click here to see examples

#

getLibraryModelContent("oral1_1cpt_kaVCl")

model <- getLibraryModelContent(filename = "lib:oral1_1cpt_kaVCl.txt", print = FALSE)

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Get the name of a library model given a list of library filters.

Description

Get the name of a library model given a list of library filters.

Usage

getLibraryModelName(library, filters = list())

Arguments

library (character) One of the MonolixSuite library of models. Possible values are “pk”, “pd”, “pkpd”, “pkdoubleabs”, “pm”, “tmdd”, “tte”, “count” and “tgi”.
filters (list(name = character)) Named list of filters (optional), format: list(filterKey = “filterValue”, …). Default empty list. Since available filters are not in any particular order, filterKey should always be stated.

Details

Models can be loaded from a library based on a selection of filters as in PKanalix, Monolix and Simulx GUI. For a complete description of each model library, and guidelines on how to select models, please visit https://mlxtran.lixoft.com/model-libraries/.

getLibraryModelName enables to get the name of the model to be loaded. You can then use it in setStructuralModel or newProject to load the model in an existing or in a new project.

All possible keys and values for each of the libraries are listed below.

PK library

key values
administration bolus, infusion, oral, oralBolus
delay noDelay, lagTime, transitCompartments
absorption zeroOrder, firstOrder
distribution 1compartment, 2compartments, 3compartments
elimination linear, MichaelisMenten
parametrization rate, clearance, hybridConstants
bioavailability true, false

PD library

key values
response immediate, turnover
drugAction linear, logarithmic, quadratic, Emax, Imax, productionInhibition,
degradationInhibition, degradationStimulation, productionStimulation
baseline const, 1-exp, exp, linear, null
inhibition partialInhibition, fullInhibition
sigmoidicity true, false

PKPD library

key values
administration bolus, infusion, oral, oralBolus
delay noDelay, lagTime, transitCompartments
absorption zeroOrder, firstOrder
distribution 1compartment, 2compartments, 3compartments
elimination linear, MichaelisMenten
parametrization rate, clearance
bioavailability true, false
response direct, effectCompartment, turnover
drugAction Emax, Imax, productionInhibition, degradationInhibition,
degradationStimulation, productionStimulation
baseline const, null
inhibition partialInhibition, fullInhibition
sigmoidicity true, false

PK double absorption library

key values
firstAbsorption zeroOrder, firstOrder
firstDelay noDelay, lagTime, transitCompartments
secondAbsorption zeroOrder, firstOrder
secondDelay noDelay, lagTime, transitCompartments
absorptionOrder simultaneous, sequential
forceLongerDelay true, false
distribution 1compartment, 2compartments, 3compartments
elimination linear, MichaelisMenten
parametrization rate, clearance

Parent-metabolite library

key values
administration bolus, infusion, oral, oralBolus
firstPassEffect noFirstPassEffect, withDoseApportionment,
withoutDoseApportionment
delay noDelay, lagTime, transitCompartments
absorption zeroOrder, firstOrder
transformation unidirectional, bidirectional
parametrization rate, clearance
parentDistribution 1compartment, 2compartments, 3compartments
parentElimination linear, MichaelisMenten
metaboliteDistribution 1compartment, 2compartments, 3compartments
metaboliteElimination linear, MichaelisMenten

TMDD library

key values
administration bolus, infusion, oral, oralBolus
delay noDelay, lagTime, transitCompartments
absorption zeroOrder, firstOrder
distribution 1compartment, 2compartments, 3compartments
tmddApproximation MichaelisMenten, QE, QSS, full, Wagner,
constantRtot, constantRtotIB, irreversibleBinding
output totalLigandLtot, freeLigandL
parametrization rate, clearance

TTE library

key values
tteModel exponential, Weibull, Gompertz, loglogistic,
uniform, gamma, generalizedGamma
delay true, false
numberOfEvents singleEvent, repeatedEvents
typeOfEvent intervalCensored, exact
dummyParameter true, false

Count library

key values
countDistribution Poisson, binomial, negativeBinomial, betaBinomial,
generalizedPoisson, geometric, hypergeometric,
logarithmic, Bernoulli
zeroInflation true, false
timeEvolution constant, linear, exponential, Emax, Hill
parametrization probabilityOfSuccess, averageNumberOfCounts

TGI library

key values
shortcut ClaretExponential, Simeoni, Stein, Wang,
Bonate, Ribba, twoPopulation
initialTumorSize asParameter, asRegressor
kinetics true, false
model linear, quadratic, exponential, generalizedExponential,
exponentialLinear, Simeoni, Koch, logistic,
generalizedLogistic, SimeoniLogisticHybrid, Gompertz,
exponentialGompertz, vonBertalanffy, generalizedVonBertalanffy
additionalFeature none, angiogenesis, immuneDynamics
treatment none, pkModel, exposureAsRegressor, startAtZero,
startTimeAsRegressor, armAsRegressor
killingHypothesis logKill, NortonSimon
dynamics firstOrder, MichaelisMenten, MichaelisMentenHill,
exponentialKill, constant
resistance ClaretExponential, resistantCells, none
delay signalDistribution, cellDistribution, none
additionalTreatmentEffect none, angiogenesisInhibition, immuneEffectorDecay

Value

Name of the filtered model, or vector of names of the available models if not all filters were selected. Names start with “lib:”.

Click here to see examples

#

getLibraryModelName(library = "pk", filters = list(administration = "oral", delay = "lagTime", absorption = "firstOrder", distribution = "1compartment", elimination = "linear", parametrization = "clearance"))

# returns "lib:oral1_1cpt_TlagkaVCl.txt"

getLibraryModelName("pd", list(response = "turnover", drugAction = "productionStimulation"))

# returns c("lib:turn_input_Emax.txt", "lib:turn_input_gammaEmax.txt")

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Get mapping

Description

Get mapping between data and model.

Usage

getMapping()

Value

A list of mapping information:

  • mapping (list<list>) A list of lists representing a link between data and model. Each list contains:
    • obsId (character) Name of observation id present in the dataset. It corresponds to the content of column tagged as “obsid” in case of several obs ids, or to the header of the column tagged as “observation” otherwise
    • modelOutput (character) Name of the model prediction listed in the output= line of the structural model
    • observationName [Monolix] (character) Model observation name (for continuous observations only)
    • type (character) Type of linked data (“continuous” | “discrete” | “event”)
  • freeData (list<list>) A list of lists describing not mapped data:
    • obsId (character) Name of observation id present in the dataset
    • type (character) Data type
  • freePredictions (list<list>) A list of lists describing not mapped predictions:
    • modelOutput (character) Name of the model prediction listed in the output= line of the structural model
    • type (character) Prediction type

See Also

setMapping

Click here to see examples

#

f = getMapping()

f$mapping

  -> list( list(obsId = "1", modelOutput = "Cc", observationName = "concentration", type = "continuous"),

           list(obsId = "2", modelOutput = "Level", type = "discrete") )

f$freeData

  -> list( list(obsId = "3", type = "event") )

f$freePredictions

  -> list( list(modelOutput = "Effect", type = "continuous") )

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Get structural model file

Description

Get the model file for the structural model used in the current project.

Usage

getStructuralModel()

Details

For Simulx, this function will return the path to the structural model only if the project was imported from Monolix, and the path to the full custom model otherwise.
Note that a custom model in Simulx may include also a statistical part.
For Simulx, there is no associated function getStructuralModel() because setting a new model is equivalent to creating a new project. Use newProject instead.

If a model was loaded from the libraries, the returned character is not a path,
but the name of the library model, such as “lib:model_name.txt”. To see the content of a library model, use getLibraryModelContent.

Value

The path to the structural model file.

See Also

For Monolix and PKanalix only: setStructuralModel

Click here to see examples

#

getStructuralModel() => "/path/to/model/inclusion/modelFile.txt"

## End(Not run)

# Get the name and see the content of the model used in warfarin demo project

initializeLixoftConnectors("monolix", force = TRUE)

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "warfarinPK_project.mlxtran"))

libModelName <- getStructuralModel()

getLibraryModelContent(libModelName)

# Get the name of the model file used in Simulx

initializeLixoftConnectors("simulx", force = TRUE)

project_name <- file.path(getDemoPath(), "1.overview", "newProject_TMDDmodel.smlx")

loadProject(project_name)

getStructuralModel()

# Get the name of the model file imported to Simulx

initializeLixoftConnectors("monolix", force = TRUE)

project_name <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "warfarinPK_project.mlxtran")

loadProject(project_name)

getStructuralModel()

initializeLixoftConnectors("simulx", force = TRUE)

importProject(project_name)

getStructuralModel()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Import project from Datxplore, Monolix or PKanalix

Description

Import a Monolix or a PKanalix project into the currently running application initialized in the connectors.
The extensions are .mlxtran for Monolix, .pkx for PKanalix, .smlx for Simulx and .dxp for Datxplore.
WARNING: R is sensitive between ‘\’ and ‘/’, only ‘/’ can be used.
Allowed import sources are:

CURRENT SOFTWARE ALLOWED IMPORTS
Monolix PKanalix
PKanalix Monolix, Datxplore
Simulx Monolix, PKanalix.

Usage

importProject(projectFile)

Arguments

projectFile (character) Path to the project file. Can be absolute or relative
to the current working directory.

Details

At import, a new project is created in a temporary folder with a project setting filesNextToProject = TRUE,
which means that file dependencies such as data and model files are copied and kept next to the new project
(or in the result folder for Simulx). This new project can be saved to the desired location withsaveProject.

Simulx projects can only be exported, not imported. To export a Simulx project to another application,
please load the Simulx project with the Simulx connectors and use exportProject.

Importing a Monolix or a PKanalix project into Simulx automatically creates elements that can be used for
simulation, exactly as in the GUI.

To see which elements of some type have been created in the new project, you can use the get..Element functions:
getOccasionElements, getPopulationElements, getPopulationElements, getIndividualElements,
getCovariateElements, getTreatmentElements, getOutputElements, getRegressorElements.

See Also

saveProject, exportProject

Click here to see examples

#

initializeLixoftConnectors(software = "simulx", force = TRUE)

importProject("/path/to/project/file.mlxtran") 

importProject("/path/to/project/file.pkx") 

initializeLixoftConnectors(software = "monolix", force = TRUE)

importProject("/path/to/project/file.pkx") 

initializeLixoftConnectors(software = "pkanalix", force = TRUE)

importProject("/path/to/project/file.mlxtran") 

## End(Not run)

# working example to import a Monolix demo project into Simulx. The resulting .smlx file can be opened from Simulx GUI.

initializeLixoftConnectors(software = "monolix", force = TRUE)

MonolixDemoPath = file.path(getDemoPath(),"1.creating_and_using_models","1.1.libraries_of_models","warfarinPK_project.mlxtran")

initializeLixoftConnectors(software = "simulx", force = TRUE)

importProject(MonolixDemoPath)

saveProject("importFromMonolix.smlx")


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Get current project load status.

Description

Get a logical saying if a project is currently loaded.

Usage

isProjectLoaded()

Value

TRUE if a project is currently loaded, FALSE otherwise

Click here to see examples

#

project_name <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "warfarinPK_project.mlxtran")

loadProject(project_name)

isProjectLoaded()

initializeLixoftConnectors("pkanalix")

isProjectLoaded()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Load project from file

Description

Load a project in the currently running application initialized in the connectors.
The extensions are .mlxtran for Monolix, .pkx for PKanalix, and .smlx for Simulx.
WARNING: R is sensitive between ‘\’ and ‘/’, only ‘/’ can be used.

Usage

loadProject(projectFile)

Arguments

projectFile (character) Path to the project file. Can be absolute or relative to the current working directory.

See Also

saveProject, importProject, exportProject, newProject

Click here to see examples

#

loadProject("/path/to/project/file.mlxtran") for Linux platform

loadProject("C:/Users/path/to/project/file.mlxtran") for Windows platform

## End(Not run)

# Load a Monolix project

initializeLixoftConnectors("monolix")

project_name <- file.path(getDemoPath(), "8.case_studies", "hiv_project.mlxtran")

loadProject(project_name)

# Load a PKanalix project

initializeLixoftConnectors("pkanalix")

project_name <- file.path(getDemoPath(), "1.basic_examples", "project_censoring.pkx")

loadProject(project_name)

# Load a Simulx project

initializeLixoftConnectors("simulx")

project_name <- file.path(getDemoPath(), "2.models", "longitudinal.smlx")

loadProject(project_name)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Create a new project

Description

Create a new project. New projects can be created in the connectors as in PKanalix, Monolix or Simulx GUI. The creation of a new project requires a dataset in PKanalix, a dataset and a model in Monolix, and a model in Simulx.

Usage

newProject(modelFile = NULL, data = NULL, mapping = NULL)

Arguments

modelFile (character) Path to the model file. Mandatory for Monolix and Simulx, optional for PKanalix (used only for the CA part). Can be absolute or relative to the current working directory.
To use a model from the libraries, you can find the model name with getLibraryModelName and set modelFile = “lib:modelName.txt” with the name obtained.
To simulate inter-individual variability in Simulx with a new project, the model file has to include the statistical model, contrary to Monolix and PKanalix for which the model file only contains the structural model. Check here in detail how to write such a model from scratch.
data (list) Structure describing the data. Mandatory for Monolix and PKanalix.

  • dataFile (character): Path to the data file (csv, xlsx, xlsx, sas7bdat, xpt or txt). Can be absolute or relative to the current working directory.
  • sheet [optional] (character): Name of the sheet in xlsx/xls file. If not provided, the first sheet is used.
  • headerTypes (vector<character>): A vector of header types. The possible header types are: “ignore”, “id”, “time”, “observation”, “amount”, “contcov”, “catcov”, “occ”, “evid”, “mdv”, “obsid”, “cens”, “limit”, “regressor”, “nominaltime”, “admid”, “rate”, “tinf”, “ss”, “ii”, “addl”, “date”. Notice that these are not exactly the types displayed in the interface, they are shortcuts.
  • observationTypes [optional] (list): A list giving the type of each observation present in the data file. If there is only one y-type, the corresponding observation name can be omitted. The possible observation types are “continuous”, “discrete”, and “event”.
  • nbSSDoses (integer): Number of doses (if there is a SS column for steady-state).
  • regressorsSettings [optional] (character): Regressors interpolation method. Either ‘lastCarriedForward’ (default) or ‘linearInterpolation’.
mapping [optional](list): A list of lists representing a link between observation types and model outputs. Each list contains:

  • obsId (character) Name of observation id present in the dataset. It corresponds to the content of column tagged as “obsid” in case of several obs ids, or to the header of the column tagged as “observation” otherwise
  • observationName (character) Name of the model prediction listed in the output= line of the structural model
  • modelOutput [Monolix] (character) Name of the observation, e.g “y1” (for continuous observations only)

Details

Note: instead of creating a project from scratch, it is also possible in Monolix and PKanalix to load an existing project with loadProject or importProject and change the dataset or the model with setData or setStructuralModel.

See Also

newProject saveProject

Click here to see examples

#

initializeLixoftConnectors("monolix")

data_file <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "data", "warfarin_data.csv")

newProject(data = list(dataFile = data_file, 

                       headerTypes = c("id", "time", "amount", "observation", "obsid", "contcov", "catcov", "contcov")),

           modelFile = "lib:oral1_1cpt_IndirectModelInhibitionKin_TlagkaVClR0koutImaxIC50.txt",

           mapping = list(list(obsId = "1",

                               modelOutput = "Cc",

                               observationName = "y1"),

                          list(obsId = "2",

                               modelOutput = "R",

                               observationName = "y2")))

# Create a new PKanalix project

initializeLixoftConnectors("pkanalix")

data_file <- file.path(getDemoPath(), "1.basic_examples", "data", "data_BLQ.csv")

newProject(data = list(dataFile = data_file,

                       headerTypes = c("id", "time", "amount", "observation", "cens", "catcov")))

# Create a new Simulx project

initializeLixoftConnectors("simulx")

newProject(modelFile = "lib:oral1_1cpt_IndirectModelInhibitionKin_TlagkaVClR0koutImaxIC50.txt")


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Save current project

Description

Save the current project as a file that can be reloaded in the connectors or in the GUI.

Usage

saveProject(projectFile = "")

Arguments

projectFile [optional](character) Path where to save a copy of the current mlxtran model. Can be absolute or relative to the current working directory.
If no path is given, the file used to build the current configuration is updated.

Details

The extensions are .mlxtran for Monolix, .pkx for PKanalix, and .smlx for Simulx.
WARNING: R is sensitive between ‘\’ and ‘/’, only ‘/’ can be used.

If the project setting “userfilesnexttoproject” is set to TRUE with setProjectSettings, all file dependencies such as model, data or external files are saved next to the project for Monolix and PKanalix, and in the result folder for Simulx.

See Also

newProject loadProject

Click here to see examples

#

[PKanalix only]

saveProject("/path/to/project/file.pkx") # save a copy of the model

[Monolix only]

saveProject("/path/to/project/file.mlxtran") # save a copy of the model

[Simulx only]

saveProject("/path/to/project/file.smlx") # save a copy of the model

[Monolix - PKanalix - Simulx] 

saveProject() # update current model

## End(Not run)

# Load, change and save a PKanalix project under a new name

initializeLixoftConnectors("pkanalix")

project_name <- file.path(getDemoPath(), "1.basic_examples", "project_censoring.pkx")

loadProject(project_name)

setNCASettings(blqMethodAfterTmax = "missing")

saveProject("~/changed_project.pkx")

# Load, change and save a Monolix project under a new name

initializeLixoftConnectors("monolix")

project_name <- file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "warfarinPK_project.mlxtran")

loadProject(project_name)

addContinuousTransformedCovariate(tWt = "3*exp(wt)")

saveProject("~/changed_project.mlxtran")

# Load, change and save a Simulx project under a new name

initializeLixoftConnectors("simulx")

project_name <- file.path(getDemoPath(), "2.models", "longitudinal.smlx")

loadProject(project_name)

defineTreatmentElement(name = "trt", element = list(data = data.frame(time = 0, amount = 100)))

saveProject("~/changed_project.smlx")


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Set project data

Description

Set project data giving a data file and specifying headers and observations types.

Usage

setData(
  dataFile,
  headerTypes,
  observationTypes = NULL,
  nbSSDoses = NULL,
  regressorsSettings = NULL,
  sheet = NULL
)

Arguments

dataFile (character): Path to the data file (csv, xlsx, xlsx, sas7bdat, xpt or txt). Can be absolute or relative to the current working directory.
headerTypes (vector<character>): A vector of header types.
The possible header types are: “ignore”, “id”, “time”, “observation”, “amount”, “contcov”, “catcov”, “occ”, “evid”, “mdv”, “obsid”, “cens”, “limit”, “regressor”, “nominaltime”, “admid”, “rate”, “tinf”, “ss”, “ii”, “addl”, “date”.
Notice that these are not the types displayed in the interface, these one are shortcuts.
observationTypes [optional] (list): A list giving the type of each observation present in the data file. If there is only one y-type, the corresponding observation name can be omitted.
The possible observation types are “continuous”, “discrete”, and “event”.
nbSSDoses [optional](integer): Number of doses (if there is a SS column).
regressorsSettings [optional](character): Regressors interpolation method. Either ‘lastCarriedForward’ (default) or ‘linearInterpolation’.
sheet [optional] (character): Name of the sheet in xlsx/xls file. If not provided, the first sheet is used.

See Also

getData

Click here to see examples

#

setData(dataFile = "/path/to/data/file.txt", 

        headerTypes = c("IGNORE", "OBSERVATION"), observationTypes = "continuous")

setData(dataFile = "/path/to/data/file.txt", 

        headerTypes = c("IGNORE", "OBSERVATION", "YTYPE"), 

       observationTypes = list(Concentration = "continuous", Level = "discrete"))

setData(dataFile = "/path/to/data/file.xlsx", sheet = "sheet2",

        headerTypes = c("IGNORE", "OBSERVATION", "YTYPE"), 

       observationTypes = list(Concentration = "continuous", Level = "discrete"))

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Set mapping

Description

Set mapping between data and model.

Usage

setMapping(mapping)

Arguments

mapping (list<list>) A list of lists representing a link between the data and the model. Each list contains:

  • obsId (character) Name of observation id present in the dataset. It corresponds to the content of column tagged as “obsid” in case of several obs ids, or to the header of the column tagged as “observation” otherwise
  • modelOutput (character) Name of the model prediction listed in the output= line of the structural model
  • observationName [Monolix] (character) Name of the observation, e.g “y1” (for continuous observations only)

See Also

getMapping

Click here to see examples

#

[Monolix] setMapping(list(list(obsId = "1", modelOutput = "Cc", observationName = "concentration"), list(obsId = "2", modelOutput = "Level")))

[PKanalix] setMapping(list(list(obsId = "1", modelOutput = "Cc"), list(obsId = "2", modelOutput = "Level")))

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Set structural model file

Description

Set the structural model.

Usage

setStructuralModel(modelFile)

Arguments

modelFile (character) Path to the model file. Can be absolute or relative
to the current working directory.

Details

To use a model from the libraries, you can find the model name with getLibraryModelName
and set modelFile = “lib:modelName.txt” with the name obtained.

See Also

getStructuralModel

Click here to see examples

#

setStructuralModel("/path/to/model/file.txt")

setStructuralModel("'lib:oral1_2cpt_kaClV1QV2.txt'")

# working example to set a model from the library:

initializeLixoftConnectors("monolix",force = TRUE)

loadProject(file.path(getDemoPath(),"1.creating_and_using_models","1.1.libraries_of_models","warfarinPK_project.mlxtran"))

#check model currently loaded:

getStructuralModel()

#get the name for a model from the library with 2 compartments:

LibModel2cpt = getLibraryModelName(library = "pk", filters = list(administration = "oral", delay = "lagTime", absorption = "firstOrder", distribution = "2compartments", elimination = "linear", parametrization = "clearance"))

#check model content:

getLibraryModelContent(LibModel2cpt)

#set this new model in the project:

setStructuralModel(LibModel2cpt)

# check that the project has now the new model instead of the previous one:

getStructuralModel()

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Share project.

Description

Create a zip archive file from current project and its results.

Usage

shareProject(archiveFile)

Arguments

archiveFile (character) Path to the .zip archive file to create.

Click here to see examples

#

shareProject("/path/to/archive.zip")

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Get console mode

Description

Get console mode, ie volume of output after running estimation tasks. Possible verbosity levels are:

“none” no output
“basic” at the end of each algorithm, associated results are displayed
“complete” each algorithm iteration and/or status is displayed

Usage

getConsoleMode()

Value

A string corresponding to current console mode

See Also

setConsoleMode


[Monolix – PKanalix – Simulx] Get project preferences

Description

Get a summary of the project preferences. Preferences are:

“relativepath” (logical) Use relative path for save/load operations.
“threads” (integer > 0) Number of threads.
“temporarydirectory” (character) Path to the directory used to save temporary files.
“usebinarydataset” (logical) Save dataset as binary file to speed project reload up.
“timestamping” (logical) Create an archive containing result files after each run.
“delimiter” (character) Character use as delimiter in exported result files.
“reportingrenamings” (list(“label” = “alias”>)) For each label, an alias to be use at report generation (using generateReport).
“exportchartsdata” (logical) Should charts data be exported.
“savebinarychartsdata” (logical) [Monolix] Save charts simulations as binray file to speed charts creation up.
“exportchartsdatasets” (logical) [Monolix] Should charts datasets be exported if possible.
“exportvpcsimulations” (logical) [Monolix] Should vpc simulations be exported if possible.
“exportsimulationfiles” (logical) [Simulx] Should simulation results files be exported.
“headeraliases” (list(“header” = vector<character>)) For each header, the list of the recognized aliases.
“ncaparameters” (vector<character>) [PKanalix] Defaulty computed NCA parameters.
“units” (list(“type” = character) [PKanalix] Time, amount and/or volume units.

Usage

getPreferences(...)

Arguments

... [optional] (character) Name of the preference whose value should be displayed. If no argument is provided, all the preferences are returned.

Value

A list with each preference name mapped to its current value.

Click here to see examples

#

getPreferences() # retrieve a list of all the general settings

getPreferences("imageFormat","exportCharts") 

# retrieve only the imageFormat and exportCharts settings values

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Get project settings

Description

Get a summary of the project settings.
Associated settings for Monolix projects are:

“directory” (character) Path to the folder where simulation results will be saved. It should be a writable directory.
“exportResults” (logical) Should results be exported.
“seed” (0 < integer < 2147483647) Seed used by random generators.
“grid” (integer) Number of points for the continuous simulation grid.
“nbSimulations” (integer) Number of simulations.
“dataandmodelnexttoproject” (logical) Should data and model files be saved next to project.
“project” (character) Path to the Monolix project.

Associated settings for PKanalix projects are:

“directory” (character) Path to the folder where simulation results will be saved. It should be a writable directory.
“seed” (0 < integer < 2147483647) Seed used by random generators.
“datanexttoproject” (logical) Should data and model (in case of CA) files be saved next to project.

Associated settings for Simulx projects are:

“directory” (character) Path to the folder where simulation results will be saved. It should be a writable directory.
“seed” (0 < integer < 2147483647) Seed used by random generators.
“userfilesnexttoproject” (logical) Should user files be saved next to project.

Usage

getProjectSettings(...)

Arguments

... [optional] (character) Name of the settings whose value should be displayed. If no argument is provided, all the settings are returned.

Value

A list with each setting name mapped to its current value.

See Also

setProjectSettings

Click here to see examples

#

getProjectSettings() # retrieve a list of all the project settings

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Set console mode

Description

Set console mode, ie volume of output after running estimation tasks. Possible verbosity levels are:

“none” no output
“basic” for each algorithm, display current iteration then associated results at algorithm end
“complete” display all iterations then associated results at algorithm end

Usage

setConsoleMode(mode)

Arguments

mode (character) Accepted values are: “none” [default], “basic”, “complete”

See Also

getConsoleMode


[Monolix – PKanalix – Simulx] Set preferences

Description

Set the value of one or several of the project preferences. Prefenreces are:

“relativepath” (logical) Use relative path for save/load operations.
“threads” (integer > 0) Number of threads.
“temporarydirectory” (character) Path to the directory used to save temporary files.
“usebinarydataset” (logical) Save dataset as binary file to speed project reload up.
“timestamping” (logical) Create an archive containing result files after each run.
“delimiter” (character) Character use as delimiter in exported result files.
“reportingrenamings” (list(“label” = “alias”)) For each label, an alias to be use at report generation (using generateReport).
“exportchartsdata” (logical) Should charts data be exported.
“savebinarychartsdata” (logical) [Monolix] Save charts simulations as binray file to speed charts creation up.
“exportchartsdatasets” (logical) [Monolix] Should charts datasets be exported if possible.
“exportvpcsimulations” (logical) [Monolix] Should vpc simulations be exported if possible.
“exportsimulationfiles” (logical) [Simulx] Should simulation results files be exported.
“headeraliases” (list(“header” = vector<character>)) For each header, the list of the recognized aliases.
“ncaparameters” (vector<character>) [PKanalix] Defaulty computed NCA parameters.
“units” (list(“type” = character) [PKanalix] Time, amount and/or volume units.

Usage

setPreferences(...)

Arguments

... A collection of comma-separated pairs {preferenceName = settingValue}.

See Also

getPreferences

Click here to see examples

#

setPreferences(exportCharts = FALSE, delimiter = ",")

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Set project settings

Description

Set the value of one or several of the settings of the project.
Associated settings for Monolix projects are:

“directory” (character) Path to the folder where simulation results will be saved. It should be a writable directory.
“exportResults” (logical) Should results be exported.
“seed” (0 < integer < 2147483647) Seed used by random generators.
“grid” (integer) Number of points for the continuous simulation grid.
“nbSimulations” (integer) Number of simulations.
“dataandmodelnexttoproject” (logical) Should data and model files be saved next to project.

Associated settings for PKanalix projects are:

“directory” (character) Path to the folder where simulation results will be saved. It should be a writable directory.
“dataNextToProject” (logical) Should data and model (in case of CA) files be saved next to project.
“seed” (0 < integer < 2147483647) Seed used by random generators.

Associated settings for Simulx projects are:

“directory” (character) Path to the folder where simulation results will be saved. It should be a writable directory.
“seed” (0 < integer < 2147483647) Seed used by random generators.
“userfilesnexttoproject” (logical) Should user files be saved next to project.

Usage

setProjectSettings(...)

Arguments

... A collection of comma-separated pairs {settingName = settingValue}.

See Also

getProjectSettings

Click here to see examples

#

setProjectSettings(directory = "/path/to/export/directory", seed = 12345)

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Generate report

Description

Generate a project report with default options or from a custom Word template.

Usage

generateReport(
  templateFile = NULL,
  tablesStyle = NULL,
  watermark = NULL,
  reportFile = NULL
)

Arguments

templateFile [optional] (character) Path to the .docx template file used as reporting base. If not provided, a default report file is generated (as default option in the GUI).
tablesStyle [optional] (character)
watermark [optional] (list)

  • text (character)
  • fontFamily (character) [“Arial”]
  • fontSize (integer) [36]
  • color (vector<integer>) Rgb color [c(255, 0, 0)]
  • layout (character)
  • semiTransparent (logical) [true]
reportFile [optional] (list) If not provided, the report will be saved next to the project file with the name <projectname>_report.docx.

  • nextToProject (logical) Generate report file next to project
  • path (character) Path (nextToProject == FALSE) or name (nextToProject == TRUE) of the generated report file

Details

Reports can be generated as in the GUI, either by using the default reporting or by using a custom template. Placeholders for tables can be used in the template, and they are replaced by result tables. It is not possible to replace plots placeholders with the connector, because this requires an interface to be open. If plots placeholders are present in the template, they will be replaced by nothing in the generated report.

Click here to see examples

#

generateReport()

generateReport(templateFile = "/path/to/template.docx")

generateReport(templateFile = "/path/to/template.docx", tablesStyle = "Plain Table 1", watermark = list(text = "watermark", fontSize = 15))

## End(Not run)

# Working example to generate a default report ###

initializeLixoftConnectors("monolix")

loadProject(file.path(getDemoPath(),"1.creating_and_using_models","1.1.libraries_of_models","warfarinPK_project.mlxtran"))

runScenario()

reportPath = tempfile("report", fileext = ".docx")

generateReport(reportFile = list(nextToProject = FALSE, path = reportPath))

file.show(reportPath)

# Working example to generate a report with a custom template###

# Note that only tables get replaced. It is not possible to add plots to a report via connectors, but it can be done in the GUI.

initializeLixoftConnectors("pkanalix")

loadProject(file.path(getDemoPath(),"2.case_studies","project_aPCSK9_SAD.pkx"))

runScenario()

reportPath = tempfile("report", fileext = ".docx")

generateReport(templateFile = file.path(getDemoPath(),"2.case_studies","report_templates","PK_report_template_aPCSK9.docx"), reportFile = list(nextToProject = FALSE, path = reportPath))

file.show(reportPath)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Export chart dataset

Description

Export the data of a chart into Lixoft suite compatible data set format.
It can be generated only if the concerned chart has been built.
The file is written in the results folder of the current project.

Usage

exportChartDataSet(type, filePath = "")

Arguments

type (character) Chart type whose data must be exported. Available types are: “vpc”, “indfits”.
filePath [optional](character) Custom path for the exported file. By default, it is written in the DataFile folder of the current project.

See Also

computeChartsData runScenario

Click here to see examples

#

 exportChartDataSet(type = "vpc")

 exportChartDataSet(type = "indfits", filePath = "/path/to/exported/file.txt")

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get the inverse of the Fisher Matrix

Description

Get the inverse of the last estimated Fisher matrix computed either by all the Fisher methods used during the last scenario run or by the specific one passed in argument.
WARNING: The Fisher matrix cannot be accessible until the Fisher algorithm has been launched once.
The user can choose to display only the Fisher matrix estimated with a specific method.
Existing Fisher methods :

Fisher by Linearization “linearization”
Fisher by Stochastic Approximation “stochasticApproximation”

WARNING: Only the methods which have been used during the last scenario run can provide results.

Usage

getCorrelationOfEstimates(method = "")

Arguments

method [optional](character) Fisher method whose results should be displayed.
If this field is not specified, the results provided by all the methods used during the last scenario run are displayed.

Value

A list whose each field contains the Fisher matrix computed by one of the available Fisher methods used during the ast scenario run.
A matrix is defined as a structure containing the following fields :

rownames list of row names
columnnames list of column names
rownumber number of rows
data vector<…> containing matrix raw values (column major)

Click here to see examples

#

getCorrelationOfEstimates("linearization")

 -> list( linearization = list(data = c(1,0,0,0,1,-0.06,0,-0.06,1),

                               rownumber = 3, 

                               rownames = c("Cl_pop","omega_Cl","a"), 

                               columnnames = c("Cl_pop","omega_Cl","a")))

getCorrelationOfEstimates() 

 -> list(linearization = list(...), stochasticApproximation = list(...) )

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get confidence interval of population parameters

Description

Get the confidence interval of population parameters computed either by all the Fisher methods used during the last scenario run or by the specific one passed in argument.
WARNING: The standard errors cannot be accessible until the Fisher algorithm has been launched once.
Existing Fisher methods :

Fisher by Linearization “linearization”
Fisher by Stochastic Approximation “stochasticApproximation”

WARNING: Only the methods which have been used during the last scenario run can provide results.

Usage

getEstimatedConfidenceIntervals(method = "", withValuesByGroups = FALSE)

Arguments

method [optional](character) Fisher method whose results should be displayed.
If this field is not specified, the results provided by all the methods used during the last scenario run are retrieved
withValuesByGroups [optional](logical) if this option is TRUE, confidence intervals of typical parameters having categorical covariate effects are given for each category.

Value

A list associating each retrieved Fisher algorithm method to a data frame containing the confidence interval with 2.5 and 97.5 as bounds.

Click here to see examples

#

getEstimatedConfidenceIntervals() -> 

  $linearization 

     parameter        P2.5     P97.5

        ka_pop 0.313449586  0.451556

         V_pop 0.420422507  0.483500

       omega_V 0.045675960  0.057247

      omega_Cl 0.023297601  0.027093

  $stochasticApproximation

     parameter        P2.5     P97.5

        ka_pop 0.315639586  0.384512

         V_pop 0.410235533  0.501205

       omega_V 0.046675960  0.058247

      omega_Cl 0.024297601  0.028093

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get last estimated individual parameter values

Description

Get the last estimated values for each subject of the individual parameters present within the current project.
WARNING: Estimated individual parameters values are not available until at least SAEM has been run.
NOTE: The user can choose to display only the individual parameter values estimated with a specific method.
Existing individual estimation methods :

“saem” Approximation of the conditional mean estimated by SAEM
“conditionalMean” Mean of the conditional distribution estimated by the Conditional Distribution task
“conditionalMode” Mean of the conditional distribution estimated by the EBEs task

Usage

getEstimatedIndividualParameters(..., method = "")

Arguments

... (character) Name of the individual parameters whose values must be displayed. Call getIndividualParameterModel to get a list of the individual parameters present within the current project.
method [optional](character) A value among “saem”, “conditionalMean” or “conditionalMode”: the individual parameter estimation method whose results should be displayed.
If there are latent covariate used in the model, the estimated modality is displayed too.
If this field is not specified, the results provided by all the methods used during the last scenario run are displayed.

Value

A list of dataframes with the same names as the methods, giving for each requested method the last estimated values of the individual parameters of interest for each subject. If the Conditional Distribution task has been run,
the list also includes a dataframe named conditionalSD with the standard deviations of the conditional distributions in addition to the dataframe named conditionalMean.

See Also

getEstimatedRandomEffects, runPopulationParameterEstimation, runConditionalDistributionSampling , runConditionalModeEstimation

Click here to see examples

#

indivParams = getEstimatedIndividualParameters() 

# retrieve the values of all the available individual parameters for all methods

  -> $saem

      id   Cl     V      ka

      1   0.28  7.71   0.29

      .   ...    ...    ...

      N   0.1047.62   1.51

indivParams = getEstimatedIndividualParameters("Cl", "V", method = "conditionalMean") 

# retrieve the values of the individual parameters "Cl" and "V" 

# estimated by the conditional mode method

## End(Not run)

initializeLixoftConnectors("monolix")

loadProject(paste0(getDemoPath(),"/1.creating_and_using_models/1.1.libraries_of_models/theophylline_project.mlxtran"))

runScenario()

getEstimatedIndividualParameters()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get Log-Likelihood values

Description

Get the values computed by using a log-likelihood algorithm during the last scenario run, with or without a method-based filter.
WARNING: The log-likelihood values cannot be accessible until the log-likelihood algorithm has been launched once.
The user can choose to display only the log-likelihood values computed with a specific method.
Existing log-likelihood methods :

Log-likelihood by Linearization “linearization”
Log-likelihood by Important Sampling “importanceSampling”

WARNING: Only the methods which have been used during the last scenario run can provide results.

Usage

getEstimatedLogLikelihood(method = "")

Arguments

method [optional](character) Log-likelihood method whose results should be displayed.
If this field is not specified, the results provided by all the methods used during the last scenario run are retrieved.

Value

A list associating the name of each method passed in argument to the corresponding log-likelihood values computed by during the last scenario run.

Click here to see examples

#

getEstimatedLogLikelihood()

 -> list(  linearization = [LL = -170.505, AIC = 350.280, BIC = 365.335] ,

           importanceSampling = [...] )

getEstimatedLogLikelihood("linearization")

 -> list(  linearization = [LL = -170.505, AIC = 350.280, BIC = 365.335] )

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get last estimated population parameter value

Description

Get the last estimated value of some of the population parameters present within the current project (fixed effects + individual variances + correlations + latent probabilities + error model parameters).
WARNING: Estimated population parameters values are not available until the SAEM algorithm has been launched with runPopulationParameterEstimation .

Usage

getEstimatedPopulationParameters(
  ...,
  coefficientsOfVariation = FALSE,
  withValuesByGroups = FALSE
)

Arguments

... [optional] (character) Names of the population parameters whose value must be displayed. Call getPopulationParameterInformation to get a list of the population parameters present within the current project.
If this is not specified, the function will retrieve the values of all the available population parameters.
coefficientsOfVariation [optional](logical) if this option is TRUE, the standard deviations of random effects are also given as coefficients of variation (relative standard deviations as percentages) with _CV suffix.
withValuesByGroups [optional](logical) if this option is TRUE, typical values of parameters having categorical covariate effects are given for each category.

Value

A named vector containing the last estimated value of each one of the population parameters passed as argument or all population parameters if unspecified.

See Also

runPopulationParameterEstimation

Click here to see examples

#

getEstimatedPopulationParameters("V_pop") -> [V_pop = 0.5]

getEstimatedPopulationParameters("V_pop","Cl_pop") -> [V_pop = 0.5, Cl_pop = 0.25]

getEstimatedPopulationParameters() -> [V_pop = 0.5, Cl_pop = 0.25, ka_pop = 0.05, beta_ka_SEX_F=-0.12, omega_V=0.15, omega_ka=0.2]

getEstimatedPopulationParameters(withValuesByGroups=TRUE) -> [V_pop = 0.5, Cl_pop = 0.25, ka_pop = 0.05, beta_ka_SEX_F=-0.12, omega_V=0.15, omega_ka=0.2, ka_SEX_F=0.04434602]

getEstimatedPopulationParameters("omega_V",coefficientsOfVariation=TRUE) -> [omega_V=0.15, omega_V_CV = 15.08477]

## End(Not run)

initializeLixoftConnectors("monolix")

loadProject(paste0(getDemoPath(),"/5.models_for_individual_parameters/5.2.covariate_model/warfarin_covariate3_project.mlxtran"))

runPopulationParameterEstimation()

getEstimatedPopulationParameters()

getEstimatedPopulationParameters(withValuesByGroups = T)

getEstimatedPopulationParameters("omega_V", coefficientsOfVariation = T)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get the estimated random effects

Description

Get the random effects for each subject of the individual parameters present within the current project.
WARNING: Estimated random effects are not available until the individual estimation algorithm has been run. Please call getLaunchedTasks to get a list of the methods whose results are available.
The user can choose to display only the random effects estimated with a specific method.
NOTE: The random effects are defined in the gaussian referential, e.g. if ka is lognormally distributed around ka_pop, eta_i = log(ka_i)-log(ka_pop)
Existing individual estimation methods :

“saem” Approximation of the conditional mean estimated by SAEM
“conditionalMean” Mean of the conditional distribution estimated by the Conditional Distribution task
“conditionalMode” Mean of the conditional distribution estimated by the EBEs task

Usage

getEstimatedRandomEffects(..., method = "")

Arguments

... (character) Name of the individual parameters whose random effects must be displayed. Call getIndividualParameterModel to get a list of the individual parameters present within the current project.
method [optional](character) A value among “saem”, “conditionalMean” or “conditionalMode”: the individual parameter estimation method whose results should be displayed.
If this field is not specified, the results provided by all the methods used during the last scenario run are displayed.

Value

A list of dataframes giving, for each requested method, the last estimated random effects values of the individual parameters of interest for each subject, with the corresponding standard deviation values for the “conditionalMean” method.

See Also

getEstimatedIndividualParameters

Click here to see examples

#

etaParams = getEstimatedRandomEffects() 

# retrieve the values of all the available random effects for all methods

# without the associated standard deviations

  -> $saem

     id    Cl     V      ka

      1   0.28  7.71   0.29

      .   ...    ...    ...

      N   0.1047.62   1.51

etaParams = getEstimatedRandomEffects("Cl", "V", method = "saem") 

# retrieve the values of the individual parameters "Cl" and "V" 

# estimated by the conditional mean from SAEM algorithm

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get standard errors of population parameters

Description

Get the last estimated standard errors of population parameters computed either by all the Fisher methods used during the last scenario run or by the specific one passed in argument.
WARNING: The standard errors cannot be accessible until the Fisher algorithm has been launched once.
Existing Fisher methods :

Fisher by Linearization “linearization”
Fisher by Stochastic Approximation “stochasticApproximation”

WARNING: Only the methods which have been used during the last scenario run can provide results.

Usage

getEstimatedStandardErrors(method = "", withValuesByGroups = FALSE)

Arguments

method [optional](character) Fisher method whose results should be displayed.
If this field is not specified, the results provided by all the methods used during the last scenario run are retrieved
withValuesByGroups [optional](logical) if this option is TRUE, standard errors of typical parameters having categorical covariate effects are given for each category.

Value

A list associating each retrieved Fisher algorithm method to a data frame containing the standard errors and relative standard errors (

Click here to see examples

#

getEstimatedStandardErrors() -> 

  $linearization 

     parameter          se       rse

        ka_pop 0.313449586 20.451556

         V_pop 0.020422507  4.483500

       omega_V 0.037975960 30.072470

      omega_Cl 0.062976601 23.270939

  $stochasticApproximation

     parameter          se       rse

        ka_pop 0.311284296 20.310278

         V_pop 0.020424882  4.484022

       omega_V 0.161053665 24.000077

      omega_Cl 0.035113095 27.805419

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get individual parameter shrinkage values

Description

Get the shrinkage values for each individual parameter.
WARNING: Shrinkage values are not available until the corresponding individual estimation algorithm has been run.
NOTE: The user can choose to display only the shrinkage based on individual parameter values estimated with a specific method.
Existing individual estimation methods :

“conditionalDist” All samples from the conditional distribution, sampled by the Conditional Distribution task
“conditionalMean” Mean of the conditional distribution estimated by the Conditional Distribution task
“conditionalMode” Mean of the conditional distribution estimated by the EBEs task

Usage

getEtaShrinkage(..., method = "")

Arguments

... (character) Name of the individual parameters whose values must be displayed. Call getIndividualParameterModel to get a list of the individual parameters present within the current project.
method [optional](character) A value among “saem”, “conditionalMean” or “conditionalMode”: the individual parameter estimation method whose results should be displayed.
If this field is not specified, the results provided by all the methods that have been run are displayed.

Value

A list of dataframes giving, for each requested method, the shrinkage values for each requested individual parameter.

See Also

getEstimatedIndividualParameters

Click here to see examples

#

indivParams = getEtaShrinkage() 

# retrieve the values of all the available individual parameters for all methods

  -> $conditionalMean

      parameters    shrinkage

      ka            28.5

      V             ...

      Cl            10.472

     $conditionalMode

      parameters    shrinkage

      ka            29.4

      V             ...

      Cl            -9.2

indivParams = getEtaShrinkage("Cl", "V", method = "conditionalMean") 

# retrieve the values of the shrinkage for "Cl" and "V" from conditional mean method

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get tasks with results

Description

Get a list of the tasks which have available results.

Usage

getLaunchedTasks()

Value

A list with items:

  • populationParameterEstimation: TRUE if the “Population Parameters” task has been run and has results, FALSE otherwise. To run this task, use runPopulationParameterEstimation.
  • conditionalDistributionSampling: TRUE if the “Conditional Distribution” task has been run and has results, FALSE otherwise. To run this task, use runConditionalDistributionSampling.
  • conditionalModeEstimation: TRUE if the “EBEs” task has been run and has results, FALSE otherwise. To run this task, use runConditionalModeEstimation.
  • standardErrorEstimation: character vector containing “linearization” and/or “stochasticApproximation” if the “Standard Errors” task has been run with linearization and/or stochastic approximation method and has results, FALSE otherwise. To run this task, use runStandardErrorEstimation.
  • logLikelihoodEstimation: character vector containing “linearization” and/or “importanceSampling” if the “Likelihood” task has been run with linearization and/or importance sampling method and has results, FALSE otherwise. To run this task, use runLogLikelihoodEstimation.
  • plots: TRUE (because there are always at least Observed Data plots).

Click here to see examples

#

getLaunchedTasks()

## End(Not run)

# run "Population Parameters", "EBEs" and "Likelihood" with linearization and output tasks with results:

initializeLixoftConnectors("monolix")

loadProject(paste0(getDemoPath(),"/1.creating_and_using_models/1.1.libraries_of_models/theophylline_project.mlxtran"))

runPopulationParameterEstimation()

runConditionalModeEstimation()

runLogLikelihoodEstimation(linearization = T)

getLaunchedTasks()

## Not run: 

$populationParameterEstimation

[1] TRUE

$conditionalDistributionSampling

[1] FALSE

$conditionalModeEstimation

[1] TRUE

$standardErrorEstimation

[1] FALSE

$logLikelihoodEstimation

[1] "linearization"

$plots

[1] TRUE

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get SAEM algorithm iterations

Description

Retrieve the successive values of some of the population parameters present within the current project (fixed effects + individual variances + correlations + latent probabilities + error model parameters) during the previous run of the SAEM algorithm.
WARNING: Convergence history of population parameters values cannot be accessible until the SAEM algorithm has been launched once.

Usage

getSAEMiterations(...)

Arguments

... [optional] (character) Names of the population parameters whose convergence history must be displayed. Call getPopulationParameterInformation to get a list of the population parameters present within the current project.
If this field is not specified, the function will retrieve the values of all the available population parameters.

Value

A list containing a pair composed by the number of exploratory and smoothing iterations and a data frame which associates each wanted population parameter to its successive values over SAEM algorithm iterations.

Click here to see examples

#

report = getSAEMiterations()

report

  -> $iterationNumbers

       c(50,25)

     $estimates

          V    Cl

       0.25     0

        0.3   0.5

          .     .

       0.35  0.25

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get simulated individual parameters

Description

Get the simulated values for each replicate of each subject of some of the individual parameters present within the current project.
WARNING: Simulated individual parameters values are not available until the “Conditional Distribution” task (individual estimation with conditional mean) has been run.

Usage

getSimulatedIndividualParameters(...)

Arguments

... (character) Name of the individual parameters whose values must be displayed. Call getIndividualParameterModel to get a list of the individual parameters present within the current project.

Value

A data.frame giving the last simulated values of the individual parameters of interest for each replicate of each subject.

See Also

getSimulatedRandomEffects

Click here to see examples

#

simParams = getSimulatedIndividualParameters() 

# retrieve the values of all the available individual parameters

simParams

     rep   id    Cl     V     ka

      1    1   0.022  0.37  1.79

      1    2   0.033  0.42  -0.92

      .    .    ...    ...  ...

      2    1   0.021  0.33  1.47

      .    .    ...    ...  ...

simParams = getSimulatedIndividualParameters("Cl", "V") 

# retrieve the values of the simulated individual parameters "Cl" and "V" 

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get simulated random effects

Description

Get the simulated values for each replicate of each subject of some of the individual random effects present within the current project.
WARNING: Simulated individual random effects values are not available until the “Conditional Distribution” task (individual estimation with conditional mean) has been run.

Usage

getSimulatedRandomEffects(...)

Arguments

... (character) Name of the individual parameters whose values must be displayed. Call getIndividualParameterModel to get a list of the individual parameters present within the current project.

Value

A data.frame giving the last simulated values of the individual random effects of interest for each replicate of each subject.

See Also

getIndividualParameterModel, getSimulatedIndividualParameters

Click here to see examples

#

simEtas = getSimulatedRandomEffects() 

# retrieve the values of all the available individual random effects

simEtas

     rep   id    Cl     V     ka

      1    1   0.022  0.37  1.79

      1    2   0.033  0.42  -0.92

      .    .    ...    ...  ...

      2    1   0.021  0.33  1.47

      .    .    ...    ...  ...

simEtas = getSimulatedRandomEffects("Cl", "V") 

# retrieve the values of the simulated random effects for "Cl" and "V" 

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Get statistical tests results

Description

Get the results of performed statistical tests.
Existing tests: Wald, Individual parameters normality, individual parameters marginal distribution, random effects normality,
random effects correlation, individual parameters vs covariates correlation, random effects vs covariates correlation,
residual normality and residual symmetry.
WARNING: Only the tests performed during the last scenario run can provide results.

Usage

getTests()

Value

A list associating the name of the test to the corresponding results values computed during the last scenario run.

Click here to see examples

#

getTests()

 -> list(  wald = [...] ,

           individualParametersNormality = [...] ,

           ... )

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Compute the charts data

Description

Compute (if needed) and export the charts data of a given plot or, if not specified, all the available project plots.

Usage

computeChartsData(plot = NULL, output = NULL, exportVPCSimulations = NULL)

Arguments

plot (character) [optional][Monolix] Plot type. If not specified, all the available project plots will be considered. Available plots: bivariatedataviewer, covariateviewer, outputplot, indfits, obspred, residualsscatter, residualsdistribution, vpc, npc, predictiondistribution, parameterdistribution, randomeffects, covariancemodeldiagnosis, covariatemodeldiagnosis, likelihoodcontribution, fisher, saemresults, condmeanresults, likelihoodresults.
output (character) [optional][Monolix] Plotted output (depending on the software, it can represent an observation, a simulation output, …). By default, all available outputs are considered.
exportVPCSimulations (logical) [optional][Monolix] Should VPC simulations be exported if available. Equals FALSE by default.
NOTE: If ‘plot” argument is not provided, ‘output’ and “task’ arguments are ignored.

Details

computeChartsData can be used to compute and export the charts data for plots available in the graphical user interface as in Monolix, PKanalix or Simulx, when you export > export charts data.

The exported charts data is saved as txt files in the result folder, in the ChartsData subfolder.

Notice that it does not impact the current scenario.

To get a ggplot equivalent to the plot in the GUI, but customizable in R with the ggplot2 library, better use one of the plot… functions available in the connectors for Monolix and PKanalix (not available for Simulx). To get the charts data for one of these plot functions as a dataframe, you can use getChartsData.

See Also

getChartsData

Click here to see examples

#

computeChartsData() # Monolix - PKanalix - Simulx

computeChartsData(plot = "vpc", output = "y1") # Monolix

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix] Get last run status

Description

Return an execution report about the last run with a summary of the error which could have occurred.

Usage

getLastRunStatus()

Value

A structure containing

  1. a logical which equals TRUE if the last run has successfully completed,
  2. a summary of the errors which could have occurred.

Click here to see examples

#

lastRunInfo = getLastRunStatus()

lastRunInfo$status

 -> TRUE

lastRunInfo$report

 -> ""

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Get current scenario

Description

Get the list of tasks that will be run at the next call to runScenario. For Monolix, get in addition the associated method (linearization true or false), and the associated list of plots.

Usage

getScenario()

Details

For Monolix, getScenario returns a given list of tasks, the linearization option and the list of plots.
Every task in the list is associated to a logical
NOTE: Within a MONOLIX scenario, the order according to which the different algorithms are run is fixed:

Algorithm Algorithm Keyword
Population Parameter Estimation “populationParameterEstimation”
Conditional Mode Estimation (EBEs) “conditionalModeEstimation”
Sampling from the Conditional Distribution “conditionalDistributionSampling”
Standard Error and Fisher Information Matrix Estimation “standardErrorEstimation”
LogLikelihood Estimation “logLikelihoodEstimation”
Plots “plots”

For PKanalix, getScenario returns a given list of tasks.
Every task in the list is associated to a logical
NOTE: Within a PKanalix scenario, the order according to which the different algorithms are run is fixed:

Algorithm Algorithm keyword
Non Compartmental Analysis “nca”
Bioequivalence estimation “be”

For Simulx, setScenario returns a given list of tasks.
Every task in the list is associated to a logical
NOTE: Within a Simulx scenario, the order according to which the different algorithms are run is fixed:

Algorithm Algorithm keyword
Simulation “simulation”
Outcomes and endpoints “endpoints”

Note: every task can also be run separately with a specific function, such as runSimulation in Simulx, runEstimation in Monolix. The CA task in PKanalix cannot be part of a scenario, it must be run with runCAEstimation.

Value

The list of tasks that corresponds to the current scenario, indexed by task names.

See Also

setScenario

Click here to see examples

#

[MONOLIX]

scenario = getScenario()

scenario

 -> $tasks 

    populationParameterEstimation conditionalDistributionSampling conditionalModeEstimation standardErrorEstimation logLikelihoodEstimation plots

    TRUE                          TRUE							 TRUE                      FALSE                   FALSE                   FALSE 

    $linearization = T

    $plotList = "outputplot", "vpc"

[PKANALIX]

scenario = getScenario()

scenario

    nca     be 

   TRUE  FALSE

[SIMULX]

scenario = getScenario()

scenario

  simulation  endpoints 

        TRUE      FALSE

## End(Not run) 


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Run scenario

Description

Run the scenario that has been set with setScenario.

Usage

runScenario()

Details

A scenario is a list of tasks to be run. Setting the scenario is equivalent to selecting tasks in Monolix, PKanalix or Simulx GUI that will be performed when clicking on RUN.

If exportchartsdata preference is set to TRUE with setPreferences, runscenario generates the charts data in the result folder.

Every task can also be run separately with a specific function, such as runSimulation in Simulx, runEstimation in Monolix. The CA task in PKanalix cannot be part of a scenario, it must be run with runCAEstimation.

See Also

setScenario getScenario

Click here to see examples

#

runScenario()

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix – PKanalix – Simulx] Set scenario

Description

Clear the current scenario and build a new one from a given list of tasks.

Usage

setScenario(...)

Arguments

... A list of tasks as previously defined

Details

A scenario is a list of tasks to be run by runScenario. Setting the scenario is equivalent to selecting tasks in Monolix, PKanalix or Simulx GUI that will be performed when clicking on RUN.

For Monolix, setScenario requires a given list of tasks, the linearization option and the list of plots.
Every task in the list should be associated to a logical
NOTE: by default the logical is FALSE, thus, the user can only state what will run during the scenario.
NOTE: Within a MONOLIX scenario, the order according to which the different algorithms are run is fixed:

Algorithm Algorithm Keyword
Population Parameter Estimation “populationParameterEstimation”
Conditional Mode Estimation (EBEs) “conditionalModeEstimation”
Sampling from the Conditional Distribution “conditionalDistributionSampling”
Standard Error and Fisher Information Matrix Estimation “standardErrorEstimation”
LogLikelihood Estimation “logLikelihoodEstimation”
Plots “plots”

For PKanalix, setScenario requires a given list of tasks.
Every task in the list should be associated to a logical
NOTE: By default the logical is FALSE, thus, the user can only state what will run during the scenario.
NOTE: Within a PKanalix scenario, the order according to which the different algorithms are run is fixed:

Algorithm Algorithm keyword
Non Compartmental Analysis “nca”
Bioequivalence estimation “be”

For Simulx, setScenario requires a given list of tasks.
Every task in the list should be associated to a logical
NOTE: By default the logical is FALSE, thus, the user can only state what will run during the scenario.
NOTE: Within a Simulx scenario, the order according to which the different algorithms are run is fixed:

Algorithm Algorithm keyword
Simulation “simulation”
Outcomes and endpoints “endpoints”

Note: every task can also be run separately with a specific function, such as runSimulation in Simulx, runEstimation in Monolix. The CA task in PKanalix cannot be part of a scenario, it must be run with runCAEstimation.

See Also

getScenario.

Click here to see examples

#

[MONOLIX]

scenario = getScenario()

scenario$tasks = c(populationParameterEstimation = T, conditionalModeEstimation = T, conditionalDistributionSampling = T)

setScenario(scenario)

[PKANALIX]

scenario = getScenario()

scenario = c(nca = T, be = F)

setScenario(scenario)

[SIMULX]

scenario = getScenario()

scenario = c(simulation = T, endpoints = F)

setScenario(scenario)

## End(Not run)


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Sampling from the conditional distribution

Description

Estimate the conditional distribution which can be sampled from (i.e. for diagnostic plots) or used to estimate
individual parameters (i.e. the conditional mean). Note that the population
parameters must be already estimated (i.e. by calling runPopulationParameterEstimation).

Usage

runConditionalDistributionSampling()

Details

The associated method keyword is “conditionalMean” when calling getEstimatedIndividualParameters, getEtaShrinkage,
or getEstimatedRandomEffects.

See Also

getEstimatedIndividualParameters to get the mean of the conditional distribution
runPopulationParameterEstimation to estimate population parameters
runConditionalModeEstimation to estimate EBEs
runStandardErrorEstimation to estimate standard errors of the population parameters
runLogLikelihoodEstimation to estimate the log-likelihood of the model
runScenario to run multiple estimation tasks

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

runPopulationParameterEstimation()

runConditionalDistributionSampling()

indivParams_condMean = getEstimatedIndividualParameters(method = "conditionalMean")


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Estimation of the conditional modes (EBEs)

Description

Estimate the individual parameters using the conditional mode estimation algorithm (EBEs). Note that the population
parameters must be already estimated (i.e. by calling runPopulationParameterEstimation).

Usage

runConditionalModeEstimation()

Details

The associated method keyword is “conditionalMode” when calling getEstimatedIndividualParameters, getEtaShrinkage,
or getEstimatedRandomEffects.

See Also

getEstimatedIndividualParameters to get the EBEs
runPopulationParameterEstimation to estimate population parameters
runConditionalDistributionSampling to estimate the conditional distribution
runStandardErrorEstimation to estimate standard errors of the population parameters
runLogLikelihoodEstimation to estimate the log-likelihood of the model
runScenario to run multiple estimation tasks

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

runPopulationParameterEstimation()

runConditionalModeEstimation()

indivParams_EBEs = getEstimatedIndividualParameters(method = "conditionalMode")


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Log-likelihood estimation

Description

Run the log-likelihood estimation algorithm. Note that the population
parameters must be already estimated (i.e. by calling runPopulationParameterEstimation). It is recommended
to call runConditionalModeEstimation first if using the linearization method.
The following methods are available:

Method Parameter
Log-Likelihood estimation by linearization linearization = TRUE
Log-Likelihood estimation by Importance Sampling (default) linearization = FALSE

The log-likelihood outputs(-2LL (OFV), AIC, BIC, BICc) are available using the getEstimatedLogLikelihood function.

Usage

runLogLikelihoodEstimation(linearization = FALSE)

Arguments

linearization (logical) [optional] TRUE to use linearization or
FALSE to use stochastic approximation (the default)

See Also

getEstimatedLogLikelihood to get the estimated log-likelihood
runPopulationParameterEstimation to estimate population parameters
runConditionalModeEstimation to estimate EBEs
runConditionalDistributionSampling to estimate the conditional distribution
runStandardErrorEstimation to estimate standard errors of the population parameters
runScenario to run multiple estimation tasks

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

runPopulationParameterEstimation()

runLogLikelihoodEstimation()

logLike <- getEstimatedLogLikelihood()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Population parameter estimation

Description

Estimate the population parameters with the SAEM algorithm.
The initial values of the population parameters can be accessed by calling getPopulationParameterInformation
and customized with setPopulationParameterInformation.
The estimated population parameters are available using getEstimatedPopulationParameters function.

Usage

runPopulationParameterEstimation()

Arguments

parameters [optional] (data.frame) specify initial values per individual. A data.frame with column id and
columns for each parameter, similar to that returned by getEstimatedIndividualParameters.

Details

The associated method keyword is “saem” when calling getEstimatedIndividualParameters, getEtaShrinkage,
or getEstimatedRandomEffects.

See Also

getEstimatedPopulationParameters to get the estimated population parameters
getPopulationParameterInformation to get the initial values
setPopulationParameterInformation to set the initial values
runConditionalModeEstimation to estimate EBEs
runConditionalDistributionSampling to estimate the conditional distribution
runStandardErrorEstimation to estimate standard errors of the population parameters
runLogLikelihoodEstimation to estimate the log-likelihood of the model
runScenario to run multiple estimation tasks

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

runPopulationParameterEstimation()

popParams <- getEstimatedPopulationParameters()


Back to the list, PKanalix API, Monolix API, Simulx API.


[Monolix] Standard error estimation

Description

Estimate the Fisher Information Matrix (FIM) and the standard errors of the population parameters. Note that the population
parameters must be already estimated (i.e. by calling runPopulationParameterEstimation). It is recommended
to call runConditionalModeEstimation first if using the linearization method.
The following methods are available:

Method Parameter
Estimate the FIM by Stochastic Approximation linearization = FALSE (default)
Estimate the FIM by Linearization linearization = TRUE

The Fisher Information Matrix is available using getCorrelationOfEstimates function,
while the standard errors are available using getEstimatedStandardErrors function.

Usage

runStandardErrorEstimation(linearization = FALSE)

Arguments

linearization (logical) [optional] TRUE to use linearization or
FALSE to use stochastic approximation (the default)

See Also

getCorrelationOfEstimates to get the Fisher Information Matrix
getEstimatedStandardErrors to get the standard errors
runPopulationParameterEstimation to estimate population parameters
runConditionalModeEstimation to estimate EBEs
runConditionalDistributionSampling to estimate the conditional distribution
runLogLikelihoodEstimation to estimate the log-likelihood of the model
runScenario to run multiple estimation tasks

Click here to see examples

#

loadProject(file.path(getDemoPath(), "1.creating_and_using_models", "1.1.libraries_of_models", "theophylline_project.mlxtran"))

runPopulationParameterEstimation()

runStandardErrorEstimation()

stdErrs = getEstimatedStandardErrors()


Back to the list, PKanalix API, Monolix API, Simulx API.