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 Rsmlx package provides additional functions for automatic PK model building, bootstrap simulation and likelihood profiling, among others.

Note: Due to possible conflicts, the package mlxR, whose function simulx can be used to perform simulations with Monolix, should not be loaded at the same time as lixoftConnectors.





List of the R functions

 

Description of the functions concerning the algorithm settings

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

  • getFixedEffectsByAutoInit : Compute optimized values for initial population parameters.
  • getPopulationParameterInformation : Get the name, the initial value, the estimation method and, if relevant, MAP parameters value of the population parameters present in the project.
  • setInitialEstimatesToLastEstimates : Set the initial value of all the population parameters present within the current project to the ones previously estimated.
  • setPopulationParameterInformation : Set the initial value, the estimation method and, if relevant, the MAP parameters of one or several of the population parameters present within the current project (fixed effects + individual variances + error model parameters).

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

Description of the functions concerning the model building tasks

Description of the functions concerning the observation model

  • getContinuousObservationModel : Get a summary of the information concerning the continuous observation models in the project.
  • setAutocorrelation : Add or remove auto-correlation from the error model used on some of the observation models.
  • setErrorModel : Set the error model type to be used with some of the observation models.
  • setObservationDistribution : Set the distribution in the Gaussian space of some of the observation models.
  • setObservationLimits : Set the minimum and the maximum values between which some of the observations can be found.

Description of the functions concerning the plots

  • getChartsData : Compute Charts data with custom stratification options and custom computation settings.
  • plotImportanceSampling : Plot iterations of the likelihood estimation by importance sampling.
  • plotMCMC : Plot iterations and convergence for the conditional distribution task.
  • plotSaem : Plot iterations and convergence for the SAEM algorithm (population parameters estimation).

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, how 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 boolean 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.

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.
  • getEstimatedIndividualParameters : Get the last estimated values for each subject of some 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 some 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.
  • getLaunchedTasks : Get a list of the tasks which have results to provide.
  • 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

  • computeChartsData : Compute (if needed) and export the charts data of a given plot or, if not specified, all the available project plots.
  • getLastRunStatus : Return an execution report about the last run with a summary of the error which could have occurred.
  • getScenario : Get the list of tasks that will be run at the next call to runScenario.
  • runScenario : Run the scenario that has been set with setScenario.
  • setScenario : Clear the current scenario and build a new one from a given list of tasks.

[Monolix] Get conditional distribution sampling settings

Description

Get the conditional distribution sampling settings. Associated settings are:

“ratio” (0< double <1) Width of the confidence interval.
“enableMaxIterations” (bool) Enable maximum of iterations.
“nbMinIterations” (int >=1) Minimum number of iterations.
“nbMaxIterations” (int >=1) Maximum number of iterations.
“nbSimulatedParameters” (int >=1) Number of replicates.

Usage

getConditionalDistributionSamplingSettings(...)

Arguments

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

Value

An array which associates each setting name to its current value.

See Also

setConditionalDistributionSamplingSettings

Click here to see examples

#

## Not run: 

getConditionalDistributionSamplingSettings() 

# retrieve all the conditional distribution sampling settings

getConditionalDistributionSamplingSettings("ratio","nbMinIterations") 

# retrieve only the ratio and nbMinIterations settings values

## End(Not run)


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


[Monolix] Get conditional mode estimation settings

Description

Get the conditional mode estimation settings. Associated settings are:

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

Usage

getConditionalModeEstimationSettings(...)

Arguments

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

Value

An array which associates each setting name to its current value.

See Also

setConditionalModeEstimationSettings

Click here to see examples

#

## Not run: 

getConditionalModeEstimationSettings() 

# retrieve a list of all the conditional mode estimation settings

getConditionalModeEstimationSettings("nbOptimizationIterationsMode") 

# retrieve only the nbOptimizationIterationsMode setting value

## End(Not run)


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


[Monolix] Get project general settings

Description

Get a summary of the common settings for Monolix algorithms. Associated settings are:

“autoChains” (bool) Automatically adjusted the number of chains to have at least a minimum number of subjects.
“nbChains” (int >0) Number of chains. Used only if “autoChains” is set to FALSE.
“minIndivForChains” (int >0) Minimum number of individuals by chain.

Usage

getGeneralSettings(...)

Arguments

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

Value

An array which associates each setting name to its current value.

See Also

setGeneralSettings

Click here to see examples

#

## Not run: 

getGeneralSettings() # retrieve a list of all the general settings

getGeneralSettings("nbChains","autoChains")

# retrieve only the nbChains and autoChains settings values.

## End(Not run)


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


[Monolix] Get LogLikelihood algorithm settings

Description

Get the loglikelihood estimation settings. Associated settings are:

“nbFixedIterations” (int >0) Monte Carlo size for the loglikelihood evaluation.
“samplingMethod” (string) Should the loglikelihood estimation use a given number of freedom degrees (“fixed”) or test a sequence of degrees of freedom numbers before choosing the best one (“optimized”).
“nbFreedomDegrees” (int >0) Degree of freedom of the Student t-distribution. Used only if “samplingMethod” is “fixed”.
“freedomDegreesSampling” (vector<int(>0)>) Sequence of freedom degrees to be tested. Used only if “samplingMethod” is “optimized”.

Usage

getLogLikelihoodEstimationSettings(...)

Arguments

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

Value

An array which associates each setting name to its current value.

See Also

setLogLikelihoodEstimationSettings

Click here to see examples

#

## Not run: 

getLogLikelihoodEstimationSettings() # retrieve a list of all the loglikelihood estimation settings

getLogLikelihoodEstimationSettings("nbFixedIterations","samplingMethod") 

# retrieve only nbFixedIterations and samplingMethod settings values

## End(Not run)


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


[Monolix] Get MCMC algorithm settings

Description

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

“strategy” (vector<int>[3]) Number of calls for each one of the three MCMC kernels.
“acceptanceRatio” (double) Target acceptance ratio.

Usage

getMCMCSettings(...)

Arguments

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

Value

An array which associates each setting name to its current value.

See Also

setMCMCSettings

Click here to see examples

#

## Not run: 

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

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

## End(Not run)


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


[Monolix] Get population parameter estimation settings

Description

Get the population parameter estimation settings. Associated settings are:

“nbBurningIterations” (int >=0) Number of iterations in the burn-in phase.
“nbExploratoryIterations” (int >=0) If “exploratoryAutoStop” is set to FALSE, it is the number of iterations in the exploratory phase. Else wise, if “exploratoryAutoStop” is set to TRUE, it is the maximum of iterations in the exploratory phase.
“exploratoryAutoStop” (bool) Should the exploratory step automatically stop.
“exploratoryInterval” (int >0) Minimum number of interation 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” (int >=0) If “smoothingAutoStop” is set to FALSE, it is the number of iterations in the smoothing phase. Else wise, if “smoothingAutoStop” is set to TRUE, it is the maximum of iterations in the smoothing phase.
“smoothingAutoStop” (bool) Should the smoothing step automatically stop.
“smoothingInterval” (int >0) inimum number of interation 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. Used only if “smoothingAutoStop” is TRUE.
“simulatedAnnealing” (bool) Should annealing be simulated.
“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” (string) Estimation method for parameters without variability: “firstStage” | “decreasing” | “none”. Used only if arameters without variability are used in the project.
“nbOptimizationIterations” (int >=1) Number of optimization iterations.
“optimizationTolerance” (double >0) Tolerance for optimization.

Usage

getPopulationParameterEstimationSettings(...)

Arguments

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

Value

An array which associates each setting name to its current value.

See Also

setPopulationParameterEstimationSettings

Click here to see examples

#

## Not run: 

getPopulationParameterEstimationSettings() 

# retrieve a list of all the population parameter estimation settings

getPopulationParameterEstimationSettings("nbBurningIterations","smoothingInterval")

# retrieve only the nbBurningIterations and smoothingInterval settings values

## End(Not run)


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


[Monolix] Get standard error estimation settings

Description

Get the standard error estimation settings. Associated settings are:

“minIterations” (int >=1) Minimum number of iterations.
“maxIterations” (int >=1) Maximum number of iterations.

Usage

getStandardErrorEstimationSettings(...)

Arguments

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

Value

An array which associates each setting name to its current value.

See Also

setStandardErrorEstimationSettings

Click here to see examples

#

## Not run: 

getStandardErrorEstimationSettings() 

# retrieve a list of all the standard error estimation settings

getStandardErrorEstimationSettings("minIterations","maxIterations") 

# retrieve only minIterations and maxIterations settings values

## End(Not run)


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


[Monolix] Set conditional distribution sampling settings

Description

Set the value of one or several of the conditional distribution sampling settings. Associated settings are:

“ratio” (0< double <1) Width of the confidence interval.
“enableMaxIterations” (bool) Enable maximum of iterations.
“nbMinIterations” (int >=1) Minimum number of iterations.
“nbMaxIterations” (int >=1) Maximum number of iterations.
“nbSimulatedParameters” (int >=1) Number of replicates.

Usage

setConditionalDistributionSamplingSettings(...)

Arguments

... A collection of comma-separated pairs {settingName = settingValue}.

See Also

getConditionalDistributionSamplingSettings

Click here to see examples

#

## Not run: 

setConditionalDistributionSamplingSettings(ratio = 0.05, nbMinIterations = 50)

## End(Not run)


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


[Monolix] Set conditional mode estimation settings

Description

Set the value of one or several of the conditional mode estimation settings. Associated settings are:

