Overview

Description

Fit several structural PK models and select the best one based on a corrected Bayesian Information Criterion for mixed effects models.

Models to compare can be defined by rate constants and/or clearances and can include or not nonlinear elimination models.

Usage

pkbuild <- function(data=NULL, project=NULL, stat=FALSE, param="clearance", new.dir=".", 
                    MM=FALSE, linearization=T, criterion="BICc", level=NULL, settings.stat=NULL) 

Arguments

data

a list with fields

  • dataFile: path of a formatted data file

  • headerTypes: a vector of strings

  • administration ("iv", "bolus", "infusion", "oral", "ev"): route of administration

project

a Monolix project

stat

(FALSE, TRUE): the statistical model is also built (using buildmlx) (default=FALSE)

param

("clearance", "rate", "both): parametrization (default="clearance")

new.dir

name of the directory where the created files are stored (default is the current working directory) )

MM

(FALSE, TRUE): tested models include or not Michaelis Menten elimination models (default=FALSE)

linearization

TRUE/FALSE whether the computation of the likelihood is based on a linearization of the model (default=FALSE)

criterion

penalization criterion to optimize c("AIC", "BIC", "BICc", gamma) (default="BICc")

level

an integer between 1 and 9 (used by setSettings)

settings.stat

list of settings used by buildmlx (only if stat=TRUE)


Examples

Reading a data file

Let us use the warfarin PK data in this example:

head(read.csv('data/warfarinPK.csv'))
##   id time   y amount   wt age sex
## 1  1    0   .    100 66.7  50   1
## 2  1   24 9.2      . 66.7  50   1
## 3  1   36 8.5      . 66.7  50   1
## 4  1   48 6.4      . 66.7  50   1
## 5  1   72 4.8      . 66.7  50   1
## 6  1   96 3.1      . 66.7  50   1

warfarin is administrated orally:

library(Rsmlx)
warfarinPK <- list(
  dataFile = "data/warfarinPK.csv",
  headerTypes = c("id", "time", "observation", "amount", "contcov", "contcov", "catcov"),
  administration = "oral")

By default, PK models parameterized with clearance(s) are fitted.

warf.pk1a <- pkbuild(data=warfarinPK,  new.dir="warfarinPK")
## 
## [1] "warfarinPK/pk_kaVCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   875.0286541   891.0286541   902.7545413   912.9728035     0.0467466 
## 
## [1] "warfarinPK/pk_Tk0VCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  796.97249564  812.97249564  824.69838286  834.91664503    0.04163542 
## 
## [1] "warfarinPK/pk_TlagkaVCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  661.92854178  681.92854178  696.58590081  708.84781541    0.09644021 
## 
## [1] "warfarinPK/pk_TlagTk0VCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   657.4535554   677.4535554   692.1109144   704.3728291     0.1275872 
## 
## [1] "warfarinPK/pk_TlagTk0V1V2QCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   641.5775866   669.5775866   690.0978893   706.4471087     0.2516801 
## 
## [1] "warfarinPK/pk_TlagkaV1V2QCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   640.9399316   668.9399316   689.4602342   705.8094537     0.2841378

By default, comparison of these models is based on a corrected Bayesian Information Criterion (BICc) for mixed effects models:

\[{\rm BIC}_{\rm cor} = -2 LL + \log(N)\times d_N + \log(n) \times d_n\] where \(N\) is the number of individuals and \(n\) the total number of observations. Then, \(d_N\) is the number of parameters associated to the variability of the individual parameters and \(d_n\) the number of parameters associated to the variability of the observations.

According to this criterion, the best PK model for this data is oral0_1cpt_TlagTk0VCl.txt.

