correct.time: Correct Concentrations for Time Deviations

Description Usage Arguments Details Value Examples

View source: R/correct.time.r

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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

Details

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

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.

Examples

1
2
3
4
5
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

qpNCA documentation built on Aug. 16, 2021, 5:08 p.m.