6.4 Subject identity, blocks and record order
nlmx forms a subject from a contiguous block of records with the same normalised ID. A repeated ID after another ID has begun is a new individual block, named internally with #2, #3 and so on, and produces a warning.
ID normalisation and blocks
Numeric spellings that represent the same integer are normalised for matching. Do not depend on cosmetic distinctions such as 001 versus 1. More importantly, sort records so every subject appears in one block. This mirrors the implemented NONMEM-style new-individual behavior and prevents a person from being analysed twice.
Subjects with no usable observations (EVID=0 and MDV=0) are removed after reading and listed. Dose-only subjects therefore do not contribute to the model likelihood represented by this dataset object.
Time order
Within a subject block, TIME must not decrease. A decrease is allowed only on an EVID=3 or EVID=4 reset record. Equal times are allowed, and row order resolves events at the same explicit time. Implied ADDL doses have a specific precedence described in Section 6.7.
TIME is a numeric independent variable. nlmx 4.3.0 refuses kept DATE/DAT1/DAT2/DAT3 data items rather than deriving elapsed time. Convert date-time data upstream with a recorded timezone, origin and daylight-saving policy.
Baseline values depend on order
For declared screening covariates, the baseline is the first non-missing value in the subject block. Stratification values are taken when the subject is created. Sorting and data cleaning can therefore change a baseline or stratum even when the set of rows is unchanged.
Record-level covariates retain one value per row and can vary. Later missing records are completed under the policy described in Section 6.10. A subject's record order is consequently part of the covariate definition.
Same-time records
Two explicit rows at one time are not automatically interchangeable. A dose before an observation can mean a post-dose sample; an observation before the dose can represent a trough. Preserve deliberate order and make it visible in QC outputs. For implied additional doses, an observation at exactly the implied dose time is evaluated after the dose in nlmx 4.3.0.
Assumptions and limits
The reader checks non-decreasing time, not that visit numbers, nominal times or occasion codes are clinically consistent. Those are QC questions for Chapter 11.
Common mistakes
- Letting one ID reappear in several blocks.
- Sorting only by time across the whole file rather than by ID and intended event order.
- Assuming equal-time rows are order-free.
- Changing row order without reassessing baseline covariates.
- Feeding calendar dates where numeric elapsed time is required.
Checklist
- Each subject occupies one contiguous block.
-
TIMEis non-decreasing except at a deliberate reset. - Equal-time dose and sample order is intentional.
- Baseline and stratification values remain correct after sorting.
- Calendar time conversion is documented.
Further reading
Section 6.7 covers reset and implied-dose ordering. Chapter 11 will document duplicate, gap, timing and subject-block checks in qc-data.