Overview

Description

Perform several statistical tests using the results of a Monolix run to assess the statistical components of the model in use.

The tests used are:
1) F-tests (or, equivalently, correlation tests) to evaluate the effect of each covariate on each parameter (“covariate”), 2) Shapiro-Wilk and Miao-Gel-Gastwirth tests to assess, respectively the normality and the symmetry of the distribution of the random effects ("“randomEffect”), 3) correlation tests to assess the correlation structure of the random effects (“correlation”), 4) Shapiro-Wilk aand Miao-Gel-Gastwirth tests to assess, respectively the normality and the symmetry of the distribution of residual errors (“residual”).

By default, the four tests are performed.

When several samples of the conditional distributions are used, two methods are proposed in order to take into the dependance of the samples for the Shapiro-Wilk and Miao-Gel-Gastwirth tests:

Usage

r <- testmlx(project, tests=c("covariate","randomEffect","correlation","residual"), plot=FALSE) 

Arguments

project
a Monolix project.
tests
a vector of strings: the list of tests to perform among c(“covariate”,“randomEffect”,“correlation”,“residual”), (default=all)
adjust
method to take into account the dependency of MCMC sample c({“edf”},“BH”)
n.sample
number of samples from the conditional distribution to be used (default = number of available samples in the project)
plot
{FALSE}/TRUE display some diagnostic plots associated to the tests (default=FALSE)


Example

library(Rsmlx)

project <- "projects/warfarinPK1.mlxtran"
r <- testmlx(project)
print(r)
## $covariate
## $covariate$p.value.parameters
##    parameter covariate   p.value in.model
## 6      log.V      lw70 1.173e-10     TRUE
## 3     log.ka        wt 2.179e-01    FALSE
## 2     log.ka      lw70 3.468e-01    FALSE
## 4     log.ka       sex 5.143e-01    FALSE
## 1     log.ka       age 5.321e-01    FALSE
## 7      log.V        wt 3.235e-10    FALSE
## 8      log.V       sex 7.321e-06    FALSE
## 5      log.V       age 6.438e-01    FALSE
## 10    log.Cl      lw70 2.815e-02    FALSE
## 11    log.Cl        wt 3.472e-02    FALSE
## 9     log.Cl       age 9.683e-02    FALSE
## 12    log.Cl       sex 5.278e-01    FALSE
## 
## $covariate$p.value.randomEffects
##    random.effect covariate p.value in.model
## 6          eta_V      lw70 0.82220     TRUE
## 1         eta_ka       age 0.53210    FALSE
## 2         eta_ka      lw70 0.34680    FALSE
## 3         eta_ka        wt 0.21790    FALSE
## 4         eta_ka       sex 0.51430    FALSE
## 5          eta_V       age 0.88430    FALSE
## 7          eta_V        wt 0.81140    FALSE
## 8          eta_V       sex 0.35240    FALSE
## 9         eta_Cl       age 0.09683    FALSE
## 10        eta_Cl      lw70 0.02815    FALSE
## 11        eta_Cl        wt 0.03472    FALSE
## 12        eta_Cl       sex 0.52780    FALSE
## 
## 
## $residual
## $residual$p.value
##       normality  symmetry
## y1 2.496235e-10 0.3264386
## 
## 
## $randomEffect
## $randomEffect$p.value
##        normality  symmetry
## eta_ka 0.8585802 0.8062688
## eta_V  0.9094974 0.3072749
## eta_Cl 0.3235660 0.1731036
## 
## 
## $correlation
## $correlation$p.value
##   randomEffect.1 randomEffect.2 correlation p.value
## 1         eta_ka          eta_V -0.03069282  0.8065
## 2         eta_ka         eta_Cl -0.09494253  0.5387
## 3          eta_V         eta_Cl -0.01957748  0.8608

Performs the statistical tests for the random effects and the residuals only:

r <- testmlx(project, tests=c("randomEffect", "residual"))
print(r)
## $residual
## $residual$p.value
##       normality  symmetry
## y1 2.496235e-10 0.3264386
## 
## 
## $randomEffect
## $randomEffect$p.value
##        normality  symmetry
## eta_ka 0.8585802 0.8062688
## eta_V  0.9094974 0.3072749
## eta_Cl 0.3235660 0.1731036

Instead of estimating an effective degrees of freedom, use the Benjamini-Hochberg method for taking into account the dependance of the samples for the Shapiro-Wilk and Miao-Gel-Gastwirth tests:

r <- testmlx(project, tests=c("randomEffect", "residual"), adjust="BH")
print(r)
## $residual
## $residual$p.value
##       normality  symmetry
## y1 3.031851e-08 0.2888159
## 
## 
## $randomEffect
## $randomEffect$p.value
##        normality  symmetry
## eta_ka 0.9323607 0.6808700
## eta_V  0.2888200 0.5193830
## eta_Cl 0.3409445 0.2097142

Create some graphs:

r <- testmlx(project, plot=TRUE)

names(r)
## [1] "covariate"    "residual"     "randomEffect" "correlation"
names(r$covariate)
## [1] "p.value.parameters"    "p.value.randomEffects" "plot"