calc_tad: Calculates Time After most recent Dose for a NONMEM data...

Description Usage Arguments Value Note Author(s)

View source: R/calc_tad.R


Calculates elapsed time after most recent dose for any NONMEM file that contains dosing records.


calc_tad(data, ID_col = "ID", TIME_col = "TIME", TAD_col = "TAD",
  CMT_vals = FALSE, TROUGH_val = 1)



data frame containing data in NONMEM format.


name of column containing patient IDs.


name of column containing TIME.


name of the new column that will contain Time After (most recent) Dose.


vector of value(s) of CMT for which doses should contribute to the TAD calculation. If CMT_vals is left as FALSE and a CMT column exists then all doses will contribute to the calculation of TAD, irrespective of the value of CMT. As an example, you might have oral doses with CMT=1 and IV doses with CMT=2 and you only want the IV doses to register as doses in the TAD calculation, then set: CMT_vals=2.


1 (default) or 0. Determines how Time After (most recent) Dose is calculated for an observation record when that obervation record is at the same TIME as a dosing record. If the dosing record is the first qualifying dose (i.e. it's CMT exists within CMT_vals) then TAD will always be calculated as 0 irrespective of the setting for TROUGH_val. For subsequest qualifying doses which have observation records at the same TIME, if TROUGH_val=1 then TAD will be calculated as the elapsed TIME since the previous qualifying dose (default behaviour because this gives much better distinction of the trough concentrations in VPC/GOF plots). If TROUGH_val=0 then TAD will be calculated as 0.


The input data frame with Time After last Dose added in new column with name TAD_col.


If a patient has no qualifying dosing records, then TAD will be set to 0 for all records.

If CMT_vals<>FALSE then any dosing record with CMT not within CMT_vals will be treated like an observation record, and will likely have some TAD values >0.


Rupert Austin

jgrevel/BAST1-R-Library documentation built on May 21, 2019, 10:11 a.m.