“nbOptimizationIterationsMode” (int >=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

#

## Not run: 

setConditionalModeEstimationSettings(nbOptimizationIterationsMode = 20, 

                                     optimizationToleranceMode = 0.1)

## End(Not run)


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


[Monolix] Set common settings for algorithms

Description

Set the value of one or several of the common settings for Monolix algorithms. Associated settings are:

“autoChains” (bool) Automatically adjusted the number of chains to have at least a minimum number of subjects.
“nbChains” (int >0) Number of chains to be used if “autoChains” is set to FALSE.
“minIndivForChains” (int >0) Minimum number of individuals by chain.

Usage

setGeneralSettings(...)

Arguments

... A collection of comma-separated pairs {settingName = settingValue}.

See Also

getGeneralSettings

Click here to see examples

#

## Not run: 

setGeneralSettings(autoChains = FALSE, nbchains = 10)

## End(Not run)


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


[Monolix] Set loglikelihood estimation settings

Description

Set the value of the loglikelihood estimation settings. Associated settings are:

“nbFixedIterations” (int >0) Monte Carlo size for the loglikelihood evaluation.
“samplingMethod” (string) Should the loglikelihood estimation use a given number of freedom degrees (“fixed”) or test a sequence of degrees of freedom numbers before choosing the best one (“optimized”).
“nbFreedomDegrees” (int >0) Degree of freedom of the Student t-distribution. Used only if “samplingMethod” is “fixed”.
“freedomDegreesSampling” (vector<int(>0)>) Sequence of freedom degrees 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

#

## Not run: 

setLogLikelihoodEstimationSettings(nbFixedIterations = 20000)

## End(Not run)


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


[Monolix] Set settings associated to the MCMC algorithm

Description

Set the value of one or several of the MCMC algorithm specific settings of the current project. Associated settings are:

“strategy” (vector<int>[3]) Number of calls for each one 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

#

## Not run: 

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

## End(Not run)


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


[Monolix] Set population parameter estimation settings

Description

Set the value of one or several of the population parameter estimation settings. Associated settings are:

“nbBurningIterations” (int >=0) Number of iterations in the burn-in phase.
“nbExploratoryIterations” (int >=0) If “exploratoryAutoStop” is set to FALSE, it is the number of iterations in the exploratory phase. Else wise, if “exploratoryAutoStop” is set to TRUE, it is the maximum of iterations in the exploratory phase.
“exploratoryAutoStop” (bool) Should the exploratory step automatically stop.
“exploratoryInterval” (int >0) Minimum number of interation 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” (int >=0) If “smoothingAutoStop” is set to FALSE, it is the number of iterations in the smoothing phase. Else wise, if “smoothingAutoStop” is set to TRUE, it is the maximum of iterations in the smoothing phase.
“smoothingAutoStop” (bool) Should the smoothing step automatically stop.
“smoothingInterval” (int >0) Minimum number of interation 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. Used only if “smoothingAutoStop” is TRUE.
“simulatedAnnealing” (bool) Should annealing be simulated.
“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” (string) Estimation method for parameters without variability: “firstStage” | “decreasing” | “none”. Used only if arameters without variability are used in the project.
“nbOptimizationIterations” (int >=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

#

## Not run: 

setPopulationParameterEstimationSettings(exploratoryAutoStop = TRUE, tauOmega = 0.95)

## End(Not run)


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


[Monolix] Set standard error estimation settings

Description

Set the value of one or several of the standard error estimation settings. Associated settings are:

“minIterations” (int >=1) Minimum number of iterations.
“maxIterations” (int >=1) Maximum number of iterations.

Usage

setStandardErrorEstimationSettings(...)

Arguments

... A collection of comma-separated pairs {settingName = settingValue}.

See Also

getStandardErrorEstimationSettings

Click here to see examples

#

## Not run: 

setStandardErrorEstimationSettings(minIterations = 20, maxIterations = 250)

## End(Not run)


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


[Monolix] Get the results of the assessment

Description

Get the results of the assessment.

Usage

getAssessmentResults()

Value

A vector of lists containing, for each assessment run:

  • populationParameters: results of population parameter estimation using SAEM:
    • nbexploratoryiterations (int) number of iterations during exploratory phase
    • nbsmoothingiterations (int) 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 (string) fisher method used (stochasticApproximation or linearization)
    • values (vector) standard error associated to each population parameter
  • loglikelihood: [optional] results of log-likelihood estimation
    • method (string) fisher method used (importanceSampling or linearization)
    • AIC (double)
    • BIC (double)
    • BICc (double) modified BIC
    • LL (double)
    • chosenDegree (int) [importanceSampling]
    • standardError (double) [importanceSampling]
    • convergence (data.frame) [importanceSampling]

See Also

runAssessment

Click here to see examples

#

## Not run: 

getAssessmentResults()

## End(Not run)


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


[Monolix] Get assessment settings

Description

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

Usage

getAssessmentSettings()

Value

The list of settings

  • nbRuns: (int) number of runs
  • extendedEstimation: (boolean) if TRUE, standard errors and log-likelihood are estimated
  • useLin: (boolean) if TRUE, use linearization to estimate standard errors and log-likelihood instead of stochastic approximation (sd) and importance sampling (ll)
  • initialParameters: (list) a list giving, for each parameter, if its initial value is fixed (fixed = [FALSE]|TRUE) and, if is it not the case, the bounds within which the initial value is drawn (min = double, max = double)

See Also

runAssessment

Click here to see examples

#

## Not run: 

set = getAssessmentSettings()

set$nbRuns = 5

set$extendedEstimation = TRUE

set$useLin = FALSE

set$initialParameters

  parameters  fixed  min   max

1         ka  FALSE  0.5  0.75

2          V   TRUE  NaN   NaN

runAssessment(settings = set) 

## End(Not run)


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


[Monolix] Run 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 getAssessmentResults

Click here to see examples

#

## Not run: 

runAssessment()

set = getAssessmentSettings()

runAssessment(set)

## End(Not run)


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


[Monolix] Add categorical transformed covariate

Description

Create a new categorical covariate by transforming an existing one. Transformed covariates cannot be use to produce new covariates.
Call getCovariateInformation to know which covariates can be transformed.

Usage

addCategoricalTransformedCovariate(...)

Arguments

... A list of comma-separated pairs {transformedCovariateName = { from = (array<(string)>)[“basicCovariateNames”], transformed = (array<array<string>>)”transformation”} }

See Also

getCovariateInformation removeCovariate

Click here to see examples

#

## Not run: 

addCategoricalTransformedCovariate( Country2 = list(reference = "A1", 

          from = "Country", transformed = list( A1 = c("A","B"), A2 = c("C"))) 

          ) 

## End(Not run)


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


[Monolix] Add continuous transformed covariate

Description

Create a new continuous covariate by transforming an existing one. Transformed covariates cannot be use to produce new covariates.
Call getCovariateInformation to know which covariates can be transformed.

Usage

addContinuousTransformedCovariate(...)

Arguments

... A list of comma-separated pairs {transformedCovariateName = (string)”transformation”}

See Also

getCovariateInformation removeCovariate

Click here to see examples

#

## Not run: 

addContinuousTransformedCovariate( tWt2 = "3*exp(Wt)"  )

## End(Not run)


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


[Monolix] Add mixture to the covariate model

Description

Add a new latent covariate to the current model giving its name and its modality number.

Usage

addMixture(...)

Arguments

... A list of comma-separated pairs {latentCovariateName = (int)modalityNumber}

See Also

getCovariateInformation removeCovariate

Click here to see examples

#

## Not run: 

addMixture(lcat = 2)

## End(Not run)


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


[Monolix] Remove covariate

Description

Remove some of the transformed covariates (discrete and continuous) and/or latent covariates.
Call getCovariateInformation to know which covariates can be removed.

Usage

removeCovariate(...)

Arguments

... A list of covariate names.

See Also

getCovariateInformation addContinuousTransformedCovariate addCategoricalTransformedCovariate
addMixture

Click here to see examples

#

## Not run: 

removeCovariate("tWt","lcat1")

## End(Not run)


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 (string) applied transformation.
base (string) [optional] base data on which the transformation is applied.
name (string) [optional] name of the covariate.

See Also

deleteAdditionalCovariate

Click here to see examples

#

## Not run: 

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 (string) [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 = <string> “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

#

## Not run: 

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

LINE [ int ]

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

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

ID [ string | int ]

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

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 [int]

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

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

OCC [ int ]

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 [ string ]

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 [ string (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 (string) [optional] created data set name. If not defined, the default name is “currentDataSet_filtered”.
origin (string) [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 = <string> “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

#

## Not run: 

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

LINE [ int ]

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

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

ID [ string | int ]

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

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 [int]

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

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

OCC [ int ]

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 [ string ]

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 [ string (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 (string) name of the covariate.

See Also

addAdditionalCovariate

Click here to see examples

#

## Not run: 

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 (string) data set name.

See Also

createFilter

Click here to see examples

#

## Not run: 

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 (string) [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
)

Arguments

dataFile (string) Path to the original data file.
formattedFile (string) Path to the data file that will be exported (must end with the .csv extension).
headerLines (optional) (int or vector<int>) 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 containing information about ID, time, volume (in case of urine data) and sort columns.

  • id (string) – Name of the column distinguishing data from different individuals.
  • time (string) – Name of the column containing observation times (in case of plasma data).
  • sort (string or vector<string>) – Name of the column(s) distinguishing different profiles.
  • start (string) – Name of the column containing urine collection start times (in case of urine data).
  • end (string) – Name of the column containing urine collection end times (in case of urine data).
  • volume (string) – Name of the column containing collected volume of urine samples (in case of urine data).
linesToExclude (optional) (int or vector<int>) 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 (bool) – If TRUE, different observations will be distinguished with the observation ID column (default), otherwise they will be distinguished with occasions.
  • duplicateInformation (bool) – 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 (string) – Name of the column containing observations.
  • censoring (list) – List of lists containing information about different types of censored data (not necessary if there is no censored data):
    • type (string) – Type of censoring, one of “LLOQ”, “ULOQ”, or “interval”.
    • tags (string or vector<string>) – 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 string – 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 (string) – 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) (bool) – If TRUE, occasions will be created for each dose interval.
treatments (optional) (list) 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 (string, 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 (string, 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 (string, 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 (int) – Number of repetitions.
additionalColumns (optional) (string or vector<string>) Path(s) to the file(s) containing additional columns (needs to have the ID column).

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.

Click here to see examples

#

# example: create a new project with a dataset to format:

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_h"),

           observations = list(header="CONC_mg_L",

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

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

           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_h"),

           observations = list(header="CONC_mg_L",

                               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_h"),

           observations = list(header="CONC_mg_L",

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

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

           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_h"),

           observations = list(header="CONC_mg_L",

                               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_h", sort="FORM"),

           observations = list(header="CONC_mg_L", 

                               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: a string, the name of the data set
  • file: a string, the path of the data set file
  • current: a boolean 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

#

## Not run: 

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<string>): covariate names
  • type (vector<string>): covariate types. Existing types are “continuous”, “continuoustransformed”, “categorical”, “categoricaltransformed”./
    In Monolix mode, “latent” covariates are also allowed.
  • [Monolix] modalityNumber (vector<int>): 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

#

## Not run: 

info = getCovariateInformation() # Monolix mode with latent covariates

info

  -> $name

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

  -> $type

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

  -> $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 from a loaded project.

Usage

getFormatting()

[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<string>): observation names.
  • type (vector<string>): observation generic types. Existing types are “continuous”, “discrete”, “event”.
  • [Monolix] detailedType (vector<string>): observation specialized types set in the structural model. Existing types are “continuous”, “bsmm”, “wsmm”, “categorical”, “count”, “exactEvent”, “intervalCensoredEvent”.
  • [Monolix] mapping (vector<string>): 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

#

## Not run: 

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 (string)
  • time (double)
  • amount (double)
  • [optional] administrationType (int)
  • [optional] infusionTime (double)
  • [optional] isArtificial (bool): is created from SS or ADDL column
  • [optional] isReset (bool): 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

#

## Not run: 

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 (string) current name of the covariate to rename
newName (string) new name.

See Also

addAdditionalCovariate

Click here to see examples

#

## Not run: 

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 (string) new name.
oldName (string) [optional] current name of the filtered data set to rename (current one by default)

See Also

createFilter editFilter

Click here to see examples

#

## Not run: 

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 (string) data set name.

See Also

getAvailableData

Click here to see examples

#

## Not run: 

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 information concerning the individual parameter model. The available informations are:

  • name: (string) name of the individual parameter
  • distribution: (string) distribution of the parameter values. The distribution type can be “normal”, “logNormal”, or “logitNormal”.
  • formula: (string) formula applied on individual parameters distribution
  • variability: a list giving, for each variability level, if individual parameters have variability or not
  • covariateModel: a list giving, for each individual parameter, if the related covariates are used or not.
    If no covariate is used, this field is empty.
  • correlationBlocks : a list giving, for each variability level, the blocks of the correlation matrix of the random effects.
    A block is represented by a vector of individual parameter names. If there is no block, this field is empty.

Usage

getIndividualParameterModel()

Value

A list of individual parameter model properties.

See Also

setIndividualParameterDistribution setIndividualParameterVariability setCovariateModel

Click here to see examples

#

## Not run: 

indivModel = getIndividualParameterModel()

indivModel

 -> $name

      c("ka","V","Cl")

    $distribution

      c(ka = "logNormal", V = "normal", Cl = "logNormal")

    $formula

      "\\tlog(ka) = log(ka_pop) + eta_ka\\n\\n

       \\tlog(V) = V_pop + eta_V\\n\\n

       \\tlog(Cl) = log(Cl_pop) + eta_Cl\\n\\n"

    $variability

      list( id = c(ka = TRUE, V = FALSE, Cl = TRUE) )

    $covariateModel

      list( ka = c(age = TRUE, sex = FALSE, wt = TRUE),

            V = c(age = FALSE, sex = FALSE, wt = FALSE),

            Cl = c(age = FALSE, sex = FALSE, wt = FALSE) )

    $correlationBlocks

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

## End(Not run)


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) present in the current project.

Usage

getVariabilityLevels()

Value

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

Click here to see examples

#

## Not run: 

getVariabilityLevels()

## End(Not run)


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 = vector< (array<string>)parameterNames} > }.

See Also

getVariabilityLevels getIndividualParameterModel

Click here to see examples

#

## Not run: 

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

## End(Not run)


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 = (bool)isInfluent, …} }

See Also

getCovariateInformation

Click here to see examples

#

## Not run: 

setCovariateModel( ka = c( Wt = FALSE, tWt = TRUE, lcat2 = TRUE),

                   Cl = c( SEX = TRUE )

                   )

## End(Not run)


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


[Monolix] Set individual parameter distribution limits

Description

Set the minimum and the maximum values between the individual parameter can be used.
Used only if the distribution of the parameter is “logitNormal”, else wise it will not be taken into account

Usage

setIndividualLogitLimits(...)

Arguments

... A list of comma-separated pairs {individualParameter = [(double)min,(double)max] }

See Also

getIndividualParameterModel

Click here to see examples

#

## Not run: 

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

## End(Not run)


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 {parameterName = (string)”distribution”}.

See Also

getIndividualParameterModel

Click here to see examples

#

## Not run: 

setIndividualParameterDistribution(V = "logNormal")

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

## End(Not run)


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


[Monolix] Set individual parameter model

Description

Set the information concerning the individual parameter model. The editable informations are:

  • distribution: (string) distribution of the parameter values. The distribution type can be “normal”, “logNormal”, or “logitNormal”.
  • limits: a list giving the distribution limits for each parameter following a “logitNormal” distribution
  • variability: a list giving, for each variability level, if individual parameters have variability or not
  • covariateModel: a list giving, for each individual parameter, if the related covariates are used or not.
  • correlationBlocks : a list giving, for each variability level, the blocks of the correlation matrix of the random effects.
    A block is represented by a vector of individual parameter names.

Usage

setIndividualParameterModel(...)

Arguments

... A list of comma-separated pairs {[info] = [value]}.

[Monolix] Individual variability management

Description

Add or remove inter-individual and/or intra-individual variability 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 = (bool)hasVariability} }.

See Also

getIndividualParameterModel

Click here to see examples

#

## Not run: 

setIndividualParameterVariability(ka = TRUE, V = FALSE)

setIndividualParameterVariability(id = list(ka = TRUE), iov1 = list(ka = FALSE))

## End(Not run)


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


[Monolix] Automatically estimate initial parameters value

Description

Compute optimized values for initial population parameters. The values are returned in the same format as getPopulationParameterInformation.

Usage

getFixedEffectsByAutoInit(parameters = NULL)

Click here to see examples

#

## Not run: 

getFixedEffectsByAutoInit() -> optimizedParameters

setPopulationParameterInformation(optimizedParameters)

## End(Not run)


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


[Monolix] Get population parameters information

Description

Get the name, the initial value, the estimation method and, if relevant, MAP parameters value of the population parameters present in the project.
It is available for fixed effects, random effects, error model parameters, and latent covariates probabilities.

Usage

getPopulationParameterInformation()

Value

A data frame giving, for each population parameter, the corresponding :

  • initialValue : (double) initial value
  • method : (string) estimation method
  • priorValue : (double) [MAP] typical value
  • priorSD : (double) [MAP] standard deviation

See Also

setPopulationParameterInformation

Click here to see examples

#

## Not run: 

info = getPopulationParameterInformation()

info

    name      initialValue   method   typicalValue  stdDeviation

  ka_pop           1.0      MLE             NA            NA

  V_pop           10.0      MAP           10.0           0.5

  omega_ka         1.0     FIXED            NA            NA

## End(Not run)


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 present within the current project to the ones previously estimated.
These the values will be used in the population parameter estimation algorithm during the next scenario run.
WARNING: If there is any set after a run, it will not be possible to set the initial values as the structure of the project has changed since last results.

Usage

setInitialEstimatesToLastEstimates(fixedEffectsOnly = FALSE)

Arguments

fixedEffectsOnly (bool) If this boolean is set to TRUE, only the fixed effects are initialized to their last estimated values. Otherwise, individual variances and error model parameters are re-initialized too. Equals FALSE by default.

See Also

getEstimatedPopulationParameters getPopulationParameterInformation

Click here to see examples

#

## Not run: 

setInitialEstimatesToLastEstimates() # fixedEffectsOnly = FALSE by default

setInitialEstimatesToLastEstimates(TRUE)

## End(Not run)


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


[Monolix] Population parameters initialization and estimation method

Description

Set the initial value, the estimation method and, if relevant, the MAP parameters of one or several of the population parameters present within the current project (fixed effects + individual variances + error model parameters).
Available methods are:

  • “FIXED”: Fixed
  • “MLE”: Maximum Likelihood Estimation
  • “MAP”: Maximum A Posteriori

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

Usage

setPopulationParameterInformation(...)

Arguments

... A list of comma-separated pairs {paramName = list( initialValue = (double), method = (string)”method”}.
In case of “MAP” method, the user can specify the associated typical value and standard deviation values by using an additional list elements {paramName = list( priorValue = (double)1, priorSD = (double)2 )}.
By default, the prior value corresponds to the the population parameter and the prior standard deviation is set to 1.

See Also

getPopulationParameterInformation

Click here to see examples

#

## Not run: 

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

                                  V_pop  = list(initialValue = 1),

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

## End(Not run)


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 (bool) [optional] Should software switch security be overpassed or not. Equals FALSE by default.

Value

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

Click here to see examples

#

## Not run: 

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

A string corresponding to Lixoft demos path corresponding to the currently active software.

Click here to see examples

#

## Not run: 

  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 (detailed models) of the model building.

Usage

getModelBuildingResults()

Value

The results of model building
All the detailed tried models are returned

  • LL: result of -2*Log-Likelihood
  • BICc: modified BIC.
  • individualModels: (data.frame) individual model for each individual parameter.
    The columns are the covariates and the elements of the data.frame notes if a covariate is used or not for the current parameter.

COSSAC send 2 additional fields:

  • tested: (vector<string>) first element is the individual parameter and the second one is the covariate.
    This combination notes if the covariate is tested or not with respect to the previous model.
  • bestModel (boolean) best model amongst all the tried models according to the chosen criterion.

SAMBA send the error model and covariance model information if there are exist

  • errorModels: chosen type for each error model
  • covarianceModels: chosen correlations between individual parameters

See Also

runModelBuilding

Click here to see examples

#

## Not run: 

getModelBuildingResults()

## End(Not run)


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


[Monolix] Get model building settings

Description

Get the settings that will be used during the run of model building.

Usage

getModelBuildingSettings()

Value

The list of settings

  • covariates: (list<string>) covariate names
  • parameters: (list<string>) parameters names
  • strategy: (string) strategy to search best model ([cossac], samba, covsamba, scm)
  • criterion: (string) crtierion to search best model ([BIC], LRT)
  • relationships: (data.frame<parameters, covariates, locked>) Use to lock relationships between parameters and covariates.
    By default, all the combinations are possible. This parameter forces the use or not of some combinations.
    See example where ka must have SEX and V must not have WEIGHT
  • threshold$lrt: threshold used by criterion LRT to continue or not 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: (boolean) computes linearization ([TRUE]) or the Importance Sampling (FALSE)

See Also

runModelBuilding

Click here to see examples

#

## Not run: 

set = getModelBuildingSettings()

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

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

-> set$relationships

  parameters covariates locked

1         ka        SEX   TRUE

2          V     WEIGHT  FALSE

runModelBuilding(settings = set) 

## End(Not run)


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


[Monolix] Run model building

Description

Run model building.
To change the initialization before a run, use getModelBuildingSettings to receive all the settings. See example.

Usage

runModelBuilding(...)

Arguments

... (list<settings>) Settings to initialize the model buildign algorithm. See getModelBuildingSettings.

See Also

getModelBuildingSettings getModelBuildingResults

Click here to see examples

#

## Not run: 

runModelBuilding()

set = getModelBuildingSettings()

runModelBuilding(settings = set)

## End(Not run)


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


[Monolix] Get continuous observation models information

Description

Get a summary of the information concerning the continuous observation models in the project. The following informations are provided.

  • prediction: (vector<string>) name of the associated prediction
  • formula: (vector<string>) formula applied on the observation
  • distribution: (vector<string>) distribution of the observation in the Gaussian space. The distribution type can be “normal”, “logNormal”, or “logitNormal”.
  • limits: (vector< pair<double,double> >) lower and upper limits imposed to the observation.
    Used only if the distribution is logitNormal. If there is no logitNormal distribution, this field is empty.
  • errormodel: (vector<string>) type of the associated error model
  • autocorrelation: (vector<bool>) defines if there is auto correlation

Call getObservationInformation to get a list of the continuous observations present in the current project.

Usage

getContinuousObservationModel()

Value

A list associating each continuous observation to its model properties.

See Also

getObservationInformation setObservationDistribution setObservationLimits
setErrorModel setAutocorrelation

Click here to see examples

#

## Not run: 

obsModels = getContinuousObservationModel()

obsModels

 -> $prediction

      c(Conc = "Cc")

    $formula

      c(Conc = "Conc = Cc + (a+b*Cc)*e")

    $distribution

      c(Conc = "logitNormal")

    $limits

      list(Conc = c(0,11.5))

    $errormodel

      c(Conc = "combined1")

    $autocorrelation

      c(Conc = TRUE)

## End(Not run)


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.
Call getObservationInformation to get a list of the observation models present in the current project.

Usage

setAutocorrelation(...)

Arguments

... Sequence of comma-separated pairs {(string)”observationModel”,(boolean)hasAutoCorrelation}.

See Also

getContinuousObservationModel

Click here to see examples

#

## Not run: 

setAutocorrelation(Conc = TRUE)

setAutocorrelation(Conc = TRUE, Effect = FALSE)

## End(Not run)


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


[Monolix] Set error model

Description

Set the error model type to be used with some of the observation models.
Call getObservationInformation to get a list of the observation models present in the current project.

Usage

setErrorModel(...)

Arguments

... A list of comma-separated pairs {observationModel = (string)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

Error model parameters will be initialized to 1 by default.
Call setPopulationParameterInformation to modify their initial value.
The value of the exponent parameter is fixed by default when using the “combined1” and “combined2” models.
Use setPopulationParameterInformation to enable its estimation.

See Also

getContinuousObservationModel setPopulationParameterInformation

Click here to see examples

#

## Not run: 

setErrorModel(Conc = "constant", Effect = "combined1")

## End(Not run)


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


[Monolix] Set observation model distribution

Description

Set the distribution in the Gaussian space of some of the observation models.
Available distribution types are “normal”, “logNormal”, or “logitNormal”.
Call getObservationInformation to get a list of the available observation models within the current project.

Usage

setObservationDistribution(...)

Arguments

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

See Also

getContinuousObservationModel

Click here to see examples

#

## Not run: 

setObservationDistribution(Conc = "normal")

setObservationDistribution(Conc = "normal", Effect = "logNormal")

## End(Not run)


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


[Monolix] Set observation model distribution limits

Description

Set the minimum and the maximum values between which some of the observations can be found.
Used only if the distribution of the error model is “logitNormal”, else wise it will not be taken into account

Usage

setObservationLimits(...)

Arguments

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

See Also

getContinuousObservationModel getObservationInformation

Click here to see examples

#

## Not run: 

setObservationLimits( Conc = c(-Inf,Inf), Effect = c(0,Inf) )

## End(Not run)


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


[Monolix – PKanalix] Compute Charts data with custom stratification options and
custom computation settings

Description

Compute Charts data with custom stratification options and custom computation settings.

Usage

getChartsData(
  plotName,
  computeSettings = NULL,
  ids = NULL,
  splitGroup = NULL,
  colorGroup = NULL,
  filter = NULL
)

Arguments

plotName (string) Name of the plot function.
computeSettings (list) list with computational settings (it can include arguments from the settings argument of the plot, as well as obsName)
ids list of ids to display (by default all ids are displayed).
splitGroup data group criteria. a list, or a list of list with fields:

  • name : The name of the covariate to use in grouping,
  • breaks : In case of a continuous covariate, a list of break values,
  • groups : [optional] In case of a categorical covariate, define groups of modalities.

(by default no split is applied).

colorGroup data group criteria. a list, or a list of list with fields:

  • name : The name of the covariate to use in grouping, or the name of the column id,
  • breaks : In case of a continuous covariate, a list of break values,
  • groups : [optional] In case of a categorical covariate, define groups of modalities.

(by default no color group is defined).

filter data filtering criteria. a list, or a list of list with fields:

  • name : the name of the covariate to filter,
  • cat : in case of a categorical covariate, the name of the category to filter,
  • interval : in case of a continuous covariate, a list of filtering intervals.

(by default no filtering is applied).

Value

A dataframe object or a list of dataframe object to pass to “data” argument
of plot functions

Click here to see examples

#

## Not run: 

  initializeLixoftConnectors(software = "pkanalix")

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

  loadProject(project)

  data <- getChartsData(plotName = "plotObservedData", ids = c(1, 2, 3, 4))

  data <- getChartsData(plotName = "plotNCAParametersCorrelation")

  initializeLixoftConnectors(software = "monolix")

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

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

  loadProject(project)

  xBinsSettings <- list(is.fixedNbBins = TRUE, nbBins = 10)

  data <- getChartsData(plotName = "plotVpc",

                        computeSettings = list(xBinsSettings = xBinsSettings))

  data <- getChartsData(plotName = "plotVpc", computeSettings = list(level = 75))

  splitGroup <- list(name = "WEIGHT", breaks = c(75))

  filter <- list(name = "WEIGHT", interval = c(75, 100))

  data <- getChartsData(plotName = "plotVpc", splitGroup = splitGroup)

  data <- getChartsData(plotName = "plotVpc", filter = filter)

## End(Not run)


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,
  data = NULL,
  settings = list(),
  stratify = list(),
  preferences = list()
)

Arguments

obs1 (string) Name of the observation to display in x axis (in dataset header).
By default the first observation is considered.
obs2 (string) Name of the observation to display in y axis (in dataset header).
By default the second observation is considered.
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotBivariateDataViewer”, …))
If data not specified, charts data will be computed inside the function.
settings List with the following settings

  • dots (bool) – If TRUE individual observations are displayed as dots (default TRUE).
  • lines (bool) – If TRUE individual observations are displayed as lines (default TRUE).
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (bool) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (bool) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (string) label on x axis (Name of obs1 by default).
  • ylab (string) label on y axis (Name of obs2 by default).
  • ncol (int) 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 (boolean) Set units in axis labels (only available with PKanalix).
  • scales (string) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument is defined
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotBivariateDataViewer”) to check available displays.

Value

A ggplot object

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  initializeLixoftConnectors(software = "monolix")

  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(ids = "10"))

  plotBivariateDataViewer(stratify = list(splitGroup = list(name = "age", breaks = 25),

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

  plotBivariateDataViewer(stratify = list(colorGroup = list(name = "wt", breaks = 75)))

  plotBivariateDataViewer(stratify = list(splitGroup = list(list(name = "age", breaks = 25),

                                                            list(name = "sex"))))

  # 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,
  data = 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).
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotCovariates”, …))
If data not specified, charts data will be computed inside the function.
settings List with the following settings

  • regressionLine (bool) If TRUE, Add regression line in scatterplots (default TRUE).
  • spline (bool) If TRUE, Add xpline in scatterplots (default FALSE).
  • histogramColors (vector<string>) List of colors to use in histograms plots.
  • histogramPosition (string) 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 (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (int) number of columns when facet = TRUE (default 4).
  • bins (int) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument 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

getChartsData getPlotPreferences

Click here to see examples

#

  initializeLixoftConnectors(software = "pkanalix")

  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(

                 splitGroup = list(name = "AGE", breaks = 25),

                 filter = list(name = "Period", cat = 1)))

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

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

                 colorGroup = list(name = "HT", breaks = 181),

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

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

                 stratify = list(splitGroup = list(list(name = "AGE", breaks = 25),

                                                   list(name = "SEQ"))))

  # Mulitple covariates

  plotCovariates()

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

  plotCovariates(stratify = list(filter = list(name = "AGE", interval = c(20, 30))))

  plotCovariates(stratify = list(splitGroup = list(name = "AGE", breaks = c(25))))

  plotCovariates(stratify = list(colorGroup = list(name = "AGE", breaks = c(25))))


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


[Monolix – PKanalix] Generate Observation plots

Description

Plot the observed data.

Usage

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

Arguments

obsName (string) Name of the observation (in dataset header).
By default the first observation is considered.
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotObservedData”, …))
If data not specified, charts data will be computed inside the function.
settings List with the following settings
[CONTINUOUS – DISCRETE] Settings specific to continuous and discrete data

  • dots (bool) – If TRUE individual observations are displayed as dots (default TRUE).
  • lines (bool) – If TRUE individual observations are displayed as lines (default TRUE).
  • mean (bool) – If TRUE mean of observations is displayed (default FALSE).
  • error (bool) If TRUE error bar is is displayed (default FALSE).
  • meanMethod (string) – When mean is set to TRUE, display arithmetic mean (“arithmetic”) or
    geometric mean (“geometric”). Default value is “arithmetic”.
  • errorMethod (string) – When error is set to TRUE, display standard deviation (“standardDeviation”) or
    standard error (“standardError”). Default value is “standardDeviation”.
  • useCensored (bool) Choose to use censored data to compute mean and error (TRUE)
    or to ignore it (FALSE) (default FALSE).
  • binLimits (bool) – Add bins limits as vertical lines (default FALSE).
  • binsSettings a list of settings for time axis binning for observation statistics computation:
    • criteria (string) – Bining criteria, one of ‘equalwidth’, ‘equalsize’, or ‘leastsquare’ methods.
      (default leastsquare).
    • is.fixedNbBins (bool) – If TRUE define a fixed number of bins, else define a range for automatic selection
      (default FALSE).
    • nbBins (int) – Define a fixed number of bins (default 10).
    • binRange (vector(int, int)) – Define a range for the number of bins (default c(5, 100)).
    • nbBinData (vector(int, int)) – Define a range for the number of data points per bin (default c(10, 200) for Monolix and c(3, 200) for PKanalix).

