pharmpy.modeling.add_administration#
- pharmpy.modeling.add_administration(td, arm, variable, amount, time_points, start_time=0.0)[source]#
Add observations to an arm in a trial design
- Parameters:
td (TrialDesign) – TrialDesign to add to
arm (str) – Name of the arm
variable (str) – Name of the dose variable (e.g. AMT)
amount (float) – The dose amount
time_points (Sequence[float]) – List of the time points for the administration
start_time (float) – Set a start_time to offset the time_points. Default 0.0
- Returns:
TrialDesign – An updated TrialDesign
Example
>>> from pharmpy.modeling import create_trial_design, add_arm, add_observations >>> from pharmpy.modeling import add_administration >>> td = create_trial_design() >>> td = add_arm(td, name="Drug", size=100) >>> td = add_observations(td, arm="Drug", variable="DV", time_points=[0.0, 1.0, 2.0, 4.0, 16.0]) >>> td = add_administration(td, arm="Drug", variable="AMT", amount=10.0, time_points=[0.0, 8.0]) >>> td ╭────── Observations ──────╮ Drug │ 0.0, 1.0, 2.0, 4.0, 16.0 │ ╰─────────── DV ───────────╯ ╭───── Administration ─────╮ │ 0.0, 8.0 │ ╰─────── 10.0 Bolus ───────╯ ├──────────────────────────┤ 0.0 16.0