calc_dose: Calculates most recent DOSE size for a NONMEM data file.

Description Usage Arguments Details Value Note Author(s)

View source: R/calc_dose.R

Description

Calculates size of most recent dose for any NONMEM file that contains dosing records.

Usage

1
2
calc_dose(data, ID_col = "ID", TIME_col = "TIME", DOSE_col = "DOSE",
  CMT_vals = FALSE)

Arguments

data

data frame containing data in NONMEM format.

ID_col

name of column containing patient IDs.

TIME_col

name of column containing TIME.

DOSE_col

name of the new column that will contain DOSE.

CMT_vals

vector of value(s) of CMT for which doses should contribute to the DOSE calculation. If CMT_vals is left as FALSE and a CMT column exists then all doses will contribute to the calculation of DOSE, 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 DOSE calculation, then set: CMT_vals=2.

Details

RULES FOR CALCULATION OF DOSE:

DOSE = first non-zero value of AMT (which has CMT within CMT_vals) for all observations before the first dose. Whenever AMT (which has CMT within CMT_vals) changes to a new non-zero value, that becomes the new value of DOSE until AMT (which has CMT within CMT_vals) changes again to a non-zero value.

Value

The input data frame with DOSE added in new column with name DOSE_col.

Note

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

Author(s)

Rupert Austin


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