[DISCRETE] Settings specific to discrete data

  • plot (string) Type of plot: “continuous” (default),
    “stacked” and “grouped”.
  • histogramColors (vector<string>) 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 (boolean) – If TRUE censored data are displayed as dots, in addition to survival function (default TRUE).
  • dosingTimes (boolean) – Add dosing times as vertical lines (default FALSE).
    For project with dose information only
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) – Add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (bool) – Add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (bool) – Add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (string) – Label on x axis (default “Time”).
  • ylab (string) – Label on y axis (default obsName).
  • ncol (int) – 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 (boolean) – Set units in axis labels (only available with PKanalix).
  • scales (string) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument is defined
preferences (optional) preferences for plot display,
run getPlotPreferences(“plotObservedData”) to check available displays.

Value

A ggplot object

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  initializeLixoftConnectors(software = "pkanalix")

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

  loadProject(project)

  plotObservedData()

  plotObservedData(settings = list(binLimits = TRUE))

  plotObservedData(settings = list(dosingTimes = TRUE))

  plotObservedData(settings = list(meanMethod = "geometric", mean = TRUE))

  plotObservedData(settings = list(mean = TRUE, error = TRUE, dots = FALSE, lines = TRUE))

  # stratification

  plotObservedData(stratify = list(splitGroup = list(name = "AGE", breaks = 25),

                                   filter = list(name = "Period", cat = 1)))

  plotObservedData(stratify = list(colorGroup = list(name = "HT", breaks = 181)))

  plotObservedData(stratify = list(splitGroup = list(list(name = "AGE", breaks = 25),

                                                     list(name = "Period"))))

  # update plot theme or preferences

  plotObservedData(settings = list(xlab = "Time", ylab = "Plasma Concentration"))

  plotObservedData(preferences = list(obs = list(color = "#32CD32"),

                                      observationStatistics = list(lineType = "dashed")))


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(), data = NULL)

