Calculate time since most recent dose. Considers ADDL, but may not work with simultaneous dose records.
tad(x, dose = rep(FALSE, length(x)), addl = rep(0, length(x)), ii = rep(0,
length(x)), index = rep(1, length(x)), pre = TRUE, ...)
a numeric vector of event times
length x logical indicating which of x are dose times
length x integer: number of additional doses
length x numeric: interdose interval for addl
length x factor (optional) indicating subgroups to evaluate
assume that simultaneous sample precedes implied dose
passed to tod()
numeric
Other tad: tod
# NOT RUN {
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)
# }
Run the code above in your browser using DataLab