Learn R Programming

nlmixr2autoinit (version 1.0.0)

calculate_tad: Calculate time after dose for pharmacokinetic data

Description

Calculate time after dose (TAD) for pharmacokinetic observations.

Usage

calculate_tad(dat, verbose = FALSE)

Value

A modified data frame with added columns:

  • tad: time after dose, calculated as the observation time minus the time of the most recent prior dose; set to NA for dosing records

  • iiobs: interdose interval inherited from the most recent dosing record

  • rateobs: infusion rate inherited from the most recent dosing record

  • routeobs (optional): route of administration inherited from the most recent dosing record, included only if route information is present

  • dose_number: sequential dose number, generated if not already present

Arguments

dat

A data frame containing raw time–concentration data in the standard nlmixr2 format.

verbose

Logical; if TRUE, prints informational messages during processing (e.g., when generating dose numbers). Default is FALSE.

Author

Zhonghui Huang

Details

The procedure identifies dosing events based on the event identifier (EVID) and assigns each observation the attributes of the most recent prior dose. The time after dose is then calculated for observation rows. If dose_number column is not present in the input, it is automatically created for each subject.

Examples

Run this code
calculate_tad(Bolus_1CPT)
calculate_tad(Infusion_1CPT)
calculate_tad(Oral_1CPT)

Run the code above in your browser using DataLab