print(warf.pk1a)
## $pop.ini
##      Tlag       Tk0         V        Cl 
## 0.9094114 2.9142311 7.9241581 0.1320154 
## 
## $project
## [1] "warfarinPK/pk_TlagTk0VCl.mlxtran"
## 
## $model
## [1] "lib:oral0_1cpt_TlagTk0VCl.txt"
## 
## $data
## $data$dataFile
## [1] "data/warfarinPK.csv"
## 
## $data$headerTypes
## [1] "id"          "time"        "observation" "amount"      "contcov"    
## [6] "contcov"     "catcov"     
## 
## $data$administration
## [1] "oral"
## 
## 
## $ofv
## [1] 657.4536
## 
## $bicc
## [1] 704.3728
## 
## $bic
## [1] 692.1109
## 
## $aic
## [1] 677.4536
## 
## $pop.est
##   Tlag_pop    Tk0_pop      V_pop     Cl_pop omega_Tlag  omega_Tk0    omega_V 
## 0.78774241 1.47936633 7.99749648 0.13202040 0.61408374 0.56316740 0.22380612 
##   omega_Cl          a          b 
## 0.29199097 0.33300067 0.07104876 
## 
## $res
##                               model      OFV      AIC      BIC     BICc
## 1     lib:oral0_1cpt_TlagTk0VCl.txt 657.4536 677.4536 692.1109 704.3728
## 2  lib:oral1_2cpt_TlagkaClV1QV2.txt 640.9399 668.9399 689.4602 705.8095
## 3 lib:oral0_2cpt_TlagTk0ClV1QV2.txt 641.5776 669.5776 690.0979 706.4471
## 4      lib:oral1_1cpt_TlagkaVCl.txt 661.9285 681.9285 696.5859 708.8478
## 5         lib:oral0_1cpt_Tk0VCl.txt 796.9725 812.9725 824.6984 834.9166
## 6          lib:oral1_1cpt_kaVCl.txt 875.0287 891.0287 902.7545 912.9728

Another critrion, such as AIC or BIC can be used instead of BICc. Computation of the likelihood can also be based on a linearization of the model (much faster than Importance Sampling):

warf.pk1b <- pkbuild(data=warfarinPK,  new.dir="warfarinPK", linearization=T, criterion="AIC")
## 
## [1] "warfarinPK/pk_kaVCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 866.8906 882.8906 894.6165 904.8348 
## 
## [1] "warfarinPK/pk_Tk0VCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 796.7175 812.7175 824.4434 834.6617 
## 
## [1] "warfarinPK/pk_TlagkaVCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 658.7242 678.7242 693.3816 705.6435 
## 
## [1] "warfarinPK/pk_TlagTk0VCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 656.8035 676.8035 691.4609 703.7228 
## 
## [1] "warfarinPK/pk_TlagTk0V1V2QCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 647.8176 675.8176 696.3379 712.6871 
## 
## [1] "warfarinPK/pk_TlagkaV1V2QCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 638.7796 666.7796 687.2999 703.6491 
## 
## [1] "warfarinPK/pk_TlagkaV1V2V3Q2Q3Cl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 639.3326 675.3326 701.7159 722.1524
print(warf.pk1b)
## $pop.ini
##        Tlag          ka          V1          V2           Q          Cl 
##  0.80651432  1.68633271  7.80325033 41.24319306  0.02736140  0.09860742 
## 
## $project
## [1] "warfarinPK/pk_TlagkaV1V2QCl.mlxtran"
## 
## $model
## [1] "lib:oral1_2cpt_TlagkaClV1QV2.txt"
## 
## $data
## $data$dataFile
## [1] "data/warfarinPK.csv"
## 
## $data$headerTypes
## [1] "id"          "time"        "observation" "amount"      "contcov"    
## [6] "contcov"     "catcov"     
## 
## $data$administration
## [1] "oral"
## 
## 
## $ofv
## [1] 638.7796
## 
## $bicc
## [1] 703.6491
## 
## $bic
## [1] 687.2999
## 
## $aic
## [1] 666.7796
## 
## $pop.est
##    Tlag_pop      ka_pop      Cl_pop      V1_pop       Q_pop      V2_pop 
##  0.86822311  1.23542836  0.06098586  7.63926798  0.07441126 69.16438571 
##  omega_Tlag    omega_ka    omega_Cl    omega_V1     omega_Q    omega_V2 
##  0.53251214  0.64444931  0.17806529  0.22095336  0.56811834  0.85552363 
##           a           b 
##  0.30210520  0.06647686 
## 
## $res
##                                   model      OFV      AIC      BIC     BICc
## 1      lib:oral1_2cpt_TlagkaClV1QV2.txt 638.7796 666.7796 687.2999 703.6491
## 2 lib:oral1_3cpt_TlagkaClV1Q2V2Q3V3.txt 639.3326 675.3326 701.7159 722.1524
## 3     lib:oral0_2cpt_TlagTk0ClV1QV2.txt 647.8176 675.8176 696.3379 712.6871
## 4         lib:oral0_1cpt_TlagTk0VCl.txt 656.8035 676.8035 691.4609 703.7228
## 5          lib:oral1_1cpt_TlagkaVCl.txt 658.7242 678.7242 693.3816 705.6435
## 6             lib:oral0_1cpt_Tk0VCl.txt 796.7175 812.7175 824.4434 834.6617
## 7              lib:oral1_1cpt_kaVCl.txt 866.8906 882.8906 894.6165 904.8348

