Documentation

4.6 Units, time and missing values

Pharmacokinetic numbers have units, and a program that computes with them can handle them in three ways: it can ignore them, it can use them as labels, or it can convert. nlmx does all three, in different places, and the places matter. This section says which is which, how time is treated, how missing values and values below the limit of quantification are handled, and the conventions that are shared by the commands.

4.6.1 The principle: nlmx computes in the units of your data

nlmx does not know what unit your data are in, unless you tell it; and in most commands, telling it only changes labels. A dataset with the dose in mg and the concentration in mg/L gives a clearance in L/h if the time is in hours, because that is what the numbers say: a dose of 100 divided by an AUC of 25 is 4. Nothing in the dataset says "mg", and nothing has to. The units the program prints are the ones you declared; the numbers are those of the data.

The consequence is the rule of this section:

Choose the units of the dataset once, consistently, before the analysis. The program will not convert them for you, except where this section says it does.

A dataset with the dose in mg and the concentration in ng/mL gives a clearance that is 1,000 times too small in L/h; the program has no way of knowing, and the model fits fine. This is the most frequent unit error in practice, and the reason to check the numbers against what is known (a clearance of 3 L/h for a drug of the size you know, not 0.003).

4.6.2 Where units are labels, factors or conversions

The unit options of the commands:

Command Options What they do
eda --conc-unit, --dose-unit, --time-unit labels for axes and tables; nothing is converted
nca [units] in the settings file; --dose-factor the names of the units, printed on the tables; --dose-factor (or dose_factor) is a factor applied to the dose in clearance and volume, for example 1000 for a dose in mg and a concentration in ng/mL
autoinit --dose-unit, --conc-unit, --scale together they set the scale of the initial estimates, so that volumes come out in L; --scale takes an expression for a scale of your own
fit, vpc, sims, power, cov, forest none the units of the control stream and the dataset, as they are (the $PK code defines the scale of the model, S2 = V for example)

Two of the entries deserve an example from the tour. In nca, the units are set in the settings file, not by an option (Section 3.3): nlmx nca --print-config nlmx.nca, then conc = "mg/L" under [units]. nca takes its unit labels from the settings file only: given --conc-unit mg/L on the command line, it raised no error and the tables stayed labelled with the default, ng/mL. Check the unit that the header of the output says (units dose mg · time h · concentration mg/L), in the console and in the report.

For the model commands the scale is part of the model: in a control stream with S2 = V, the predicted concentration is A(2)/V, in dose unit per volume unit of V. If the dose is in mg and V in L, the concentration is in mg/L, and the dataset must say the observations in mg/L.

4.6.3 Time

Time is a number, in the units of the dataset's TIME column, and every rate and every duration is in the same unit. The default time unit in labels is hours (--time-unit h), and every example of this book uses hours: a clearance in L/h, a rate constant in 1/h, an interdose interval II = 24.

  • TIME is the time since the start of the individual's record, not a clock time. A column that holds dates and times of day ("2026-03-14 09:30") has to be converted to elapsed time before the analysis: TIME is read as a number, and qc-data reports a TIME that is not numeric (check VAL01).
  • ADDL and II give additional doses at the interval II, in the time unit of TIME (the demo dataset: ADDL 4, II 24, five doses a day apart).
  • Time after dose (TAD) is computed by the commands that need it (nca, vpc) from the dosing records. If your dataset has a TAD column, name it with --tad-col and qc-data will check it against the doses (check TIM07).
  • Sampling at an odd time. The demo dataset samples at 23.9 h and 96.5 h: actual times, not nominal ones. The commands use the times in TIME. A nominal-time column (--nominal-time-col) can be named for the quality check, which compares the two (TIM08); vpc bins the values (--bins, --idv), which is what makes irregular sampling analysable.

4.6.4 Missing values

The conventions are those of NONMEM, with a stricter eye.

  • A missing value is a blank or a dot (.). The check VAL03 of qc-data asks whether missing values are written that way and not as NA, NaN, NULL, N/A or -, which NM-TRAN would read as a text; and VAL06 looks for the numbers that stand for "missing" by convention (-99, -999).
  • A missing DV on an observation record is a fault, not a missing value to be skipped: check REC04 asks that every observation record has a DV. An observation that you want to keep in the file but leave out of the analysis is marked with MDV = 1 (REC05 lists them).
  • A missing covariate is a decision, and the program asks you to make it. --missing-covariates error (the default) stops the covariate analysis; median replaces the value with the median of the covariate; drop_subject removes the subject. Whichever you choose is in the settings echo and the log. In the demo dataset no covariate is missing (eda_T09_missing.csv).
  • An individual without observations is dropped from an estimation, and the dataset line of the log says how many ("0 without observations dropped").

4.6.5 Values below the limit of quantification (BLQ)

A concentration below the lower limit of quantification (LLOQ) is not a measured zero. The commands share three ways of telling the program about it, and each command has the treatment it needs.

  • Telling it where the limit is. --lloq VALUE (for vpc, autoinit and screen, and, for vpc, a data column), or --blq-flag COLUMN, a column that is non-zero for a record below the limit. The demo dataset has neither, and qc-data says so in its not-applicable checks (OBS04, OBS05).

  • What to do with it. The treatment depends on what is computed.

    Command Option Choices
    nca --blq-rule zero, missing, lloq, half-lloq, tmax-zero-missing (the default), first-zero-mid-half-last-missing
    sims --blq-action none (default), flag, set-lloq, drop
    power --blq-action drop (default), half, set-lloq
    vpc --lloq, --blq-flag values below the limit are reported as below LLOQ in the percentiles and left out of the NPC
    autoinit, screen --lloq values below it are censored or left out

    The NCA default, tmax-zero-missing, sets BLQ values before the time of the peak to zero and those after it to missing. It is a convention, and the report states the one used (in the nca header of Section 3.3: BLQ tmax-zero-missing).

  • In the model. Censored observations in a fit are handled by what the control stream codes (the M3 method with F_FLAG is among the residual-error forms nlmx interprets, Section 1.4). A dataset with many values below the limit needs a decision of the modeller that no default replaces.

4.6.6 A short checklist of units and conventions before an analysis

  1. Dose, concentration and time units are written in the analysis plan, and the dataset is in them.
  2. The unit labels of each command's settings match the dataset (the header of the output repeats them).
  3. Missing values are blank or .; NA is not used.
  4. TIME is elapsed time; actual times are used unless a nominal column is needed.
  5. The BLQ policy is chosen once, written down, and given to every command that needs it.

Common mistakes

  • Mixing mg and ng/mL. The clearance is off by 1,000; nothing complains. Check one clearance against what you know.
  • Trusting a unit label. A label is what you typed; the number is what the data say.
  • Calendar dates as TIME. Convert to elapsed hours first.
  • A BLQ policy that differs between the NCA and the VPC. Each command's table above shows its own option; state them together.

Checklist

  • The units are consistent in the dataset and recorded in the plan.
  • Every command that prints units shows the ones you intended.
  • Missing values and BLQ are handled by a stated rule in every command that meets them.

Further reading

Chapter 6 (the dataset), Chapters 11 (the checks mentioned here) and 15 (the NCA units and BLQ rules), Chapter 27 (BLQ in the VPC).