Getting your dataset in the right format to work with NONMEM can be a terrible job. Getting all your observations, doses, dosing times, etc. from different Excel sheets collected in the clinic can take a lot of time. However, the worst thing is when you think you are finished creating your dataset and immediately get an error when you start your NONMEM run. Especially when you encounter an error message that is difficult to interpret. This post will not show how to build your NM dataset, there are already multiple examples on that, but will show you what kind of errors you may encounter and how to fix them.
Where to find the data errors?
First of all, the error messages can be found in the generated .lst file. If you use PsN, these can be found in the modelfit_dir1/NM_run1 folder, even if your run was unsuccessful, or in the main model folder.
The examples provided below are the error messages copied from these .lst files. Every example also contains a dataset that can be used to reproduce the error.
1. Non-numeric cells/columns in the dataset
All your cells in your NM dataset should be numbers. NONMEM can’t handle characters and will therefore throw an error when you try this. It can happen that your covariate is a character and you forgot to change it:
(DATA ERROR) RECORD 1, DATA ITEM 8, CONTENTS: MALE
ITEM IS NOT A NUMBER.
Our covariate column here contains the value “MALE”, which is not allowed.
Change your covariates to numeric, e.g. male/female can be changed to 0 and 1.
2. NA’s in the DV column
If you have missing observations, and you work in R, your observations will probably be converted to NA. This will give the same error as above since NA is read as a character in NONMEM.
(DATA ERROR) RECORD 21, DATA ITEM 5, CONTENTS: NA
ITEM IS NOT A NUMBER.
When saving your dataset in R, make sure you specify the na=”.”, which will convert all the NA to dots. The dots can be used in NONMEM. Furthermore, make sure that your MDV column equals 1 when an observation is missing.
I personally use the following settings to create my NONMEM dataset:
3. Time not sorted
The following error message will show up when the time column is not sorted. NONMEM needs incremental times per individual, meaning that NONMEM cannot go back in time.
0DATA REC 3: TIME DATA ITEM IS LESS THAN PREVIOUS TIME DATA ITEM
This may also happen when you have multiple occasions in your dataset, where both occasions start at time 0. This is not allowed. If you have data from 2 occasions, you can add a fixed time to the second occasion. For example, start occasion 2 at time point 168 hours. Then, the time column is still incremental within an individual and you can stratify between occasion 1 (time < 168) and occasion 2 (time > 168).
Sort your dataframe correctly, first on ID, then on time. This should fix the problem.
4. EVID is always 0
An EVID column specifies what kind of row we are dealing with, an observation? dosing? or something else? The numbers have specific meanings, of which EVID = 0 is for observations and EVID = 1 for dosing records. An explanation of the other EVID’s can be found in the NM manual.
When you get the following error:
0DATA REC 1: OBSERVATION EVENT RECORD MAY NOT SPECIFY DOSING INFORMATION
This means that you specified with EVID that the record should be treated as an observation, however, there is dosing information included. In this case the AMT was larger then 0 whereas EVID = 0).
Make sure that all observations have EVID = 0 and all dosing records have EVID = 1.
5. Use wrong IGNORE statement
The IGNORE statement in the $INPUT block of your NONMEM model should be used to specify which rows to ignore from your original dataset.
In my model code I specified the following:
$INPUT ID TIME AMT EVID DV CMT MDV
$DATA Dataset.IGNORE.csv IGNORE=I
Which resulted in the following error:
(DATA ERROR) RECORD 1, DATA ITEM 1, CONTENTS: SubjectNr
ITEM IS NOT A NUMBER.
This is because the column name of my ID column is actually SubjectNr in the dataset. Therefore, ignoring all rows starting with I would not ignore the first row containing the column headers.
IGNORE=@ can be used to ignore all rows starting with a character. In this case, IGNORE=S would also have removed the first row, since the row started with the word SubjectNr.
6. Switch $INPUT labels
Sometimes, the error may be completely different whereas the dataset seems to be correct. For example a combination of multiple error messages can occur:
0DATA REC 1: DOSE AMOUNT IS ZERO
0DATA REC 2: TIME DATA ITEM IS LESS THAN PREVIOUS TIME DATA ITEM
0DATA REC 2: OBSERVATION EVENT RECORD MAY NOT SPECIFY DOSING INFORMATION
This error was also previously encountered by others: https://www.pharmpk.com/PK11/PK2011112.html
Make sure your $INPUT is correct in your NONMEM model. If the order of your columns in the original dataset change, this will impact the way NONMEM reads your data. For example, your TIME column will suddenly be read as your DV column.
Another check to perform is that the units of the AMT column and your concentrations (DV) are the same. For example make sure that the dose is in mg and the concentration is in mg/L. This would result in your volume of distribution being estimated in liters. Else, this would result in strange estimates that can be hard to explain at a later stage (and would need you to repeat model development…).
Any suggestions on other encountered errors or typo’s? Leave a comment or contact me at firstname.lastname@example.org!