Models parameterized with rate constants can be used instead of clearances:

warf.pk2 <- pkbuild(data=warfarinPK,  new.dir="warfarinPK", param="rate")
## 
## [1] "warfarinPK/pk_kaVk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  874.42902727  890.42902727  902.15491449  912.37317666    0.07974211 
## 
## [1] "warfarinPK/pk_Tk0Vk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  792.68073394  808.68073394  820.40662116  830.62488333    0.08323628 
## 
## [1] "warfarinPK/pk_TlagkaVk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   660.7850613   680.7850613   695.4424203   707.7043349     0.1203258 
## 
## [1] "warfarinPK/pk_TlagTk0Vk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   654.3904192   674.3904192   689.0477782   701.3096928     0.1886907 
## 
## [1] "warfarinPK/pk_TlagTk0Vk12k21k.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   626.3613590   654.3613590   674.8816616   691.2308811     0.2238111 
## 
## [1] "warfarinPK/pk_TlagkaVk12k21k.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##     628.55224     656.55224     677.07254     693.42176       0.26789 
## 
## [1] "warfarinPK/pk_TlagTk0Vk12k21k13k31k.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   632.3695506   668.3695506   694.7527969   715.1893212     0.5020241
print(warf.pk2$res)
##                                      model      OFV      AIC      BIC     BICc
## 1       lib:oral0_2cpt_TlagTk0Vkk12k21.txt 626.3614 654.3614 674.8817 691.2309
## 2        lib:oral1_2cpt_TlagkaVkk12k21.txt 628.5522 656.5522 677.0725 693.4218
## 3             lib:oral0_1cpt_TlagTk0Vk.txt 654.3904 674.3904 689.0478 701.3097
## 4              lib:oral1_1cpt_TlagkaVk.txt 660.7851 680.7851 695.4424 707.7043
## 5 lib:oral0_3cpt_TlagTk0Vkk12k21k13k31.txt 632.3696 668.3696 694.7528 715.1893
## 6                 lib:oral0_1cpt_Tk0Vk.txt 792.6807 808.6807 820.4066 830.6249
## 7                  lib:oral1_1cpt_kaVk.txt 874.4290 890.4290 902.1549 912.3732
print(warf.pk2$pop.est)
##    Tlag_pop     Tk0_pop       V_pop       k_pop     k12_pop     k21_pop 
## 0.787927547 1.684833934 7.412555798 0.015276566 0.007026264 0.035824779 
##  omega_Tlag   omega_Tk0     omega_V     omega_k   omega_k12   omega_k21 
## 0.503209926 0.519285248 0.193032922 0.083388055 0.809503136 2.526785135 
##           a           b 
## 0.283076376 0.071405473

or both:

