'nlme_lin_cmpt' fits a linear one to three compartment model with either first order absorption, or i.v. bolus, or i.v. infusion. A user specifies the number of compartments, route of drug administrations, and the model parameterization. `nlmixr` supports the clearance/volume parameterization and the micro constant parameterization, with the former as the default. Specification of fixed effects, random effects and initial values follows the standard nlme notations.

nlme_lin_cmpt(
  dat,
  parModel,
  ncmt,
  oral = TRUE,
  infusion = FALSE,
  tlag = FALSE,
  parameterization = 1,
  parTrans = .getParfn(oral, ncmt, parameterization, tlag),
  mcCores = 1,
  ...
)

nlmeLinCmpt(
  dat,
  parModel,
  ncmt,
  oral = TRUE,
  infusion = FALSE,
  tlag = FALSE,
  parameterization = 1,
  parTrans = .getParfn(oral, ncmt, parameterization, tlag),
  mcCores = 1,
  ...
)

nlmeLinCmt(
  dat,
  parModel,
  ncmt,
  oral = TRUE,
  infusion = FALSE,
  tlag = FALSE,
  parameterization = 1,
  parTrans = .getParfn(oral, ncmt, parameterization, tlag),
  mcCores = 1,
  ...
)

Arguments

dat

data to be fitted

parModel

list: model for fixed effects, randoms effects and initial values using nlme-type syntax.

ncmt

numerical: number of compartments: 1-3

oral

logical

infusion

logical

tlag

logical

parameterization

numerical: type of parameterization, 1=clearance/volume, 2=micro-constants

parTrans

function: calculation of PK parameters

mcCores

number of cores used in fitting (only for Linux)

...

additional nlme options

Value

A nlmixr nlme fit object

Author

Wenping Wang

Examples

library(nlmixr)

specs <- list(fixed=lKA+lCL+lV~1, random = pdDiag(lKA+lCL~1),
              start=c(lKA=0.5, lCL=-3.2, lV=-1))
fit <- nlme_lin_cmpt(theo_md, par_model=specs, ncmt=1, verbose=TRUE)
#> 
#> **Iteration 1
#> LME step: Loglik: -420.4062, nlminb iterations: 1
#> reStruct  parameters:
#>      ID1      ID2 
#> 5.434250 5.693011 
#>  Beginning PNLS step: ..  completed fit_nlme() step.
#> PNLS step: RSS =  300.8155 
#>  fixed effects: 0.2384012  1.057595  3.395177  
#>  iterations: 7 
#> Convergence crit. (must all become <= tolerance = 1e-05):
#>    fixed reStruct 
#> 4.025732 4.507369 
#> 
#> **Iteration 2
#> LME step: Loglik: -422.6508, nlminb iterations: 5
#> reStruct  parameters:
#>       ID1       ID2 
#> 0.9829978 1.4302117 
#>  Beginning PNLS step: ..  completed fit_nlme() step.
#> PNLS step: RSS =  300.5795 
#>  fixed effects: 0.2352729  1.058965  3.393164  
#>  iterations: 3 
#> Convergence crit. (must all become <= tolerance = 1e-05):
#>       fixed    reStruct 
#> 0.013296459 0.004640789 
#> 
#> **Iteration 3
#> LME step: Loglik: -422.666, nlminb iterations: 1
#> reStruct  parameters:
#>       ID1       ID2 
#> 0.9821654 1.4298669 
#>  Beginning PNLS step: ..  completed fit_nlme() step.
#> PNLS step: RSS =  300.5795 
#>  fixed effects: 0.2352729  1.058965  3.393164  
#>  iterations: 1 
#> Convergence crit. (must all become <= tolerance = 1e-05):
#>    fixed reStruct 
#>        0        0 
#plot(augPred(fit,level=0:1))
summary(fit)
#> Nonlinear mixed-effects model fit by maximum likelihood
#>   Model: DV ~ (nlmixr::nlmeModList("user_fn"))(lCL, lV, lKA, TIME, ID) 
#>        AIC      BIC   logLik
#>   857.3319 878.7876 -422.666
#> 
#> Random effects:
#>  Formula: list(lKA ~ 1, lCL ~ 1)
#>  Level: ID
#>  Structure: Diagonal
#>              lKA       lCL Residual
#> StdDev: 0.399603 0.2553844 1.067033
#> 
#> Fixed effects: lKA + lCL + lV ~ 1 
#>        Value  Std.Error  DF   t-value p-value
#> lKA 0.235273 0.12654742 250   1.85917  0.0642
#> lCL 1.058965 0.07713563 250  13.72861  0.0000
#> lV  3.393164 0.02575930 250 131.72577  0.0000
#>  Correlation: 
#>     lKA    lCL   
#> lCL -0.013       
#> lV   0.263 -0.103
#> 
#> Standardized Within-Group Residuals:
#>         Min          Q1         Med          Q3         Max 
#> -4.85501590 -0.40260329  0.06705212  0.43848331  3.43996202 
#> 
#> Number of Observations: 264
#> Number of Groups: 12