Arguments

settings a list of optional settings:

  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • fontsize (integer) Plot text font size.
data dataframe – Output of getChartsData
(getChartsData(“plotImportanceSampling”, …))
If data not specified, charts data will be computed inside the function.

Value

A ggplot object

See Also

getChartsData

Click here to see examples

#

  initializeLixoftConnectors(software = "monolix")

  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(), data = NULL)

Arguments

settings a list of optional settings:

  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (int) number of columns when facet = TRUE (default 4).
  • fontsize (integer) Plot text font size.
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotMCMC”, …))
If data not specified, charts data will be computed inside the function.

Value

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

See Also

getChartsData

Click here to see examples

#

  initializeLixoftConnectors(software = "monolix")

  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(), data = NULL)

Arguments

settings a list of optional settings:

  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (int) number of columns when facet = TRUE (default 4).
  • fontsize (integer) Plot text font size.
data dataframe – Output of getChartsData
(getChartsData(“plotSaem”, …))
If data not specified, charts data will be computed inside the function.

Value

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

See Also

getChartsData

Click here to see examples

#

  initializeLixoftConnectors(software = "monolix")

  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(),
  data = NULL
)

Arguments

parameters vector of parameters to display.
(by default the first 4 computed parameters are displayed).
plot (string) 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 (bool) If TRUE, plot empirical density distribution (default TRUE).
  • theoretical (bool) If TRUE, plot theoretical density distribution (default TRUE).
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (int) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument is defined
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotParametersDistribution”, …))
If data not specified, charts data will be computed inside the function.

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

