get_model_covariates#

pharmpy.modeling.get_model_covariates(model, strings=False)[source]#

List of covariates used in model

A covariate in the model is here defined to be a data item affecting the model prediction excluding dosing items that are not used in model code.

Parameters:
  • model (Model) – Pharmpy model

  • strings (bool) – Return strings instead of symbols? False (default) will give symbols

Returns:

list – Covariate symbols or names

Examples

>>> from pharmpy.modeling import load_example_model, get_model_covariates
>>> model = load_example_model("pheno")
>>> get_model_covariates(model)
[APGR, WGT]
>>> get_model_covariates(model, strings=True)
['APGR', 'WGT']