Add random effects to a model
Arguments
- model
The model as a function
- eta
vector with the parameters to add random effects (sometimes referred to as inter-individual variability, IIV) on
Examples
library(rxode2)
#> rxode2 2.0.13.9000 using 1 threads (see ?getRxThreads)
#> no cache: create with `rxCreateCache()`
readModelDb("PK_1cmt") |> addEta("ka")
#>
#>
#>
#>
#> → Adding eta to lka instead of ka due to mu-referencing
#>
#>
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#> ℹ promote `etalka` to between subject variability with initial estimate 0.1
#> ℹ change initial estimate of `etalka` to `0.1`
#> function ()
#> {
#> description <- "One compartment PK model with linear clearance"
#> ini({
#> lka <- 0.45
#> label("Absorption rate (Ka)")
#> lcl <- 1
#> label("Clearance (CL)")
#> lvc <- 3.45
#> label("Central volume of distribution (V)")
#> propSd <- c(0, 0.5)
#> label("Proportional residual error (fraction)")
#> etalka ~ 0.1
#> })
#> model({
#> ka <- exp(lka + etalka)
#> cl <- exp(lcl)
#> vc <- exp(lvc)
#> Cc <- linCmt()
#> Cc ~ prop(propSd)
#> })
#> }
#> <environment: 0x5604e2ff8ae0>