set_direct_effect#
- pharmpy.modeling.set_direct_effect(model, expr, variable=None)[source]#
Add an effect to a model.
Effects are by default using concentratrion, but any user specified variable in the model can be used. Implemented PD models are:
Linear:
Emax:
Step effect:
Sigmoidal:
Log-linear:
is the baseline effect- Parameters:
model (Model) – Pharmpy model
expr ({‘linear’, ‘emax’, ‘sigmoid’, ‘step’, ‘loglin’}) – Name of PD effect function.
variable (str) – Name of variable to use (if None concentration will be used)
- Returns:
Model – Pharmpy model object
Examples
>>> from pharmpy.modeling import * >>> model = load_example_model("pheno") >>> model = set_direct_effect(model, "linear") >>> model.statements.find_assignment("E") ⎛SLOPE⋅A_CENTRAL(t) ⎞ B⋅⎜────────────────── + 1⎟ E = ⎝ VC ⎠