warf.pk3 <- pkbuild(data=warfarinPK,  new.dir="warfarinPK", param="both")
## 
## [1] "warfarinPK/pk_kaVCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   875.0286541   891.0286541   902.7545413   912.9728035     0.0467466 
## 
## [1] "warfarinPK/pk_Tk0VCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  796.97249564  812.97249564  824.69838286  834.91664503    0.04163542 
## 
## [1] "warfarinPK/pk_TlagkaVCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  661.92854178  681.92854178  696.58590081  708.84781541    0.09644021 
## 
## [1] "warfarinPK/pk_TlagTk0VCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   657.4535554   677.4535554   692.1109144   704.3728291     0.1275872 
## 
## [1] "warfarinPK/pk_TlagTk0V1V2QCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   641.5775866   669.5775866   690.0978893   706.4471087     0.2516801 
## 
## [1] "warfarinPK/pk_TlagkaV1V2QCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   640.9399316   668.9399316   689.4602342   705.8094537     0.2841378 
## 
## [1] "warfarinPK/pk_kaVk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  874.42902727  890.42902727  902.15491449  912.37317666    0.07974211 
## 
## [1] "warfarinPK/pk_Tk0Vk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  792.68073394  808.68073394  820.40662116  830.62488333    0.08323628 
## 
## [1] "warfarinPK/pk_TlagkaVk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   660.7850613   680.7850613   695.4424203   707.7043349     0.1203258 
## 
## [1] "warfarinPK/pk_TlagTk0Vk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   654.3904192   674.3904192   689.0477782   701.3096928     0.1886907 
## 
## [1] "warfarinPK/pk_TlagTk0Vk12k21k.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   626.3613590   654.3613590   674.8816616   691.2308811     0.2238111 
## 
## [1] "warfarinPK/pk_TlagkaVk12k21k.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##     628.55224     656.55224     677.07254     693.42176       0.26789 
## 
## [1] "warfarinPK/pk_TlagTk0Vk12k21k13k31k.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   632.3695506   668.3695506   694.7527969   715.1893212     0.5020241
print(warf.pk3$res)
##                                       model      OFV      AIC      BIC     BICc
## 1        lib:oral0_2cpt_TlagTk0Vkk12k21.txt 626.3614 654.3614 674.8817 691.2309
## 2         lib:oral1_2cpt_TlagkaVkk12k21.txt 628.5522 656.5522 677.0725 693.4218
## 3              lib:oral0_1cpt_TlagTk0Vk.txt 654.3904 674.3904 689.0478 701.3097
## 4             lib:oral0_1cpt_TlagTk0VCl.txt 657.4536 677.4536 692.1109 704.3728
## 5          lib:oral1_2cpt_TlagkaClV1QV2.txt 640.9399 668.9399 689.4602 705.8095
## 6         lib:oral0_2cpt_TlagTk0ClV1QV2.txt 641.5776 669.5776 690.0979 706.4471
## 7               lib:oral1_1cpt_TlagkaVk.txt 660.7851 680.7851 695.4424 707.7043
## 8              lib:oral1_1cpt_TlagkaVCl.txt 661.9285 681.9285 696.5859 708.8478
## 9  lib:oral0_3cpt_TlagTk0Vkk12k21k13k31.txt 632.3696 668.3696 694.7528 715.1893
## 10                 lib:oral0_1cpt_Tk0Vk.txt 792.6807 808.6807 820.4066 830.6249
## 11                lib:oral0_1cpt_Tk0VCl.txt 796.9725 812.9725 824.6984 834.9166
## 12                  lib:oral1_1cpt_kaVk.txt 874.4290 890.4290 902.1549 912.3732
## 13                 lib:oral1_1cpt_kaVCl.txt 875.0287 891.0287 902.7545 912.9728


Using a Monolix project

If a Monolix project has been already created using the data file, it can be used for providing data information

warf.pk4  <- pkbuild(project="projects/warfarinPK.mlxtran", new.dir="warfarinPK")
## 
## [1] "warfarinPK/pk_kaVCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  850.88080099  866.88080099  878.60668821  888.82495038    0.05221115 
## 
## [1] "warfarinPK/pk_Tk0VCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  772.83071891  788.83071891  800.55660613  810.77486830    0.04437503 
## 
## [1] "warfarinPK/pk_TlagkaVCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   650.9798730   670.9798730   685.6372320   697.8991466     0.1419425 
## 
## [1] "warfarinPK/pk_TlagTk0VCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##    648.838170    668.838170    683.495529    695.757444      0.126884 
## 
## [1] "warfarinPK/pk_TlagTk0V1V2QCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   630.7504153   658.7504153   679.2707179   695.6199374     0.4185244 
## 
## [1] "warfarinPK/pk_TlagkaV1V2QCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   626.3730062   654.3730062   674.8933088   691.2425283     0.3712965 
## 
## [1] "warfarinPK/pk_TlagkaV1V2V3Q2Q3Cl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   625.4464458   661.4464458   687.8296920   708.2662164     0.4318463

Of course, the results are the same as those obtained using the data file