#

  initializeLixoftConnectors(software="monolix")

  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(name="WEIGHT", interval=c(0, 75))))

  plotParametersDistribution(parameters="Cl", stratify=list(splitGroup=list(name="SEX")))

  colorGroup <- list(name="WEIGHT", breaks=c(75))

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

                             stratify=list(colorGroup=colorGroup, colors=c("#46B4AF", "#B4468A")))

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

                             stratify=list(colorGroup=colorGroup, colors=c("#46B4AF", "#B4468A")))

  # update preferences

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

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

  # pre compute dataset

  data <- getChartsData(plotName="plotParametersDistribution",

                        computeSettings=list(indivEstimate="simulated"))

  plotParametersDistribution(data=data)

  # 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(),
  data = NULL
)

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 (string) display random effect vs covariates (“randomEffect”),
    or transformed individual parameters vs covariates (“indivParameter”)
    (default “indivParameter”).
  • boxplotData (string) 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 (bool) If TRUE, Add regression line in scatterplots (default TRUE).
  • spline (bool) If TRUE, Add xpline in scatterplots (default FALSE).
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (int) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument is defined
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotParametersVsCovariates”, …))
If data not specified, charts data will be computed inside the function.

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

#

  initializeLixoftConnectors(software="monolix")

  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(name="WEIGHT", interval=c(0, 75))))

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

                             stratify=list(splitGroup=list(name="SEX")))

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

                             stratify=list(colorGroup=list(name="WEIGHT", breaks=75)))

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

                             stratify=list(colorGroup=list(name="SEX")))

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

                             stratify = list(colorGroup = list(list(name = "SEX"),

                                                               list(name="WEIGHT", breaks=70))))

  # pre process dataset

  data <- getChartsData(plotName="plotParametersVsCovariates",

                        computeSettings=list(indivEstimate="simulated"))

  plotParametersVsCovariates(data=data)

  # 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(colorGroup=list(name="WEIGHT", breaks=75)))

  plotParametersVsCovariates(stratify=list(colorGroup=list(name="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(),
  data = NULL
)

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 (string) 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
  • regressionLine (bool) If TRUE, Add regression line in scatterplots (default TRUE).
  • spline (bool) If TRUE, Add xpline in scatterplots (default FALSE).
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (int) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument is defined
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotRandomEffectsCorrelation”, …))
If data not specified, charts data will be computed inside the function.

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

#

  initializeLixoftConnectors(software = "monolix")

  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(parametersRows = c("ka", "V"))

  # stratification

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

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

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

                               stratify = list(

                                 colorGroup = list(name = "WEIGHT", breaks = 75),

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

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

                               stratify = list(splitGroup = list(name = "SEX")))

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

                               stratify = list(splitGroup = list(list(name = "SEX"),

                                                                 list(name="WEIGHT", breaks=70))))

  # pre compute dataset

  data <- getChartsData(plotName = "plotRandomEffectsCorrelation",

                        computeSettings = list(indivEstimate = "simulated"))

  plotRandomEffectsCorrelation(data = data)

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


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(),
  data = NULL
)

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 (bool) 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 (bool) If TRUE, plot empirical density distribution(default TRUE).
    To define when plot is “pdf” or “cdf”
  • theoretical (bool) If TRUE, plot theoretical density distribution(default TRUE).
    To define when plot is “pdf” or “cdf”
  • median (bool) If TRUE, add median line (default TRUE).
    To define when plot is “boxplot”
  • quartile (bool) If TRUE, add quartile line (default TRUE).
    To define when plot is “boxplot”
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (int) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument is defined
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotStandardizedRandomEffectsDistribution”, …))
If data not specified, charts data will be computed inside the function.

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

#

  initializeLixoftConnectors(software="monolix")

  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(name="WEIGHT", interval=c(0, 75)))

  )

  plotStandardizedRandomEffectsDistribution(parameters="Cl",

                                            stratify=list(splitGroup=list(name="SEX")))

  colorGroup <- list(name="WEIGHT", breaks=c(75))

  plotStandardizedRandomEffectsDistribution(

    parameters="Cl", plot="pdf",

    stratify=list(colorGroup=colorGroup, colors=c("#46B4AF", "#B4468A"))

  )

  plotStandardizedRandomEffectsDistribution(

    parameters="Cl", plot="cdf",

    stratify=list(colorGroup=colorGroup, colors=c("#46B4AF", "#B4468A"))

  )

  plotStandardizedRandomEffectsDistribution(

    parameters="Cl", settings=list(plot="boxplot"),

    stratify=list(colorGroup=colorGroup, colors=c("#46B4AF", "#B4468A"))

  )

  data <- getChartsData(plotName="plotStandardizedRandomEffectsDistribution",

                        computeSettings=list(indivEstimate="simulated"))

  plotStandardizedRandomEffectsDistribution(data=data)

  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(),
  data = NULL
)

Arguments

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

  • indivEstimate (string) Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”)
    (default “mode”) .
  • obsDots (bool) – If TRUE individual observations are displayed as dots (default TRUE).
  • obsLines (bool) – If TRUE individual observations are displayed as lines (default FALSE).
  • cens (bool) – If TRUE censored intervals are displayed (default TRUE).
  • indivFits (bool) – If TRUE individual fits are displayed (default TRUE).
  • popFits (bool) – If TRUE population fits (typical individual) are displayed (default FALSE).
  • popCov (bool) – If TRUE population fits (individual covariates) are displayed (default FALSE).
  • predMedian (bool) – If TRUE median of individual fits computed based on multiple simulations (default FALSE).
  • predInterval (bool) – If TRUE 90 % prediction interval of individual fits computed based on multiple simulations (default FALSE).
  • splitOccasions (bool) – If TRUE occasions are displayed on separate plots (default TRUE).
  • dosingTimes (boolean) – Add dosing times as vertical lines (default FALSE).
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (bool) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (bool) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (string) label on x axis (default “Time”).
  • ylab (string) label on y axis (default obsName).
  • ncol (int) 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 (string) 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

  • ids – List of ids to display (by default all ids are displayed).
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument is defined
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotIndividualFits”, …))
If data not specified, charts data will be computed inside the function.

