Covariate search
The automatic covariate search procedures can be launched using the lixoftConnectors. Note that when reloading the project (in the GUI or via the lixoftConnectors) with the 2020R1, the covariate search results are displayed but the settings are lost. From the 2021R1 version on, the settings will be saved and reloaded.
In the example below, we do the following steps:
load a base monolix project,
add covariate transformations,
get the default settings of the covariate search and modify them,
specify which covariates and parameters to test along with relationships which are lock-in or out,
run the covariate search,
get the results.
As an example, we are using the demo 5.2 warfarin_covariate1_project.mlxtran as base project.
library(lixoftConnectors)
initializeLixoftConnectors(software="monolix") # makes the link to the MonolixSuite installation
# load base project (from the demos)
loadProject("warfarin_covariate1_project.mlxtran")
# wt and sex are defined as covariates. Add logtWT=log(wt/70)
addContinuousTransformedCovariate(logtWt = "log(wt/70)" )
# save the project with the additional covariate under a new name
saveProject("warfarin_covariate1_project_covsearch.mlxtran")
# get the default covariate search settings
set <- getModelBuildingSettings()
# modify the settings
set$strategy <- 'cossac' # "cossac" or "scm"
set$useSambaBeforeCossac <- FALSE # if true, corresponds to "covSAMBA-COSSAC" in the GUI
set$criterion <- "LRT" # "BIC" or "LRT"
set$threshold$lrt[1] <- 0.01 # forward p-value threshold for LRT
set$threshold$lrt[2] <- 0.001 # backward p-value threshold for LRT
# set logtWt and sex as covariates to test on all parameters except Tlag
set$covariates <- c("sex","logtWt")
set$parameters <- c("ka","V","Cl")
# in addition lock-out (never test it) "sex on ka" and lock-in (have it in all tested models) "logtWt on Cl"
set$relationships[1,] <- c("ka", "sex", FALSE) # sex never included on ka
set$relationships[2,] <- c("Cl", "logtWt", TRUE) # logtWt always included on Cl
# all other relationships corresponding to set$covariates and set$parameters will be tested
# run the covariate search
runModelBuilding(settings=set)
# get the results. The best model is indicated with $bestModel = T
getModelBuildingResults()