Chapter 6. The dataset: reading, events and covariates
A pharmacometric result is only as comparable as the records that entered it. Before discussing estimators or speed, this chapter fixes the meaning of a row: how nlmx maps columns, constructs subjects, recognises events, carries covariates, identifies censored observations and applies transformations.
What you will learn
- how delimited files and
$INPUTpositions become nlmx data items;- how IDs, times,
EVID,MDV,CMT, doses, infusions, resets and repeated doses are interpreted;- how baseline and time-varying covariates are stored, typed, centred and completed;
- how BLQ coding differs from the action an analysis takes;
- how filters and ordered mutate expressions change the analysis population;
- how to record dataset provenance and test large inputs without overstating a performance limit.
Prerequisites. Read Section 4.6 for the book's unit conventions and Chapter 5 for the relationship between
$INPUT,$DATAand the control stream.
Scope and evidence
This chapter describes nlmx 4.3.0. Claims were checked against the dataset readers, the filtering and mutation expression engine, NCA BLQ rules and VPC censoring path. Reproducible fixtures are in documents/ch06; commands and captured output are in documents/ch06/results; pytools/ch06_examples.py regenerates the evidence.
The examples are deliberately small enough to inspect. They test nlmx behavior, not equivalence to every NONMEM dataset feature. Event execution itself is expanded in Chapter 8, command-specific data checks in Chapters 11–15, and formal cross-software validation in Chapter 42.
Seventeen pages in this chapter
The six broad sections in DOCUMENTATION.md are divided into 17 Markdown pages for precise linking:
| Page | Topic | Planned-outline section |
|---|---|---|
| 6.1 | Delimiters, headers and quoting | 6.1 Dataset formats |
| 6.2 | $INPUT mapping, aliases, DROP and extra columns |
6.1 |
| 6.3 | Numeric values, missing tokens and line errors | 6.1 |
| 6.4 | Subject identity, blocks and record order | 6.1/6.2 |
| 6.5 | EVID, MDV and CMT |
6.2 Event records |
| 6.6 | Bolus, infusion, RATE and dose compartment |
6.2 |
| 6.7 | ADDL, II, SS and resets |
6.2 |
| 6.8 | Baseline and time-varying covariates | 6.2/6.3 |
| 6.9 | Type detection, levels and centring | 6.3 Covariates |
| 6.10 | Missing-covariate policies and carry-forward | 6.3 |
| 6.11 | BLQ coding and limits | 6.4 BLQ |
| 6.12 | BLQ behavior by command | 6.4 |
| 6.13 | Row and observation filters | 6.5 Filters |
| 6.14 | Derived columns with mutate | 6.5 |
| 6.15 | Dataset limits, memory and performance | 6.6 Limits |
| 6.16 | Worked examples and reproducibility | X6.1/X6.2 |
The outline's 24-page budget remains a production target for a rendered book; the number above is the count of Markdown pages.
The governing principle
For every analysis, be able to answer four questions from retained artifacts:
- Which physical rows were read?
- What names and numeric values did the model see?
- Which rows became observations, doses or other events?
- Which transformations, filters, censoring rules or imputations changed them?
When two programs disagree, compare these answers before comparing objective functions.