print(warf.pk4$res)
##                                   model      OFV      AIC      BIC     BICc
## 1      lib:oral1_2cpt_TlagkaClV1QV2.txt 626.3730 654.3730 674.8933 691.2425
## 2     lib:oral0_2cpt_TlagTk0ClV1QV2.txt 630.7504 658.7504 679.2707 695.6199
## 3         lib:oral0_1cpt_TlagTk0VCl.txt 648.8382 668.8382 683.4955 695.7574
## 4          lib:oral1_1cpt_TlagkaVCl.txt 650.9799 670.9799 685.6372 697.8991
## 5 lib:oral1_3cpt_TlagkaClV1Q2V2Q3V3.txt 625.4464 661.4464 687.8297 708.2662
## 6             lib:oral0_1cpt_Tk0VCl.txt 772.8307 788.8307 800.5566 810.7749
## 7              lib:oral1_1cpt_kaVCl.txt 850.8808 866.8808 878.6067 888.8250


Building the statistical model also

The “best” PK model is selected first. Then, the “best” statistical model is built using buildAll:

warf.pk5  <- pkbuild(data=warfarinPK, stat=TRUE, new.dir="warfarinPK", param="rate")
## 
## [1] "warfarinPK/pk_kaVk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  874.42902727  890.42902727  902.15491449  912.37317666    0.07974211 
## 
## [1] "warfarinPK/pk_Tk0Vk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##  792.68073394  808.68073394  820.40662116  830.62488333    0.08323628 
## 
## [1] "warfarinPK/pk_TlagkaVk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   660.7850613   680.7850613   695.4424203   707.7043349     0.1203258 
## 
## [1] "warfarinPK/pk_TlagTk0Vk.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   654.3904192   674.3904192   689.0477782   701.3096928     0.1886907 
## 
## [1] "warfarinPK/pk_TlagTk0Vk12k21k.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   626.3613590   654.3613590   674.8816616   691.2308811     0.2238111 
## 
## [1] "warfarinPK/pk_TlagkaVk12k21k.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##     628.55224     656.55224     677.07254     693.42176       0.26789 
## 
## [1] "warfarinPK/pk_TlagTk0Vk12k21k13k31k.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##           OFV           AIC           BIC          BICc standardError 
##   632.3695506   668.3695506   694.7527969   715.1893212     0.5020241 
## 
## --------------------------------------------------
## 
## Building:
##    -  The covariate model
##    -  The correlation model
##    -  The residual error model
##  
## __________________________________________________
## - - - Initialization - - -
## 
## Covariate model:
##      sex age wt
## Tlag   0   0  0
## Tk0    0   0  0
## V      0   0  0
## k      0   0  0
## k12    0   0  0
## k21    0   0  0
## 
## Correlation model:
## [1] "NULL"
## 
## Residual error model:
##           y 
## "combined2" 
## Sampling of the conditional distribution using the initial model ... 
## 
## Estimated criteria (importanceSampling):
##    AIC    BIC   BICc   s.e. 
## 654.36 674.88 691.23   0.22 
## __________________________________________________
## - - - Iteration 1 - - -
## 
## Covariate model:
##      sex age wt
## Tlag   0   0  0
## Tk0    0   0  0
## V      1   0  1
## k      0   0  0
## k12    0   0  0
## k21    0   1  0
## 
## Correlation model:
## [1] "NULL"
## 
## Residual error model:
##           y 
## "combined2" 
## 
## Run scenario for model 1 ... 
## Estimation of the population parameters... 
## Sampling from the conditional distribution... 
## Estimation of the log-likelihood... 
## 
## Estimated criteria (importanceSampling):
##    AIC    BIC   BICc   s.e. 
## 634.70 659.62 675.97   0.25 
## __________________________________________________
## - - - Iteration 2 - - -
## 
## Covariate model:
##      sex age wt
## Tlag   0   0  0
## Tk0    0   0  0
## V      0   0  1
## k      0   0  0
## k12    0   0  0
## k21    0   1  0
## 
## Correlation model:
## [1] "NULL"
## 
## Residual error model:
##           y 
## "combined2" 
## 
## Run scenario for model 2 ... 
## Estimation of the population parameters... 
## Sampling from the conditional distribution... 
## Estimation of the log-likelihood... 
## 
## Estimated criteria (importanceSampling):
##    AIC    BIC   BICc   s.e. 
## 637.55 661.01 677.36   0.31 
## __________________________________________________
## - - - Iteration 3 - - -
## 
## No difference between two successive iterations
## __________________________________________________
## - - - Further tests - - -
## _______________________
## Add parameters/covariates relationships:
##    parameter covariate  p.value
## 4        Tk0       sex 0.000203
## 14       k21       sex 0.021590
## 
## Run scenario for model 4 ... 
## Estimation of the population parameters... 
## _______________________
## Remove parameters/covariates relationships:
##      coefficient  p.value
## 1 beta_Tk0_sex_1 0.160988
## 3   beta_V_sex_1 0.104232
## 5 beta_k21_sex_1 0.484202
## 4   beta_k21_age 0.109704
## 
## Run scenario for model 5 ... 
## Estimation of the population parameters... 
## Sampling from the conditional distribution... 
## Estimation of the log-likelihood... 
## 
## Estimated criteria (importanceSampling):
##    AIC    BIC   BICc   s.e. 
## 633.52 655.51 671.86   0.26 
## _______________________
## Add correlation:
##   randomEffect.1 randomEffect.2 correlation p.value p.wald_lin p.wald_SA
## 3       eta_Tlag          eta_k    0.144046 0.05364        NaN       NaN
##   in.model
## 3    FALSE
## [[1]]
## [1] "Tlag" "k"   
## 
## 
## Run scenario for model 6  ... 
## Estimation of the population parameters... 
## Sampling from the conditional distribution... 
## Estimation of the log-likelihood... 
## 
## Estimated criteria (importanceSampling):
##    AIC    BIC   BICc   s.e. 
## 633.67 657.12 673.47   0.31 
## __________________________________________________
## 
## Final statistical model:
## 
## Covariate model:
##      age sex wt
## Tlag   0   0  0
## Tk0    0   0  0
## V      0   0  1
## k      0   0  0
## k12    0   0  0
## k21    0   0  0
## 
## Correlation model:
## [1] "NULL"
## 
## Residual error model:
##           y 
## "combined2" 
## 
## Estimated criteria (importanceSampling):
##    AIC    BIC   BICc   s.e. 
## 633.52 655.51 671.86   0.26 
## 
## total time: 110.9s
## __________________________________________________
## 
## --------------------------------------------------
## 
## Building the variance model
## 
## __________________________________________________
## Iteration  1 
## 
## removing variability...
## 
## -----------------------
## Step  1 
## Parameters without variability:  
## Parameters with variability   : Tlag Tk0 V k k12 k21 
## 
## Criterion (linearization):  678.2 
## trying to remove omega_k    : 672.8 
## trying to remove omega_V    : 717.6 
## trying to remove omega_Tk0  : 710.9 
## trying to remove omega_Tlag : 709.0 
## trying to remove omega_k12  : 686.3 
## trying to remove omega_k21  : 681.3 
## 
## Criterion:  671.9
## fitting the model with no variability on  k : 665
## variability on k removed
## 
## -----------------------
## Step  2 
## Parameters without variability: k 
## Parameters with variability   : Tlag Tk0 V k12 k21 
## 
## Criterion (linearization):  671.2 
## trying to remove omega_k12  : 722.9 
## trying to remove omega_k21  : 728.4 
## 
## no more variability can be removed
## _______________________
## 
## adding variability...
## 
## -----------------------
## Step  1 
## Parameters without variability: k 
## Parameters with variability   : Tlag Tk0 V k12 k21 
## 
## Criterion (linearization):  671.2 
## 
## no more variability can be added
## 
## __________________________________________________
## 
## Final variance model: 
## 
## Parameters without variability: k 
## Parameters with variability   : Tlag Tk0 V k12 k21 
## 
## Fitting the final model using the original settings... 
## 
## Estimated criteria (importanceSampling):
##    AIC    BIC   BICc   s.e. 
## 628.00 648.52 664.87   0.18 
## 
## total time: 62.9s
## 
## 
## --------------------------------------------------
## 
## Building:
##    -  The covariate model
##    -  The correlation model
##    -  The residual error model
##  
## __________________________________________________
## - - - Initialization - - -
## 
## Covariate model:
##      sex age wt
## Tlag   0   0  0
## Tk0    0   0  0
## V      0   0  1
## k      0   0  0
## k12    0   0  0
## k21    0   0  0
## 
## Correlation model:
## [1] "NULL"
## 
## Residual error model:
##           y 
## "combined2" 
## 
## Estimated criteria (importanceSampling):
##    AIC    BIC   BICc   s.e. 
## 628.00 648.52 664.87   0.18 
## __________________________________________________
## - - - Iteration 1 - - -
## 
## No difference between two successive iterations
## __________________________________________________
## - - - Further tests - - -
## __________________________________________________
## 
## Final statistical model:
## 
## Covariate model:
##      age sex wt
## Tlag   0   0  0
## Tk0    0   0  0
## V      0   0  1
## k      0   0  0
## k12    0   0  0
## k21    0   0  0
## 
## Correlation model:
## [1] "NULL"
## 
## Residual error model:
##           y 
## "combined2" 
## 
## Estimated criteria (importanceSampling):
##    AIC    BIC   BICc   s.e. 
## 628.00 648.52 664.87   0.18 
## 
## total time: 4.2s
## __________________________________________________
## 
## --------------------------------------------------
## 
## Final complete model:
## 
## Variance model: 
## Parameters without variability: k 
## Parameters with variability   : Tlag Tk0 V k12 k21 
## 
## Covariate model:
##      age sex wt
## Tlag   0   0  0
## Tk0    0   0  0
## V      0   0  1
## k      0   0  0
## k12    0   0  0
## k21    0   0  0
## 
## Correlation model:
## [1] "NULL"
## 
## Residual error model:
##           y 
## "combined2" 
## 
## Estimated criteria (importanceSampling):
##    AIC    BIC   BICc   s.e. 
## 628.00 648.52 664.87   0.18 
## 
## total time: 179.7s
## --------------------------------------------------

