add_covariate_effect {pharmr}R Documentation

add_covariate_effect

Description

Adds covariate effect to :class:pharmpy.model.

The following effects have templates:

math::

coveff = 1 + theta * (cov - median)

math::

coveff = 1

math::

coveff = 1 + theta

math::

coveff = 1 + theta1 * (cov - median)

math::

coveff = 1 + theta2 * (cov - median)

math::

coveff = exp(theta * (cov - median))

math::

min(fraclog(0.01)min - median, fraclog(100)max - median)

math::

max(fraclog(0.01)max - median, fraclog(100)min - median)

math::

coveff = (fraccovmedian)^theta

Usage

add_covariate_effect(
  model,
  parameter,
  covariate,
  effect,
  operation = "*",
  allow_nested = FALSE
)

Arguments

model

(Model) Pharmpy model to add covariate effect to.

parameter

(str) Name of parameter to add covariate effect to.

covariate

(str) Name of covariate.

effect

(str) Type of covariate effect. May be abbreviated covariate effect (see above) or custom.

operation

(str) Whether the covariate effect should be added or multiplied (default).

allow_nested

(logical) Whether to allow adding a covariate effect when one already exists for the input parameter-covariate pair.

Value

(Model) Pharmpy model object

Examples

## Not run: 
model <- load_example_model("pheno")
model <- add_covariate_effect(model, "CL", "APGR", "exp")
model$statements$before_odes$full_expression("CL")

## End(Not run)


[Package pharmr version 0.96.0 Index]