tad {nonmemica} | R Documentation |
Calculate Time Since Most Recent Dose
Description
Calculate time since most recent dose. Considers ADDL, but may not work with simultaneous dose records.
Usage
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
Other tad:
tod()
Examples
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)
[Package nonmemica version 1.0.8 Index]