plotRandomEffectsCorrelation
[Monolix] Correlations between random effect.
Plot correlations between random effects.
Usage
plotRandomEffectsCorrelation(
parametersRows = NULL,
parametersColumns = NULL,
settings = list(),
preferences = list(),
stratify = list()
)
Arguments
- parametersRows
vector with the name of parameters to display on rows (by default the first 4 computed parameters are displayed).
- parametersColumns
vector with the name of parameters to display on columns (by default parametersColumns = parametersRows).
- settings
List with the following settings
indivEstimate
Calculation of individual estimates: conditional mean ("mean"), conditional mode with EBE's ("mode"), conditional distribution ("simulated") (default "simulated").variabilityLevel
(character) In case of IOV and if the conditional distribution is computed plot is displayed for one given level of variability (default NULL) If NULL, the variability level is ID + Occasions Run getVariabilityLevels() to see the available levels of variabilitydecorrelated
(logical) If TRUE, plot the decorrelated random effects instead of the random effects (default FALSE). Decorrelated random effects are available only if the model contains correlations terms between the random effects.regressionLine
(logical) If TRUE, Add regression line in scatterplots (default TRUE).spline
(logical) If TRUE, Add xpline in scatterplots (default FALSE).legend
(logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).grid
(logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).ncol
(integer) number of columns when facet = TRUE (default 4).fontsize
(integer) Plot text font size.
- preferences
(optional) preferences for plot display, run getPlotPreferences("plotRandomEffectsCorrelation") to check available displays.
- stratify
List with the stratification arguments:
groups
- Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:name character covariate name (e.g "AGE"
)definition (vector(continuous) || list>(categorical)) For continuous covariates, vector of break values (e.g c(35, 65)
). For categorical covariates, groups of categories as a list of vectors(e.glist(c("study101"), c("study201","study202"))
)split
(vector) - Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instancec("FORM","AGE")
.filter
(list< list> >) - List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance,list("AGE",c(1,3))
to keep the individuals belonging to the first and third age group, according to the definition ingroups
. For instance,list("FORM","ref")
using the category name for categorical covariates.color
(vector) - Vector of covariates used for coloring (by default no coloring is applied). For instancec("FORM","AGE")
.colors
- Vector of colors to use whencolor
argument is used. Takes precedence over colors defined inpreferences
. For instancec("#ebecf0","#cdced1","#97989c")
.
Value
A ggplot object if one element in parametersRows and parametersColumns,
A TableGrob object if multiple plots (output of grid.arrange)
See also
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()

#> TableGrob (1 x 1) "arrange": 1 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",
settings = list(indivEstimate = "simulated"))

plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",
settings = list(spline = TRUE))

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

#> TableGrob (1 x 1) "arrange": 1 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
plotRandomEffectsCorrelation(parametersRows = c("ka", "V"))

#> TableGrob (1 x 1) "arrange": 1 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
# stratification
plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",
stratify = list(filter = list("SEX", "M")))

plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",
stratify = list(color = "WEIGHT",
groups = list(name = "WEIGHT", definition = 75),
colors = c("#46B4AF", "#B4468A")))

plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",
stratify = list(split = "SEX"))

plotRandomEffectsCorrelation(parametersRows = "ka", parametersColumns = "V",
stratify = list(split = c("SEX", "WEIGHT"),
groups = list(name = "WEIGHT", definition = 70)))

$body