View source: R/functions_wrapper.R
add_allometry | R Documentation |
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".
add_allometry(
model,
allometric_variable = NULL,
reference_value = 70,
parameters = NULL,
initials = NULL,
lower_bounds = NULL,
upper_bounds = NULL,
fixed = TRUE
)
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 |
(Model) Pharmpy model object
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.