Data for rxode2 (and nlmixr2) follows
NONMEM dataset conventions; most NONMEM-ready datasets can be used
directly. This page is the column-by-column reference. For worked
examples of each kind of dose see Dosing event types; to build the data
in R instead of by hand see Building
event tables with et().
Differences from NONMEM
In general, rxode2 event tables follow NONMEM dataset conventions with the following exceptions and extensions:
- The compartment data item (
cmt) can be a string/factor with compartment names.- You may turn off a compartment with a negative compartment number or
"-cmt"wherecmtis the compartment name. - The compartment data item (
cmt) can still be a number; the number of a compartment is defined by the order of appearance of its name in the model. You can assign compartment numbers explicitly withcmt(cmtName)at the beginning of the model.
- You may turn off a compartment with a negative compartment number or
- An additional column
durcan specify the duration of infusions:- Bioavailability changes will change the rate of infusion
when
dur/amtare fixed in the input data. - Similarly, when specifying
rate/amtfor an infusion, bioavailability changes will alter the infusion duration sincerate/amtare fixed.
- Bioavailability changes will change the rate of infusion
when
- Some infrequent NONMEM columns are not supported:
pcmt,call. - NONMEM-style events are supported (0: Observation, 1: Dose, 2:
Other, 3: Reset, 4: Reset+Dose). Additional events are supported:
-
evid=5or replace event: replaces the value of a compartment with the value specified in theamtcolumn (equivalent todeSolvereplace). -
evid=6or multiply event: multiplies the compartment value by theamtcolumn (equivalent todeSolvemultiply). -
evid=7or transit/phantom event: puts the dose in thedose()function and calculates time since last dosetad(), but does not place the dose in the compartment. This allows thetransit()function to be applied easily.
-
Columns by type of use
Data for input into rxode2 (and nlmixr2) is
similar to NONMEM data; most NONMEM-ready datasets can be used
directly.
Observation columns
| Column | Meaning |
|---|---|
DV |
Dependent variable (measurement) |
CENS |
Censoring indicator (0 = not censored, 1 = left censored, -1 = right censored) |
LIMIT |
Censoring bound used with CENS (see below) |
MDV |
Missing dependent variable indicator |
CMT |
Compartment name or number for the observation |
DVID |
Dependent variable identifier for multiple endpoints |
EVID |
Event identifier |
Complete column quick-reference table
| Data Item | Meaning | Notes |
|---|---|---|
id |
Individual identifier | Integer, factor, character, or numeric |
time |
Individual time | Numeric |
amt |
Dose amount | Positive for doses; zero/NA for observations |
rate |
Infusion rate | Duration = amt/rate; rate=-1: rate
modeled; rate=-2: duration modeled |
dur |
Infusion duration | Rate = amt/dur
|
evid |
Event ID | 0=Obs; 1=Dose; 2=Other; 3=Reset; 4=Reset+Dose; 5=Replace; 6=Multiply; 7=Transit |
cmt |
Compartment | Name or number; prefix - to turn off |
ss |
Steady-state flag | 0=non-SS; 1=SS; 2=SS + keep prior states |
ii |
Inter-dose interval | Time between doses |
addl |
Additional doses | Number of doses identical to this one |
dvid |
DV identifier | Identifies which endpoint an observation belongs to |
Per-column details
AMT column
The AMT column defines the amount of a dose administered
to CMT. For observation rows it should be 0 or
NA. For zero-order infusions the rate or duration is set
via RATE or DUR.
CENS / LIMIT columns
CENS indicates whether the observation in
DV is censored:
-
CENS = 0: not censored;LIMITis ignored. -
CENS = 1: left censored (e.g., below the limit of quantification); the true value lies in (LIMIT,DV). -
CENS = -1: right censored (above limit of quantification); the true value lies in (DV,LIMIT).
rxode2 stores these values so that nlmixr2
can use them in likelihood calculations.
CMT column
CMT indicates the compartment where an event occurs. A
character string or factor (the preferred form) is matched by name in
the model. An integer is matched by the order in which compartments
appear in the model. Prefix with -
(e.g. cmt="-depot") to turn off a compartment.
DUR column
DUR defines the duration of a zero-order infusion. When
DUR is specified, the infusion rate is computed as
rate = amt/dur. Bioavailability changes affect the rate,
not the duration.
DV column
DV is the dependent variable in the observation
compartment defined by CMT / DVID. It may be
missing (MDV=1) or censored (CENS!=0).
DVID column
DVID identifies which endpoint an observation belongs to
in multi-endpoint models. It maps to the cond field in
$predDf and can be specified as a name (matching the
endpoint variable) or integer.
EVID column
The event identifier for a row of data:
EVID |
Meaning |
|---|---|
| 0 | Observation |
| 1 | Dose |
| 2 | Other (e.g. turn off compartment) |
| 3 | Reset all compartments to initial values |
| 4 | Reset + dose |
| 5 | Replace compartment value with amt
|
| 6 | Multiply compartment value by amt
|
| 7 | Transit/phantom dose (dose() / tad()
only) |
Output-only EVID values (visible when
addDosing=TRUE, subsetNonmem=FALSE):
EVID |
Meaning |
|---|---|
| -1 | Modeled-rate infusion end (rate=-1) |
| -2 | Modeled-duration infusion end (rate=-2) |
| -10 | Rate-specified infusion end (rate>0) |
| -20 | Duration-specified infusion end (dur>0) |
| 101, 102, … | Modeled times 1, 2, … (mtime) |
Use addDosing=NA to see classic EVID
equivalents instead.
ID column
ID separates individuals (persons, animals, etc.). The
solver re-initializes the numerical integrator and samples new random
effects with each new ID. It may be an integer, character,
or factor.
RATE column
RATE specifies a zero-order infusion rate. The infusion
duration is computed as dur = amt/rate. Special values:
-
rate = -1: rate is modeled (set viarate(cmt)in the model block); equivalent to NONMEMRATE=-1. -
rate = -2: duration is modeled (set viadur(cmt)in the model block); equivalent to NONMEMRATE=-2.
When RATE is fixed in the dataset, a bioavailability
change alters the infusion duration. When DUR is
fixed instead, a bioavailability change alters the infusion
rate.
Covariate columns
Any column that is not one of the reserved columns above and whose
name matches a model variable is treated as a covariate. Covariates that
change over time within a subject are interpolated between records (see
the covsInterpolation argument of rxSolve());
values that are constant per subject can instead be supplied with
rxSolve(..., iCov=). See Covariates for examples.
SS, II and ADDL columns
-
SS = 1solves the dose to steady state before applying it;SS = 2does the same but adds the result to the current state (for non-uniform regimens).IIgives the dosing interval used to reach steady state. -
ADDLrepeats the doseADDLmore times, everyIItime units. The repeated doses are plain doses: anSSflag or anEVID=4reset applies only to the first one, as in NONMEM.
See Dosing event types for examples.
Other notes
-
NONMEM’sDVis not required;rxode2is an ODE solving framework andDVis only used bynlmixr2. -
NONMEM’sMDVis not required; missingness is captured inEVID. - Instead of NONMEM-compatible data,
deSolve-compatible data frames are also accepted. - The classic RxODE
EVIDencoding is also supported (see Classic rxode2 Events).