Details

Only available for Continuous data.

Value

A ggplot object

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  initializeLixoftConnectors(software = "monolix")

  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(ids=c(1, 2, 3, 4)))

  plotIndividualFits(stratify=list(filter=list(name="WEIGHT", interval=c(75, 100))))

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

  plotIndividualFits(stratify=list(colorGroup=list(name="SEX"), colors=c("#5DC088", "#DBA92B")))

  plotIndividualFits(

    settings=list(legend=T),

    stratify = list(colorGroup=list(list(name = "SEX"),

                                    list(name = "WEIGHT", breaks = 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)

  data <- getChartsData(plotName="plotIndividualFits",

                        computeSettings=list(indivEstimate="mean"),

                        ids=c(1, 2, 3, 4))

  plotIndividualFits(data=data)


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(),
  data = NULL
)

Arguments

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

  • indivEstimate (string) Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”), conditional distribution (“simulated”)
    (default “mode”).
  • useCensored (bool) Choose to use BLQ data (TRUE) or to ignore it (FALSE)
    to compute the statistics (default TRUE).
  • censoring (string) BLQ data can be simulated (‘simulated’),
    or can be equal to the limit of quantification (‘loq’) (default ‘simulated’).
  • obs (bool) – If TRUE observations are displayed as dots (default TRUE).
  • cens (bool) – If TRUE censoring data are displayed as red dots (default TRUE).
  • spline (bool) – If TRUE add spline (default FALSE).
  • identityLine (bool) – If TRUE add identity line (default TRUE).
  • predInterval (bool) – If TRUE add 90% prediction interval (default FALSE).
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (bool) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (bool) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • ncol (int) 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 (string) Should scales be fixed (“fixed”),
    free (“free”, the default), or free in one dimension (“free_x”, “free_y”) (default “free”).
  • ylab (string) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument is defined
data List of cahrts data as dataframe – Output of getChartsData
(getChartsData(“plotObservationsVsPredictions”, …))
If data not specified, charts data will be computed inside the function.

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

#

  initializeLixoftConnectors(software = "monolix")

  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))

  # stratification

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

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

  plotObservationsVsPredictions(stratify = list(splitGroup = list(name = "WEIGHT", breaks = c(75))))

  plotObservationsVsPredictions(stratify = list(colorGroup = list(name = "WEIGHT", breaks = c(75))))

  plotObservationsVsPredictions(

    settings=list(legend=T),

    stratify = list(colorGroup=list(list(name = "SEX"),

                                    list(name = "WEIGHT", breaks = 70)))

  )

  data <- getChartsData(plotName = "plotObservationsVsPredictions",

                        computeSettings = list(indivEstimate = "simulated"),

                        colorGroup = list(name = "WEIGHT", breaks = c(75)))

  plotObservationsVsPredictions(data = data)

  # 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(),
  data = NULL
)

Arguments

obsName (string) Name of the observation (in dataset header).
By default the first observation is considered.
residuals (string) 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 (string) Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”), conditional distribution (“simulated”)
    (default “simulated”).
  • useCensored (bool) Choose to use BLQ data (TRUE) or to ignore it (FALSE) to compute the statistics (default TRUE).
    For continuous data only.
  • censoring (string) BLQ data can be simulated (‘simulated’), or can be equal to the limit of quantification (‘loq’)
    (default ‘simulated’).
    For continuous data only.
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • ncol (int) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument is defined
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotResidualsDistribution”, …))
If data not specified, charts data will be computed inside the function.

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

#

  initializeLixoftConnectors(software="monolix")

  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(name="SEX", cat="F")))

  plotResidualsDistribution(stratify=list(splitGroup=list(name="WEIGHT", breaks=c(75))))

  plotResidualsDistribution(

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

    stratify = list(splitGroup=list(list(name = "SEX"),

                                    list(name = "WEIGHT", breaks = 70)))

  )

  data <- getChartsData(plotName="plotResidualsDistribution",

                        computeSettings=list(indivEstimate="simulated"))

  plotResidualsDistribution(data=data)

  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(),
  data = NULL
)

Arguments

obsName (string) Name of the observation (in dataset header).
By default the first observation is considered.
residuals (string) List of residuals to display:
population residuals (“pop”), individual residuals (“indiv”),
normalized prediction distribution error (“npde”)
(default c(“indiv”)).
xaxis (string) 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 (string) Calculation of individual estimates: conditional mean (“mean”),
    conditional mode with EBE’s (“mode”), conditional distribution (“simulated”)
    (default “mode”).
    For continuous data only
  • level (int) level for prediction intervals computation (default 90).
  • higherPercentile (int) Higher percentile for empirical and predicted percentiles computation (default 90).
  • useCensored (bool) Choose to use BLQ data (TRUE) or to ignore it (FALSE) to compute the statistics (default TRUE).
    For continuous data only.
  • censoring (string) 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 (string) Bining criteria, one of ‘equalwidth’, ‘equalsize’, or ‘leastsquare’ methods.
      (default leastsquare).
    • is.fixedNbBins (bool) If TRUE define a fixed number of bins, else define a range for automatic selection
      (default TRUE).
    • nbBins (int) Define a fixed number of bins (default 10).
    • binRange (vector(int, int)) Define a range for the number of bins (default c(5, 100)).
    • nbBinData (vector(int, int)) Define a range for the number of data points per bin (default c(10, 200)).
  • residuals (bool) – If TRUE display residuals (default TRUE).
  • cens (bool) – If TRUE display censored data (default TUE).
  • empPercentiles (bool) – If TRUE display empirical percentiles (default FALSE).
  • predPercentiles (bool) – If TRUE display predicted percentiles (default FALSE).
  • spline (bool) – If TRUE display spline (default FALSE).
  • binLimits (bool) – If TRUE Add bins limits as vertical lines (default FALSE).
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (bool) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (bool) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • ncol (int) 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 (string) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument is defined
data List of cahrts data as dataframe – Output of getChartsData
(getChartsData(“plotResidualsScatterPlot”, …))
If data not specified, charts data will be computed inside the function.

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

#

  initializeLixoftConnectors(software="monolix")

  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))

  # Stratification

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

  plotResidualsScatterPlot(stratify=list(splitGroup=list(name="WEIGHT", breaks=c(75))))

  plotResidualsScatterPlot(stratify=list(colorGroup=list(name="WEIGHT", breaks=c(75))))

  data <- getChartsData(plotName="plotResidualsScatterPlot",

                        computeSettings=list(indivEstimate="simulated"))

  plotResidualsScatterPlot(data=data)

  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")


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(),
  data = NULL
)

Arguments

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

  • level (int) level for prediction intervals computation (default 90).
  • nbPoints (int) 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 (bool) If TRUE Empirical data is displayed (default TRUE).
  • theoretical (bool) If TRUE theoretical data is displayed (default FALSE):
  • predInterval (bool) If TRUE Prediction intervalis displayed (default TRUE).
  • outlierAreas (bool) If TRUE Add red areas indicating empirical percentiles that are outside prediction intervals (default TRUE).
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (bool) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (bool) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (string) label on x axis (default “Time”).
  • ylab (string) label on y axis (default obsName).
  • ncol (int) 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 (string) 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.
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotBlqPredictiveCheck”, …))
If data not specified, charts data will be computed inside the function.

Value

a ggplot2 object

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  initializeLixoftConnectors(software = "monolix")

  # 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(),
  data = NULL
)

Arguments

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

  • level (int) level for prediction intervals computation (default 90).
  • nbPoints (int) Number of points for cdf grid computation (default 100).
  • useCensored (bool) Choose to use BLQ data (TRUE) or to ignore it (FALSE) to compute the VPC (default TRUE).
    For continuous data only.
  • censoring (string) BLQ data can be simulated (‘simulated’),
    or can be equal to the limit of quantification (‘loq’)
    (default ‘simulated’). For continuous data only.
  • empirical (bool) – If TRUE, Empirical data is displayed (default TRUE):
    empirical percentiles for continuous data; empirical probability for discrete data;
    empirical curve for event data
  • theoretical (bool) – If TRUE, median is displayed (default FALSE): median of predicted percentiles
  • predInterval (bool) – If TRUE, Prediction interval is displayed (default TRUE).
  • outlierAreas (bool) -If TRUE Add red areas indicating empirical percentiles that are outside prediction intervals (default TRUE).
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (bool) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (bool) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (string) label on x axis (default “Time”).
  • ylab (string) label on y axis (default obsName).
  • ncol (int) 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 (string) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values.
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter.
    • interval – in case of a continuous covariate, a list of filtering intervals.
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotNpc”, …))
If data not specified, charts data will be computed inside the function.

Value

a ggplot2 object

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  initializeLixoftConnectors(software = "monolix")

  # 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(),
  data = NULL
)

Arguments

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

  • perc (bool) – If TRUE display 9 Bands for each percentile (default TRUE).
  • median (bool) – If TRUE display Median (default TRUE).
  • obs (bool) – If TRUE display observations as dots (default FALSE).
  • cens (bool) – If TRUE display censored observations as dots (default FALSE).
  • binLimits (bool) If TRUE display limits of bins (default FALSE).
    For discrete data only.
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (bool) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (bool) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (string) label on x axis (default “Time”).
  • ylab (string) label on y axis (default obsName).
  • ncol (int) 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 (string) 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.
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotPredictionDistribution”, …))
If data not specified, charts data will be computed inside the function.

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

#

  initializeLixoftConnectors(software = "monolix")

  # continuous data

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

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

  loadProject(project)

  runPopulationParameterEstimation()

  plotPredictionDistribution()


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 = "survivalFunction",
  settings = list(),
  preferences = list(),
  stratify = list(),
  data = NULL
)

Arguments

