Learn R Programming

qpNCA (version 1.1.6)

correct.time: Correct Concentrations for Time Deviations

Description

Corrects concentrations at critical, but deviating time points (e.g, predose, TAU, start and end of user selected AUC interval), and adds missing records at these critical time points.

Usage

correct.time(
  x,
  by = character(0),
  nomtimevar = "ntad",
  timevar = "time",
  depvar = "dv",
  tau = NA,
  tstart = NA,
  tend = NA,
  teval = NA,
  th = NA,
  reg = "SD",
  method = 1
)

Arguments

x

input dataset name (after LOQ values have been imputed by correct.loq)

by

column names in x indicating grouping variables

nomtimevar

variable name containing the nominal sampling time after dose

timevar

variable name containing the actual sampling time after dose

depvar

variable name containing the dependent variable (e.g., concentration)

tau

dosing interval (for multiple dosing); NA (default) if single dose; x$tau overrides

tstart

start time of partial AUC (start>0); NA (default) if not requested; x$tstart overrides

tend

end time of partial AUC; NA (default) if not requested; x$tend overrides

teval

user selected AUC interval, starting at t=0; NA (default) if not requested; x$teval overrides

th

lamdba_z information for each curve; like output of est.thalf

reg

regimen, "sd" or "md"; x$reg overrides

method

method for trapezoidal rule; x$method overrides if provided

  • 1: linear up - linear down

  • 2: linear up - logarithmic down

  • 3: linear before first Tmax, logarithmic after first Tmax

Value

a dataset with time deviation corrections applied (timevar and depvar adapted). The following variables are added:

Variable Description
create.nr is a missing record created?
create.txt explanation of what is created
trule.nr correction rule number
trule.txt text explaining what was altered
applies.to.time lists all critical time points to which the time deviation rule applies
time.tau, conc.tau time and conc, corrected for AUCtau calculation
time.teval, conc.teval time and conc, corrected for AUCteval calculation (AUC0-teval)
time.part, conc.part time and conc, corrected for partial AUC calculation (AUCstart-end, start>0)
time.lastall, conc.lastall time and conc, corrected for AUClast and AUCall calculation
t0.flag, tau.flag, tstart.flag, tend.flag, teval.flag flags for what timepoint the correction was needed

The following are preserved if present in x: tau, tstart, tend, teval, reg, ss, route, method.

Details

  • Records with missing NOMINAL time will be removed and this must be corrected before the function is called

  • If a record at the critical time point is missing, add it and set time to nominal time and set dv conc to NA

  • Use interpolation if there is a measurable concentration AFTER the nominal time point (i.e. sample is taken too late)

  • Use extrapolation if there is NO measurable concentration AFTER the nominal time point (i.e. sample is taken too early)

  • Set deviating time at predose after single dose to 0

  • Original time and conc will be kept in original variables.

The following Time Deviation Correction Rules will be applied to critical time points (t = 0, tau, tstart, tend, teval), if needed:

Rule Regimen Description Applied to
SDT-1 sd Set actual time to 0 t = 0
SDT-2 sd Correct concentration at deviating time by interpolation t = tau,tstart,tend,teval
SDT-3 sd Correct concentration at deviating time by extrapolation t = tau,tend,teval
MDT-1 md If predose sample taken after dosing, set actual time to 0 and conc to NA t = 0
MDT-2 md Correct concentration at deviating time by interpolation (too late) t = tau,tstart,tend,teval
MDT-3 md Correct concentration at deviating time by extrapolation (too early) t = 0,tau,tend,teval
MDT-3a md Set actual time to zero if concentration is BLOQ (too early) t = 0

Examples

Run this code
# NOT RUN {
example(calc.ctmax)
x %<>% mutate(reg = 'SD', method = 1, route = 'EV')
# route not used yet, but still preserved
x %<>% correct.time(by = 'subject', th = th)
x %>% head
# }

Run the code above in your browser using DataLab