calc_occ: Calculates OCC (occasion) for a NONMEM data file.

Description Usage Arguments Details Value Note Author(s)

View source: R/calc_occ.R

Description

Calculates dosing occasion for any NONMEM file that contains dosing records.

Usage

1
2
calc_occ(data, ID_col = "ID", TIME_col = "TIME", OCC_col = "OCC",
  CMT_vals_dose = FALSE, CMT_vals_obs = FALSE, calc_method = "by_dose")

Arguments

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.

  • 'by_obs' method defines that the value of OCC will increment by +1 whenever there is a new (qualifying) dosing record that is followed by at least one (qualifying) observation record before the next (qualifying) dosing record.

  • 'by_dose' method defines that the value of OCC will increment by +1 whenever there is a new (qualifying) dosing record irrespective of observations.

Details

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 absorption-related 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).

Value

The input data frame with OCC added in new column with name OCC_col.

Note

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).

Author(s)

Rupert Austin


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