add_allometry {pharmr} | R Documentation |
add_allometry
Description
Add allometric scaling of parameters
Add an allometric function to each listed parameter. The function will be P=P*(X/Z)**T where P is the parameter, X the allometric_variable, Z the reference_value and T is a theta. Default is to automatically use clearance and volume parameters.
If there already exists a covariate effect (or allometric scaling) on a parameter with the specified allometric variable, nothing will be added.
If no allometric variable is specified, it will be extracted from the dataset based on the descriptor "body weight".
Usage
add_allometry(
model,
allometric_variable = NULL,
reference_value = 70,
parameters = NULL,
initials = NULL,
lower_bounds = NULL,
upper_bounds = NULL,
fixed = TRUE
)
Arguments
model |
(Model) Pharmpy model |
allometric_variable |
(str or Expr (optional)) Value to use for allometry (X above) |
reference_value |
(numeric or str or Expr) Reference value (Z above) |
parameters |
(array(numeric or str or Expr) (optional)) Parameters to use or NULL (default) for all available CL, Q and V parameters |
initials |
(array(numeric) (optional)) Initial estimates for the exponents. Default is to use 0.75 for CL and Qs and 1 for Vs |
lower_bounds |
(array(numeric) (optional)) Lower bounds for the exponents. Default is 0 for all parameters |
upper_bounds |
(array(numeric) (optional)) Upper bounds for the exponents. Default is 2 for all parameters |
fixed |
(logical) Whether the exponents should be fixed |
Value
(Model) Pharmpy model object
Examples
## Not run:
model <- load_example_model("pheno")
model <- remove_covariate_effect(model, 'CL', 'WGT')
model <- remove_covariate_effect(model, 'V', 'WGT')
model <- add_allometry(model, allometric_variable='WGT')
model$statements$before_odes
## End(Not run)