Learn R Programming

nlmixr2lib (version 0.3.0)

addLogEstimates: Add log estimates to a model

Description

Add log estimates to a model

Usage

addLogEstimates(ui, vars, extraLines = NULL, beforeCmt = NULL)

Value

rxode2 model with log estimates added (and possibly extra lines)

Arguments

ui

rxode2 model

vars

estimates to add they will be parameterized as:

var <- exp(lvar)

where var is the variable name in the model and lvar is the log transformed variable that will be estimated

extraLines

this is a list of additional lines to add to the model just after the variables are defined. It must be NULL or a list of language objects.

beforeCmt

if the model is compartmental you can specify the preferred names where the estimates and extra lines are added before

Author

Matthew L. Fidler

Examples

Run this code

# Change the transformation of the PK model from cl to k

readModelDb("PK_3cmt_des") |>
  removeLinesAndInis(c("kel", "k12", "k21", "k13", "k31", "vc")) |>
  addLogEstimates(c("kel", "k12", "k21", "k13", "k31", "vc"))

# You can also label the parameters by using a named character
# vector with the names of the parameters representing the
# variables and the values representing the labels:

readModelDb("PK_3cmt_des") |>
  removeLinesAndInis(c("kel", "k12", "k21", "k13", "k31", "vc")) |>
  addLogEstimates(c(kel="elimination", k12="k12 constant",
                    k21="k21 constant",
                    k13="k13 constant",
                    k31="k31 constant",
                    vc="volume of central compartment"))

Run the code above in your browser using DataLab