Description Usage Arguments Details Value Note Author(s)
Calculates dosing occasion for any NONMEM file that contains dosing records.
1 2 
data 
data frame containing data in NONMEM format. 
ID_col 
name of column containing patient IDs. 
TIME_col 
name of column containing TIME. 
OCC_col 
name of the new column that will contain OCC. 
CMT_vals_dose 
vector of value(s) of CMT for which doses qualify for contribution to the OCC calculation. If CMT_vals_dose is left as FALSE and a CMT column exists then all doses will contribute to the calculation of OCC, 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 OCC calculation, then set: CMT_vals_dose=2. 
CMT_vals_obs 
vector of value(s) of CMT for which observations qualify for contribution to the OCC calculation. This function argument will only influence the calculation if calc_method='by_obs'. If CMT_vals_obs is left as FALSE then all observations will influence the calculation of OCC. 
calc_method 
'by_dose' (default) or 'by_obs'. Sets the calculation method.

RULES FOR CALCULATION OF OCC:
calc_method = 'by_obs'
OCC=0 for all observations and doses before the first dose (with CMT within CMT_vals_dose) that is followed by at least one
observation (with CMT within CMT_vals_obs).
OCC=1 for the first dose (with CMT within CMT_vals_dose) that is also followed by at least one observation (with CMT within
CMT_vals_obs), and OCC=1 for each of those observations.
OCC will become 2 on the next dose (with CMT within CMT_vals_dose) which is also followed by at least one observation (with CMT
within CMT_vals_obs), and OCC=2 for each of those observations the pattern then continues.
calc_method = 'by_dose'
OCC=0 for all observations and doses before the first dose (with CMT within CMT_vals_dose).
OCC=1 for the first dose (with CMT within CMT_vals_dose), and OCC=1 for each subsequent observation until the next dose (with CMT
within CMT_vals_dose).
OCC will become 2 on the next dose (with CMT within CMT_vals_dose), and OCC=2 for each subsequent observation until the next dose
(with CMT within CMT_vals_dose) the pattern then continues.
calc_method = 'by_dose' is most suitable for building models where each and every administration of a dose can plausibly lead to a change in a model parameter. This is particularly suitable for modelling IOV of absorptionrelated parameters in a PK model where each absorption occasion can be randomly influenced by many things such as intake of food, gastric pH, exercise etc.
calc_method = 'by_obs' is most suitable for building models where parameters might be changing more slowly and not necessarily after every dose. For example, this is more suitable for modelling IOV of parameters in a PK model where IV infusions are given only once a week or once a month and the IOV in the parameter(s) is not really associated with the dosing event but more to do with changes in something physiological over time. The IOV is then only updated upon the collection of new observations which supply evidence with which to update the parameter estimate(s).
The input data frame with OCC added in new column with name OCC_col.
calc_method = 'by_obs' is also the most suitable for visualizing data by occasion using the NONMEM_plot function (BAST NONMEM data file visualisation tool).
Rupert Austin
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.