Introduction

NONMEM (NONlinear Mixed Effects Model) is software for fitting nonlinear regression models using the mixed-effects framework. It is commonly used in pharmacokinetic and pharmacodynamic studies, in which after drug administration its plasma concentrations is measured over time among the subjects. NONMEM takes account of the variability between subjects (random effects) and within the subjects, as well as the influence of measured covariates (fixed effects), while incorporating the nonlinear nature of the biochemical and physiological processes. It can handle situations such as each subject has only a few measurements, and when sampling times differ between subjects. The underlying method of NONMEM is general and can be applied to many problems beyond pharmacometrics.

Data records

In NONMEM, each observation is stored on its own data record. This is called an observation record. The observed value is stored in the DV (dependent variable) field on that record. NONMEM also supports records that are not observations. These are called nonobservation records. They use the MDV (Missing Dependent Variable) field. If MDV = 1, the record is not an observation. In other words, the dependent variable is considered missing for that record.

NONMEM is mainly concerned with time ordered events: dose events, observation events, and other events such as the beginning of a urine collection and a measured change in kidney function. It expects that there will be different data records, ordered in time, associated with each of the different events.

In the case of population data, records are also organized into individual records, a group of contiguous data records associated with the same individual and having the same identification (ID) data item. In this case the time ordering refers to data records within an individual record. In the case of data from a single subject, individual records do not correspond on a one-to-one basis to either animal or human subjects, but simply groups of contiguous data records containing only one observation record and having the same ID data item. (Although, the presence of a multivariate observation means the individual record containing it has several observation records, each containing one element of the observation.)

A typical NONMEM data set looks like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 ID      TIME    C1      C2  ...  CN      DV     MDV
  1       1.     .5      10        5              1
  1       3.              9       10              1
  1       6.              6              4.1      0
  1       7.              7       10              1
  1      10.              7              5.3      0
  2       2.     .9       8        8              1
  2       2.5             6                       1
  2       6.              7                       1
  2       7.              8              6.4      0

It contains two individuals' records, with the following data items.

  • ID: subject identification;
  • TIME: time data;
  • C1, C2, …, CN: concomitant variable data items such as covariates.
  • DV: dependent value;
  • MDV: missing dependent value;

Note that blank data items are treated as nulls in NONMEM. They are read as zeros and appear as zeros in tables and scatterplots.

We discuss event record in detail in Chapter 5.

Example

Below is a simple NONMEM model's control stream.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
  $PROBLEM PHENOBARB ;# simple example
  $INPUT   ID TIME AMT DV
  $DATA    PHENO
  $SUBROUTINE ADVAN1
  $PK
     TVCL=THETA(1)
     CL=TVCL+ETA(1)
     TVVD=THETA(2)
     V=TVVD+ETA(2)
     K=CL/V
     S1=V
  $ERROR
     Y=F+ERR(1)
  $THETA  (0,.0047) (0,.99)
  $OMEGA  .0000055, .04
  $SIGMA  25
  $ESTIMATION  PRINT=5
  $TABLE     ID TIME AMT
  $COVARIANCE
  • NONMEM models consist of control records. Each control record starts with a "$" symbol followed by a reserved name. Control record ~$PROB~ on line 1 specifies string "PHENOBARB" as problem's name. The rest of the line is ignored as ";" indicates comments.
  • Line 2 says that the data file column 1-4 contain subject ID, observation time (TIME), dosing amount (AMT), and dependent value (DV), respectively.
  • Line 3 says the data is contained in file "PHENO".
  • Line 4 says we use a built-in one-compartment model called ADVAN1. Later in this document you will see that this specifies the one-compartment model without first-order absorption.
  • Line 5-11: the $PK record specifies the parameters of the ADVAN1 model. In this case, there is only one parameter: the elimination rate constatnt K. It is shown that K is calulated from Clearance CL and Volume of Distribution V. Some reserved NONMEM parameters (THETA and ETA) are used to obtain CL and V. There is also a scale parameter S1 based on V.
  • Line 12-13 says that we model observation Y as the sum of the prediction F (from the one-compartment model) and an error term ERR(1).
  • Line 14-16 give initial estimate of the parameters THETA, OMEGA, and SIGMA.
  • Line 17-19 request NONMEM to fit the model (ESTIMATE the model parameters), print some variables in a TABLE, and calculate the COVARANCE of the estimation.

As we go through this guide we will provide details of each record and symbol in the above model.

Notations

In this document we use the following notations to describe functions, arguments, and options.

  • Any or all arguments in [ ] are optional, e.g. [foo bar], and equivalently [foo] [bar], means foo and bar are both optional.
  • Options delimited by | cannot be used together, e.g. option=a|b means one must choose to specify option=a or option=b.
  • ... indicates reaptable arguments, e.g. filename ... means one can supply multiple files, and [label|value]... means label1 value2 value3 label4 is allowed.
  • A keyword with "(NONMEM version)" appended indicates the record/option as introduced in that version. For example "$DEFAULT (NM74)" means the record was introduced in NONMEM v7.4.
  • Starting in v7.2 NONMEM is no longer case-sensitive to reserved keywords, reserved variables, or user-defined variables.