tad: Calculate Time Since Most Recent Dose

Description Usage Arguments Value See Also Examples

View source: R/tad.R

Description

Calculate time since most recent dose.

Usage

1
2
tad(x, dose = rep(FALSE, length(x)), addl = rep(0, length(x)), ii = rep(0,
  length(x)), index = rep(1, length(x)), pre = TRUE, ...)

Arguments

x

a numeric vector of event times

dose

length x logical indicating which of x are dose times

addl

length x integer: number of additional doses

ii

length x numeric: interdose interval for addl

index

length x factor (optional) indicating subgroups to evaluate

pre

assume that simultaneous sample precedes implied dose

...

passed to tod()

Value

numeric

See Also

tod

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(tad1)
x <- tad1
head(x)
x$tad <- tad(
   x = x$TIME,
   dose = x$EVID %in% c(1,4) & is.na(x$C),
   addl = x$ADDL,
   ii = x$II,
   index = x$ID
 )
head(x)

bergsmat/nonmemica documentation built on Feb. 6, 2019, 10:18 a.m.