It is possible to define the settings used by buildAll in a list:

warf.pk6  <- pkbuild(data=warfarinPK, stat=TRUE, new.dir="warfarinPK", linearization=T, 
                     settings.stat =list(covToTransform = c("wt"), 
                                         criterion ="AIC",
                                         model=c("covariate", "residualError"),
                                         linearization=T))
## 
## [1] "warfarinPK/pk_kaVCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 866.8906 882.8906 894.6165 904.8348 
## 
## [1] "warfarinPK/pk_Tk0VCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 796.7175 812.7175 824.4434 834.6617 
## 
## [1] "warfarinPK/pk_TlagkaVCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 658.7242 678.7242 693.3816 705.6435 
## 
## [1] "warfarinPK/pk_TlagTk0VCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 656.8035 676.8035 691.4609 703.7228 
## 
## [1] "warfarinPK/pk_TlagTk0V1V2QCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 647.8176 675.8176 696.3379 712.6871 
## 
## [1] "warfarinPK/pk_TlagkaV1V2QCl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 638.7796 666.7796 687.2999 703.6491 
## 
## [1] "warfarinPK/pk_TlagkaV1V2V3Q2Q3Cl.mlxtran"
## Estimation of the population parameters...
## Estimation of the log-likelihood... 
##      OFV      AIC      BIC     BICc 
## 639.3326 675.3326 701.7159 722.1524 
## 
## --------------------------------------------------
## 
## Building:
##    -  The covariate model
##    -  The residual error model
##  
## __________________________________________________
## - - - Initialization - - -
## 
## Covariate model:
##      sex age wt
## Tlag   0   0  0
## ka     0   0  0
## Cl     0   0  0
## V1     0   0  0
## Q      0   0  0
## V2     0   0  0
## 
## Residual error model:
##           y 
## "combined2" 
## Sampling of the conditional distribution using the initial model ... 
## 
## Estimated criteria (linearization):
##    AIC    BIC   BICc 
## 666.78 687.30 703.65 
## 
## Estimation of the population parameters using the transformed covariates ... 
## Sampling of the conditional distribution using the the transformed covariates ... 
## __________________________________________________
## - - - Iteration 1 - - -
## 
## Covariate model:
##      sex age wt logtWt
## Tlag   0   0  0      0
## ka     1   0  0      0
## Cl     0   0  0      1
## V1     1   0  0      1
## Q      0   1  0      1
## V2     0   0  0      0
## 
## Residual error model:
##           y 
## "combined2" 
## 
## Run scenario for model 1 ... 
## Estimation of the population parameters... 
## Sampling from the conditional distribution... 
## Estimation of the log-likelihood... 
## 
## Estimated criteria (linearization):
##    AIC    BIC   BICc 
## 638.16 667.48 683.83 
## __________________________________________________
## - - - Iteration 2 - - -
## 
## Covariate model:
##      sex age wt logtWt
## Tlag   0   0  0      0
## ka     1   0  0      0
## Cl     0   0  0      1
## V1     0   0  0      1
## Q      0   1  0      1
## V2     0   0  0      0
## 
## Residual error model:
##           y 
## "combined2" 
## 
## Run scenario for model 2 ... 
## Estimation of the population parameters... 
## Sampling from the conditional distribution... 
## Estimation of the log-likelihood... 
## 
## Estimated criteria (linearization):
##    AIC    BIC   BICc 
## 651.06 678.91 695.26 
## __________________________________________________
## - - - Iteration 3 - - -
## 
## Covariate model:
##      sex age wt logtWt
## Tlag   0   0  0      0
## ka     1   0  0      0
## Cl     0   0  0      1
## V1     0   0  0      1
## Q      0   1  0      0
## V2     0   0  0      0
## 
## Residual error model:
##           y 
## "combined2" 
## 
## Run scenario for model 3 ... 
## Estimation of the population parameters... 
## Sampling from the conditional distribution... 
## Estimation of the log-likelihood... 
## 
## Estimated criteria (linearization):
##    AIC    BIC   BICc 
## 648.16 674.54 690.89 
## __________________________________________________
## - - - Iteration 4 - - -
## 
## No difference between two successive iterations
## __________________________________________________
## - - - Further tests - - -
## _______________________
## Add parameters/covariates relationships:
##   parameter covariate   p.value
## 5        ka    logtWt 2.318e-02
## 6        Cl       sex 1.817e-06
## 
## Run scenario for model 5 ... 
## Estimation of the population parameters... 
## _______________________
## Remove parameters/covariates relationships:
##     coefficient   p.value
## 4 beta_Cl_sex_1  0.513109
## 6 beta_V1_sex_1  0.361551
## 8 beta_Q_logtWt 0.0519279
## 
## Run scenario for model 6 ... 
## Estimation of the population parameters... 
## Estimation of the log-likelihood... 
## 
## Estimated criteria (linearization):
##    AIC    BIC   BICc 
## 641.41 669.26 685.61 
## _______________________
## Remove parameters/covariates relationships:
##     coefficient  p.value
## 1 beta_ka_sex_1  0.14197
## 4 beta_V1_sex_1  0.37607
## 6 beta_Q_logtWt 0.209595
## 
## Run scenario for model 7 ... 
## Estimation of the population parameters... 
## Estimation of the log-likelihood... 
## 
## Estimated criteria (linearization):
##    AIC    BIC   BICc 
## 635.35 660.27 676.61 
## __________________________________________________
## 
## Final statistical model:
## 
## Covariate model:
##      age logtWt sex wt
## Tlag   0      0   0  0
## ka     0      0   0  0
## Cl     0      1   0  0
## V1     0      1   0  0
## Q      1      0   0  0
## V2     0      0   0  0
## 
## Residual error model:
##           y 
## "combined2" 
## 
## Estimated criteria (linearization):
##    AIC    BIC   BICc 
## 635.35 660.27 676.61 
## 
## total time: 137.2s
## __________________________________________________
## 
## --------------------------------------------------
## 
## Final complete model:
## 
## Variance model: 
## Parameters without variability:  
## Parameters with variability   : Tlag ka Cl V1 Q V2 
## 
## Covariate model:
##      age logtWt sex wt
## Tlag   0      0   0  0
## ka     0      0   0  0
## Cl     0      1   0  0
## V1     0      1   0  0
## Q      1      0   0  0
## V2     0      0   0  0
## 
## Correlation model:
## [1] "NULL"
## 
## Residual error model:
##           y 
## "combined2" 
## 
## Estimated criteria (linearization):
##    AIC    BIC   BICc 
## 635.35 660.27 676.61 
## 
## total time: 144.7s
## --------------------------------------------------