blk.addl | R Documentation |
These are special functions to help reduce multiple dose records
at a fixed interval to single dose records with an ADDL
column for the number of additional doses and an II
column for the interdose interval in the style of NONMEM.
blk.ii(time, id, dose.ind, diff.op=difftime.default)
blk.addl(ii, id, dose.ind, dose, tol.ii=1e-5, tol.dose=1e-5, min.consec=2, include.last=FALSE, diff.op=difftime.default)
time |
A vector of event times in |
ii |
A vector of interdose intervals in
|
id |
A valid |
dose.ind |
A logical vector in |
dose |
Vector of dose amounts in |
tol.ii |
A numeric tolerance for comparing the interdose intervals. See details. |
tol.dose |
A numeric tolerance for comparing dose amounts. See details. |
min.consec |
An integer specifying the minumum number of dose
records to be considered for |
include.last |
A logical. Should the last dose before a non-dosing event be considered for merging? |
diff.op |
A function that subtracts one time from another. |
These functions operates on a PK data set in block-format
.
Event times are specified by time
and rows that corresponding to dose events are
indicated by dose.ind
.
In NONMEM (many other software packages used in pharmcometrics
have adopted the same convention), multiple dose events with the
same dose amount given at a fixed time interval can be specified
on a single dose record by specifying two variables: ADDL
for the number of additional doses (i.e., not counting the
current dose record, making the total number of dose events equal
to ADDL + 1
), and II
for the interdose
interval (the fixed time interval between consecutive dose
events). These functions will help to derive these variable from
a data set in which each dose event is its own records, leading to
a more compact dataset (in some cases, much more compact if many
dose records can be eliminated).
When determining if multiple dose records can safely be combined,
successive dose amounts and iterdose time intervals need to be
compared to make sure they are the same. Those numeric comparisons
can be made to have a certain tolerance, specified by the
tol.dose
and tol.ii
respectively. If two successive
values are within the tolerance of each other in absolute value,
they will be considered the same.
For blk.ii
, a numeric vector in block-format
with respect to id
containing the interdose intervals.
For blk.addl
, a numeric vector in block-format
with respect to id
containing the ADDL
count for dose events that could represent
multiple doses, the value -1 for dose events that should be removed if
ADDL
dosing records are used, and 0 for all other events.
Benjamin Rich <mail@benjaminrich.net>
block-format
blk.intereventTime
blk.isSteadyState
blk.findConsecutive
difftime.default
require(nlme)
data(Phenobarb)
dat <- Phenobarb[1:56,] # First 4 subjects
attach(dat)
cbind(dat, II=blk.ii(time, asID(Subject), !is.na(dose)),
ADDL1=blk.addl(blk.ii(time, asID(Subject), !is.na(dose)), asID(Subject), !is.na(dose), dose),
ADDL2=blk.addl(blk.ii(time, asID(Subject), !is.na(dose)), asID(Subject), !is.na(dose), dose, min.consec=5),
ADDL3=blk.addl(blk.ii(time, asID(Subject), !is.na(dose)), asID(Subject), !is.na(dose), dose, include.last=TRUE))
detach(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.