plot_cwres_vs_idv#

pharmpy.modeling.plot_cwres_vs_idv(model, residuals, stratify_on=None, bins=8)[source]#

Plot CWRES vs idv

Parameters:
  • model (Model) – Pharmpy model

  • residuals (pd.DataFrame) – DataFrame containing CWRES

  • stratify_on (str) – Name of parameter for stratification

  • bins (int) – Number of bins for stratification

Returns:

alt.Chart – Plot

Examples

from pharmpy.modeling import load_example_model, plot_cwres_vs_idv
from pharmpy.tools import load_example_modelfit_results

model = load_example_model("pheno")
res = load_example_modelfit_results("pheno")
plot_cwres_vs_idv(model, res.residuals)
from pharmpy.modeling import load_example_model, plot_cwres_vs_idv
from pharmpy.tools import load_example_modelfit_results

model = load_example_model("pheno")
res = load_example_modelfit_results("pheno")
plot_cwres_vs_idv(model, res.residuals, 'WGT', bins=4)