$ERROR

Marks the beginning of abbreviated code for the ERROR routine.

1
2
 $ERROR
 abbreviated code

Discussion

The $ERROR record is used to model intra-individual error in observed values. It is used with PREDPP. It can also be used to to convert predictions from PREDPP, i.e., scaled drug amounts, to other types of predictions (for example, to obtain the prediction of a drug effect as a function of concentration, in a pharmacodynamic study). See abbreviated code for general rules. Specific rules follow.

Assignment and conditional statements

Left-hand quantities

  • Y (Required. The modeled value for the dependent variable under the statistical model.)
  • ERROR-defined (i.e., PRED-defined) items.
  • Left-hand quantities from the $PK block, if they are not random variables and neither $PK nor $ERROR include the COMRES=-1 pseudo-assignment statement.

Right-hand quantities

  • F (Required. The value of the scaled drug amount in the observation compartment.)
  • Data item labels specified on the $INPUT statement.
  • THETA(n)
  • ETA(n) (Required if the data are single-subject, and can be coded ERR(n). Optional if the data are population.)
  • EPS(n) (Required if the data are population, and can be coded ERR(n).)
  • ERROR-defined items that appeared earlier as left-hand quantities. This includes Y.
  • Left-hand quantities from the $PK block, if neither $PK nor $ERROR include the COMRES=-1 pseudo-assignment statement.
  • NEWIND: Same as the NEWIND argument passed by NONMEM to PREDPP.

    • NEWIND=0: First record of the data set. THETA value may differ from value at last call with this record.
    • NEWIND=1: First record of the data set, THETA value does not differ from value at last call with this record, and PRED is nonrecursive (see I_REC), or, First record of a subsequent individual record.
    • NEWIND=2: Subsequent data record of an individual record.
  • NEWL2

    • NEWL2=1: First record of an L2 record.
    • NEWL2=2: Otherwise.
  • ICALL: Same as the ICALL argument passed by NONMEM to PREDPP.

    • ICALL=1: Initialization.
    • ICALL=2: Normal call.
    • ICALL=3: Finalization.
    • ICALL=4: Simulation.
    • ICALL=5: Expectation.
    • ICALL=6: Data Average.
    • Special rules apply to blocks of abbreviated code that are executed when ICALL is not 2.

    (See Initialization-Finalization block, Simulation block, Expectation block, Data average block).

Global Variables in Modules

Certain variables in FORTRAN Modules can be used. (See Variables in modules). The following are of particular interest.

  • A(n) (Amount in compartment n. See State Vector A). If there is no verbatim code and no explicit use of a indexed variable A in the $ERROR block, then the symbol A can be used as a data item label or as a name of an ERROR-defined item.

Forbidden Variable Names: IDEF IREV EVTREC NVNT INDXS G HH DADT(n) E(n) P(n).

Pseudo assignment statements

  • COMRES=-1
  • CALLFL=-1: Call with every event record.
  • CALLFL=0: Call with every observation record.
  • CALLFL=1: Call once per individual record. Of the last three, CALLFL=-1 is the default, except when the abbreviated code consists of one line specifying a simple additive or proportional error model, and no verbatim code is present. CALLFL=2: Call once per problem. In effect, this is supplied by NM-TRAN for the simple error models, but it cannot be specified explicitly in the $ERROR record. (See CALLFL).
  • Pseudo-assignments statements may be enclosed in parentheses. If two of them are present in the same set of parentheses, separate them with a semicolon. A calling protocol phrase may be used within parentheses instead of a pseudo-assignment statement, and then either upper or lower case may be used . E.g.,

    1
    2
    3
    
    $ERROR (ONCE PER IR)       ; same as CALLFL=1
    $ERROR (ONLY OBSERVATIONS) ; same as CALLFL=0
    $ERROR (EVERY EVENT)       ; same as CALLFL=-1 (default)

Record order

  • Follows $SUBROUTINES and $INPUT
  • Follows $MODEL (if a general model such as ADVAN6 is used)
  • Follows $PK (if present)

Observations of Two Different Types

Here we use an example to illustrate how concentration and effect data can be fit simultaneously (see also L2, SIGMA). Suppose that the data set for the phenobarbital example of Chapter 2 is modified to include both concentration and effect observations, and that a data item called TYPE is used to distinguish between them. When TYPE is 1, DV contains an effect measurement. When TYPE is 2, DV contains a concentration. A fragment of the data set for one individual is shown below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  ID   TIME    AMT   APGR     WT     DV TYPE L2
   1    0.    25.0    1.4      7      .   .   1
   1    2.0      .    1.4      7    6.0   1   1
   1    2.0      .    1.4      7   17.3   2   1
   1   12.5    3.5    1.4      7      .   2   2
   1   24.5    3.5    1.4      7      .   2   2
   1   37.0    3.5    1.4      7      .   2   2
   1   48.0    3.5    1.4      7      .   2   2
   1   60.5    3.5    1.4      7      .   2   2
   1   72.5    3.5    1.4      7      .   2   2
   1   85.3    3.5    1.4      7      .   2   2
   1   96.5    3.5    1.4      7      .   2   2
   1  108.5    3.5    1.4      7      .   2   2
   1  112.5      .    1.4      7    8.0   1   2
   1  112.5      .    1.4      7   31.0   2   2

Note that the L2 data items have different values for each multivariate observation within the individual record. The values 1 and 2 are chosen arbitrarily and may be re-used for the L2 data items in the next individual’s data.

We use the following control stream for analysis.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  $PROBLEM COMBINED PK/PD MODEL
  $INPUT ID TIME AMT WT APGR DV TYPE L2
  $DATA COMBDATA
  $SUBROUTINE ADVAN1
  $PK
  TVCL=THETA(1)+THETA(3)*WT
  CL=TVCL+ETA(1)
  TVVD=THETA(2)+THETA(4)*WT
  V=TVVD+ETA(2)
  ;# THE FOLLOWING ARE REQUIRED BY PREDPP
  K=CL/V
  S1=V
  $ERROR
  EMAX=THETA(5)+ETA(3)
  C50=THETA(6)+ETA(4)
  E=EMAX*F/(C50+F)
  Y1=E+ERR(1)
  Y2=F+ERR(2)
  Q=1
  IF (TYPE.EQ.2) Q=0
  Y=Q*Y1+(1-Q)*Y2
  $THETA (0,.0027) (0,.70) .0018 .5 100 20
  $OMEGA .000007 .3 400 16
  $SIGMA BLOCK(2) 4 2.8 8
  $ESTIMATION

Note that the L2 data indicates which ERR random variable is used for the residual error of the data record. Specifically, L2=1 data record on line 2-4, thus the residual errors for these record have variance \(\Sigma_{11}=4\), as shown in the $SIGMA record; L2=2 for the rest data reocrds and the residual errors have variance \(\Sigma_{22}=8\). The two residual error random variables, ERR(1) and ERR(2), are correlated, with correlation coefficient \(\rho=2.8/\sqrt{4\times 8}=0.5\).