blk.noninformativeDose | R Documentation |
This function will flag doses that are non-informative in a PK data set because they either occur after the last observation event or they precede a dose given at steady state with no observation events occurring between the two.
blk.noninformativeDose(id, dose.ind, ss.ind = NULL, obs.ind = !dose.ind)
id |
A valid |
dose.ind |
A logical vector in |
ss.ind |
A logical vector in |
obs.ind |
A logical vector in |
This function operates on a PK data set in block-format
.
Rows that corresponding to dose events are
indicated by dose.ind
, and rows that correspond to doses taken at
steady-state are indicated by ss.ind
. A steady-state event renders
any dose events that precede it with no intervening observation events
non-informative. Doses that occur at the end of a block (i.e. after the last
observation event) are also considered non-informative.
Non-informative dose events can effectively be removed from the data without
affecting the analysis of these data.
A logical vector in block-format
with respect to id
indicating dose events
that are non-informative.
Benjamin Rich <mail@benjaminrich.net>
block-format
blk.isSteadyState
require(nlme)
data(Phenobarb)
dat <- Phenobarb[1:56,] # First 4 subjects
attach(dat)
cbind(dat, INTERDOSE.TIME=blk.intereventTime(time, asID(Subject), !is.na(dose)),
IS.SS=blk.isSteadyState(time, asID(Subject), !is.na(dose), 12, 0.301, 60, dose),
FLAG=blk.noninformativeDose(asID(Subject), !is.na(dose), blk.isSteadyState(time, asID(Subject), !is.na(dose), 12, 0.301, 60, dose)))
detach(dat)
dat2 <- data.frame(id=rep(1:2, each=10), dose=0, obs=0)
dat2$dose[c(1:3, 7:8, 12:13, 19:20)] <- 1
dat2$obs[c(5:6, 15:18)] <- 1
dat2$flag <- with(dat2, 1*blk.noninformativeDose(asID(id), dose.ind=(dose==1), obs.ind=(obs==1)))
dat2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.