obsName (string) Name of the observation (in dataset header).
By default the first observation is considered.
eventPlot (string) Display Survival function (“survivalFunction”) or average number of event (“averageEventNumber)
(default “survivalFunction”).
For event data only.
settings a list of optional settings:

  • level (int) level for prediction intervals computation (default 90),
  • higherPercentile (int) Higher percentile for empirical and predicted percentiles computation (default 90).
    For continuous data only.
  • useCorrpred (bool) if TRUE, pcVPC are computed using Uppsala prediction correction (default FALSE).
    For continuous data only.
  • useCensored (bool) Choose to use BLQ data (TRUE) or to ignore it (FALSE) (default TRUE).
    For continuous data only.
  • censoring (string) BLQ data can be simulated (‘simulated’), or can be equal to the limit of quantification (‘loq’)
    (default ‘simulated’).
    For continuous data only.
  • timeAfterLastDose (bool) display vpc only after last dose (default FALSE)
    For data with dose information only.
  • nbDataPoints (int) 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 (string) Bining criteria, one of ‘equalwidth’, ‘equalsize’, or ‘leastsquare’ methods.
      (default leastsquare).
    • is.fixedNbBins (bool) If TRUE define a fixed number of bins, else define a range for automatic selection
      (default FALSE).
    • nbBins (int) Define a fixed number of bins (default 10).
    • binRange (vector(int, int)) Define a range for the number of bins (default c(5, 100)).
    • nbBinData (vector(int, int)) 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 (string) Bining criteria, one of ‘equalwidth’, ‘equalsize’, or ‘leastsquare’ methods.
      (default leastsquare).
    • is.fixedNbBins (bool) If TRUE define a fixed number of bins, else define a range for automatic selection
      (default TRUE).
    • nbBins (int) Define a fixed number of bins (default 10).
    • binRange (vector(int, int)) Define a range for the number of bins (default c(5, 100)).
    • nbBinData (vector(int, int)) Define a range for the number of data points per bin (default c(10, 200)).
  • obs (bool) – If TRUE, Observed data is displayed as dots (defaul FALSE).
  • cens (bool) – If TRUE, Censored data is displayed as dots (defaul FALSE).
  • empirical (bool) – If TRUE, Empirical data is displayed (default TRUE):
    empirical percentiles for continuous data; empirical probability for discrete data;
    empirical curve for event data
  • theoretical (bool) – 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 (bool) – If TRUE, Prediction interval is displayed (default TRUE).
  • linearInterpolation (bool) – If TRUE set piece wise display for prediction intervals,
    else show bins as rectangular (default TRUE).
  • outlierDots (bool) – If TRUE, Add red dots indicating empirical percentiles that are outside prediction intervals (default TRUE).
  • outlierAreas (bool) – If TRUE Add red areas indicating empirical percentiles that are outside prediction intervals (default TRUE).
  • binLimits (bool) – Add/remove vertical lines on the scatter plots to indicate the bins (default FALSE).
  • legend (bool) add (TRUE) / remove (FALSE) plot legend (default FALSE).
  • grid (bool) add (TRUE) / remove (FALSE) plot grid (default TRUE).
  • xlog (bool) add (TRUE) / remove (FALSE) log scaling on x axis (default FALSE).
  • ylog (bool) add (TRUE) / remove (FALSE) log scaling on y axis (default FALSE).
  • xlab (string) label on x axis (default “Time”).
  • ylab (string) label on y axis (default obsName).
  • ncol (int) 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 (string) 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

  • ids – List of ids to display (by default all ids are displayed).
  • splitGroup – Split plots by groups of covariates (by default no split is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • colorGroup – Color plots by groups of covariates (by default no color is applied).
    A list, or a list of list with fields:

    • name : The name of the covariate to use in grouping, or the name of the column id,
    • breaks : In case of a continuous covariate, a list of break values,
    • groups : [optional] In case of a categorical covariate, define groups of modalities.
  • filter – Filter data (by default no filtering is applied).
    A list, or a list of list with fields:

    • name – the name of the covariate to filter,
    • cat – in case of a categorical covariate, the name of the category to filter,
    • interval – in case of a continuous covariate, a list of filtering intervals.
  • colors – List of colors to use when colorGroup argument is defined
data List of charts data as dataframe – Output of getChartsData
(getChartsData(“plotVpc”, …))
If data not specified, charts data will be computed inside the function.

Value

a ggplot2 object

See Also

getChartsData getPlotPreferences

Click here to see examples

#

  initializeLixoftConnectors(software = "monolix")

  # continuous data

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

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

  loadProject(project)

  runPopulationParameterEstimation()

  data <- getChartsData("plotVpc")

  p <- plotVpc(data = data, obsName = "CONC",

               settings = list(outlierDots = FALSE, grid = FALSE,

                               ylab = "Concentration", xlab = "time (in hour)"))

  # categorical data

  project <- file.path(getDemoPath(), "3.models_for_noncontinuous_outcomes",

                       "3.1.categorical_data_model", "categorical1_project.mlxtran")

  loadProject(project)

  runPopulationParameterEstimation()

  data <- getChartsData(plotName = "plotVpc")

  p <- plotVpc(data = data, 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()

  data <- getChartsData(plotName = "plotVpc")

  p <- plotVpc(data = data, 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()

  data <- getChartsData(plotName = "plotVpc")

  plotVpc(data = data, 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 (string) 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

#

## Not run: 

  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 – 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 (boolean) [optional][Monolix – PKanalix] Save data and/or structural model file next to exported project ([TRUE] | FALSE). Forced to TRUE for Simulx.
  • dataFilePath (emphcharacter) [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 (emphcharacter) [optional][Monolix] Dataset used in the exported project ([“original”] | “vpc” | “individualFits”)
  • modelFileName (emphcharacter) [optional][Simulx] Name of the exported model file.
force (bool) [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

#

## Not run: 

[PKanalix only]

exportProject(settings = list(targetSoftware = "monolix", filesNextToProject = F))

[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 (string): path to the data file
  • header (array<character>): vector of header names
  • headerTypes (array<character>): vector of header types
  • observationNames (vector<string>): vector of observation names
  • observationTypes (vector<string>): vector of observation types
  • nbSSDoses (int): number of doses (if there is a SS column)

Usage

getData()

Value

A list describing project data.

See Also

setData

Click here to see examples

#

## Not run: 

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")

## 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, how it is displayed in the Data tab in the interface.
Interpretation of data includes, but is not limited to, data formatting, addition of doses through the ADDL column and steady state settings, addition of additional covariates, interpolation of regressors.

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 (string) 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 raw string.

Click here to see examples

#

## Not run: 

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 (string) One of the MonolixSuite library of models. Possible values are “pk”, “pd”, “pkpd”, “pkdoubleabs”, “pm”, “tmdd”, “tte”, “count” and “tgi”.
filters (list(name = string)) 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

#

## Not run: 

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:
    • data (string) Data name
    • prediction (string) Prediction name
    • model [Monolix] (string) Model observation name (for continuous observations only)
    • type (string) Type of linked data (“continuous” | “discrete” | “event”)
  • freeData (list<list>) A list of lists describing not mapped data:
    • data (string) Data name
    • type (string) Data type
  • freePredictions (list<list>) A list of lists describing not mapped predictions:
    • prediction (string) Prediction name
    • type (string) Prediction type

See Also

setMapping

Click here to see examples

#

## Not run: 

f = getMapping()

f$mapping

  -> list( list(data = "1", prediction = "Cc", model = "concentration", type = "continuous"),

           list(data = "2", prediction = "Level", type = "discrete") )

f$freeData

  -> list( list(data = "3", type = "event") )

f$freePredictions

  -> list( list(prediction = "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

A string corresponding to the path to the structural model file.

See Also

For Monolix and PKanalix only: setStructuralModel

Click here to see examples

#

## Not run: 

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

#

## Not run: 

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 boolean saying if a project is currently loaded.

Usage

isProjectLoaded()

Value

TRUE if a project is currently loaded, FALSE otherwise

Click here to see examples

#

initializeLixoftConnectors("monolix")

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

#

## Not run: 

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)

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 (string): Path to the data file. Can be absolute or relative to the current working directory.
  • headerTypes (array<character>): A collection of header types. The possible header types are: “ignore”, “ignoredline”, “id”, “time”, “observation”, “amount”, “contcov”, “catcov”, “occ”, “evid”, “mdv”, “obsid”, “cens”, “limit”, “regressor”,”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 (int): Number of doses (if there is a SS column for steady-state).
  • mapping [optional](list): A list of lists representing a link between observation types and model outputs. Each list contains:
    • data (string) Name of observation type
    • prediction (string) Prediction name
    • model [Monolix] (string) Model observation name (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

#

# Create a new Monolix project

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"), 

                       observationTypes = list("1" = "continuous", "2" = "continuous"),

                       mapping = list(list(data = "1",

                                           prediction = "Cc",

                                           model = "y1"),

                                      list(data = "2",

                                           prediction = "R",

                                           model = "y2"))),

           modelFile = "lib:oral1_1cpt_IndirectModelInhibitionKin_TlagkaVClR0koutImaxIC50.txt")                                     

# 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

#

## Not run: 

[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, nbSSDoses = NULL)

Arguments

dataFile (character): Path to the data file. Can be absolute or relative to the current working directory.
headerTypes (array<character>): A collection of header types.
The possible header types are: “ignore”, “ignoredline”, “id”, “time”, “observation”, “amount”, “contcov”, “catcov”, “occ”, “evid”, “mdv”, “obsid”, “cens”, “limit”, “regressor”,”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](int): Number of doses (if there is a SS column).

See Also

getData

Click here to see examples

#

## Not run: 

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"))

## 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:

  • data (string) Data name
  • prediction (string) Prediction name
  • model [Monolix] (string) Model observation name (for continuous observations only)

See Also

getMapping

Click here to see examples

#

## Not run: 

[Monolix] setMapping(list(list(data = "1", prediction = "Cc", model = "concentration"), list(data = "2", prediction = "Level")))

[PKanalix] setMapping(list(list(data = "1", prediction = "Cc"), list(data = "2", prediction = "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

#

## Not run: 

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] 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” (bool) Use relative path for save/load operations.
“threads” (int >0) Number of threads.
“temporarydirectory” (string) Path to the directory used to save temporary files.
“timestamping” (bool) Create an archive containing result files after each run.
“delimiter” (string) Character use as delimiter in exported result files.
“exportchartsdata” (bool) Should charts data be exported.
“exportchartsdatasets” (bool) [Monolix] Should charts datasets be exported if possible.
“exportvpcsimulations” (bool) [Monoliw] Should vpc simulations be exported if possible.
“exportsimulationfiles” (bool) [Simulx] Should simulation results files be exported.
“headeraliases” (list(“header” = vector<string>)) For each header, the list of the recognized aliases.
“ncaparameters” (vector<string>) [PKanalix] Defaulty computed NCA parameters.
“units” (list(“type” = string) [PKanalix] Time, amount and/or volume units.

Usage

getPreferences(...)

Arguments

... [optional] (string) Name of the preference whose value should be displayed. If no argument is provided, all the preferences are returned.

Value

An array which associates each preference name to its current value.

Click here to see examples

#

## Not run: 

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” (string) Path to the folder where simulation results will be saved. It should be a writable directory.
“exportResults” (bool) Should results be exported.
“seed” (0< int <2147483647) Seed used by random generators.
“grid” (int) Number of points for the continuous simulation grid.
“nbSimulations” (int) Number of simulations.
“dataandmodelnexttoproject” (bool) Should data and model files be saved next to project.
“project” (string) Path to the Monolix project.

Associated settings for PKanalix projects are:

“directory” (string) Path to the folder where simulation results will be saved. It should be a writable directory.
“seed” (0< int <2147483647) Seed used by random generators.
“datanexttoproject” (bool) Should data and model (in case of CA) files be saved next to project.

Associated settings for Simulx projects are:

“directory” (string) Path to the folder where simulation results will be saved. It should be a writable directory.
“seed” (0< int <2147483647) Seed used by random generators.
“userfilesnexttoproject” (bool) Should user files be saved next to project.

Usage

getProjectSettings(...)

Arguments

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

Value

An array which associates each setting name to its current value.

See Also

setProjectSettings

Click here to see examples

#

## Not run: 

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 (string) 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” (bool) Use relative path for save/load operations.
“threads” (int >0) Number of threads.
“temporarydirectory” (string) Path to the directory used to save temporary files.
“timestamping” (bool) Create an archive containing result files after each run.
“delimiter” (string) Character use as delimiter in exported result files.
“exportchartsdata” (bool) Should charts data be exported.
“exportchartsdatasets” (bool) [Monolix] Should charts datasets be exported if possible.
“exportvpcsimulations” (bool) [Monoliw] Should vpc simulations be exported if possible.
“exportsimulationfiles” (bool) [Simulx] Should simulation results files be exported.
“headeraliases” (list(“header” = vector<string>)) For each header, the list of the recognized aliases.
“ncaparameters” (vector<string>) [PKanalix] Defaulty computed NCA parameters.
“units” (list(“type” = string) [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

#

## Not run: 

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” (string) Path to the folder where simulation results will be saved. It should be a writable directory.
“exportResults” (bool) Should results be exported.
“seed” (0< int <2147483647) Seed used by random generators.
“grid” (int) Number of points for the continuous simulation grid.
“nbSimulations” (int) Number of simulations.
“dataandmodelnexttoproject” (bool) Should data and model files be saved next to project.

Associated settings for PKanalix projects are:

“directory” (string) Path to the folder where simulation results will be saved. It should be a writable directory.
“dataNextToProject” (bool) Should data and model (in case of CA) files be saved next to project.
“seed” (0< int <2147483647) Seed used by random generators.

Associated settings for Simulx projects are:

“directory” (string) Path to the folder where simulation results will be saved. It should be a writable directory.
“seed” (0< int <2147483647) Seed used by random generators.
“userfilesnexttoproject” (bool) 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

#

## Not run: 

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 (int) [36]
  • color (vector<int>) Rgb color [c(255, 0, 0)]
  • layout (character)
  • semiTransparent (bool) [true]
reportFile [optional] (list) If not provided, the report will be saved next to the project file with the name <projectname>_report.docx.

  • nextToProject (bool) 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

#

## Not run: 

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 (string) Chart type whose data must be exported. Available types are: “vpc”, “indfits”.
filePath [optional](string) 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

#

## Not run: 

 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](string) 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

#

## Not run: 

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 last estimated individual parameter values

Description

Get the last estimated values for each subject of some of the individual parameters present within the current project.
WARNING: Estimated individual parameters values cannot be accessible until the individual estimation algorithm has been launched once.
NOTE: The user can choose to display only the individual parameter values estimated with a specific method.
Existing individual estimation methods :

Conditional Mean SAEM “saem”
Conditional Mean “conditionalMean”
Conditional Mode “conditionalMode”

WARNING: Only the methods which have been used during the last scenario run can provide estimation results.

Usage

getEstimatedIndividualParameters(..., method = "")

Arguments

... (string) 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](string) 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 data frame giving, for each wanted method, the last estimated values of the individual parameters of interest for each subject with the corresponding standard deviation values.

See Also

getEstimatedRandomEffects

Click here to see examples

#

## Not run:  

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)


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](string) 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

#

## Not run: 

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 cannot be accessible until the SAEM algorithm has been launched once.

Usage

getEstimatedPopulationParameters(..., coefficientsOfVariation = FALSE)

Arguments

... [optional] (array<string>) 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 field is not specified, the function will retrieve the values of all the available population parameters.
coefficientsOfVariation [optional](boolean) 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.

Value

A named vector containing the last estimated value of each one of the population parameters passed in argument.

Click here to see examples

#

## Not run: 

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]

## End(Not run)


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


[Monolix] Get estimated the random effects

Description

Get the random effects for each subject of some of the individual parameters present within the current project.
WARNING: Estimated random effects cannot be accessible until the individual estimation algorithm has been launched once.
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 :

Conditional Mean SAEM “saem”
Conditional Mean “conditionalMean”
Conditional Mode “conditionalMode”

WARNING: Only the methods which have been used during the last scenario run can provide estimation results. Please call getLaunchedTasks to get a list of the methods whose results are available.

Usage

getEstimatedRandomEffects(..., method = "")

Arguments

... (string) 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](string) 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 data frame giving, for each wanted method, the last estimated eta values of the individual parameters of interest for each subject with the corresponding standard deviation values.

See Also

getEstimatedIndividualParameters

Click here to see examples

#

## Not run:  

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 = "conditionalMode") 

# 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 = "")

Arguments

method [optional](string) 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

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

#

## Not run: 

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 tasks with results

Description

Get a list of the tasks which have results to provide. A task is the association of:

  • an algorithm (string)
  • a vector of methods (string) relative to this algorithm for the standardErrorEstimation and the loglikelihoodEstimation, TRUE or FALSE for the other one.

Usage

getLaunchedTasks()

Value

The list of tasks with results, indexed by algorithm names.

Click here to see examples

#

## Not run: 

tasks = getLaunchedTasks()

tasks

 -> $populationParameterEstimation = TRUE

    $conditionalModeEstimation = TRUE

	   $standardErrorEstimation = "linearization"

## 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] (array<string>) 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

#

## Not run:  

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 cannot be accessible until the individual estimation with conditional mean algorithm has been launched once.

Usage

getSimulatedIndividualParameters(...)

Arguments

... (string) 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 list 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

#

## Not run:  

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

      .    .    ...    ...  ...

## 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 cannot be accessible until the individual estimation algorithm with conditional mean has been launched once.

Usage

getSimulatedRandomEffects(...)

Arguments

... (string) 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 list giving the last simulated values of the individual random effects of interest for each replicate of each subject.

See Also

getIndividualParameterModel

Click here to see examples

#

## Not run:  

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

      .    .    ...    ...  ...

## 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

#

## Not run: 

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 (bool) [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

#

## Not run: 

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 boolean 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

#

## Not run: 

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 boolean.
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 boolean.
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 boolean.
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

#

## Not run: 

[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.

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

setScenario getScenario

Click here to see examples

#

## Not run: 

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 boolean.
NOTE: by default the boolean 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 boolean.
NOTE: By default the boolean 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 boolean.
NOTE: By default the boolean 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

#

## Not run: 

[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 individual parameters using conditional distribution sampling algorithm. The associated method keyword is “conditionalMean”.

Usage

runConditionalDistributionSampling()

Click here to see examples

#

## Not run: 

runConditionalDistributionSampling()

## End(Not run)


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). The associated method keyword is “conditionalMode”.

Usage

runConditionalModeEstimation()

Click here to see examples

#

## Not run: 

runConditionalModeEstimation()

## End(Not run)


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


[Monolix] Log-Likelihood estimation

Description

Run the log-Likelihood estimation algorithm. By default, this task is not processed in the background of the R session.
Existing methods:

Method Identifier
Log-Likelihood estimation by linearization linearization = T
Log-Likelihood estimation by Importance Sampling (default) linearization = F

The Log-likelihood outputs(-2LL, AIC, BIC) are available using getEstimatedLogLikelihood function

Usage

runLogLikelihoodEstimation(linearization = FALSE)

Arguments

linearization option (boolean)[optional] method to be used. When no method is given, the importance sampling is used by default.

Click here to see examples

#

## Not run: 

runLogLikelihoodEstimation(linearization = T)

## End(Not run)


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


[Monolix] Population parameter estimation

Description

Estimate the population parameters with the SAEM method. The associated method keyword is “saem”.
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()

Click here to see examples

#

## Not run: 

runPopulationParameterEstimation()

## End(Not run)


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


[Monolix] Standard error estimation

Description

Estimate the Fisher Information Matrix and the standard errors of the population parameters. By default, this task is not processed in the background of the R session.
Existing methods:

Method Identifier
Estimate the FIM by Stochastic Approximation linearization = F (default)
Estimate the FIM by Linearization linearization = T

The Fisher Information Matrix is available using getCorrelationOfEstimates function, while the standard errors are avalaible using getEstimatedStandardErrors function.

Usage

runStandardErrorEstimation(linearization = FALSE)

Arguments

linearization option (boolean)[optional] method to be used. When no method is given, the stochastic approximation is used by default.

Click here to see examples

#

## Not run: 

runStandardErrorEstimation(linearization = T)

## End(Not run)


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