6.8 Baseline and time-varying covariates
A declared screening covariate has two representations: one baseline value per subject and one value per record. This permits the frozen-model engine to use time-varying information while subject-level methods can use an explicitly documented summary.
Baseline definition
The baseline is the first non-missing value in the subject block. It is not necessarily the value at TIME 0, the first observation, or the most frequent value. Data order therefore affects baseline.
nlmx marks a covariate as time-varying if finite within-subject values change beyond a small numerical tolerance. The Chapter 6 fixture changes CRCL after 18 hours. inspect reports:
time-varying screening covariate(s): CRCL
(the frozen engine uses record-level values; the posterior engine uses a per-subject summary)
The exact posterior summary belongs to the posterior-engine chapter and settings; do not assume it is the current record value.
Carrying values on events and observations
Model code sees the value written on each row. A dose row, other event and observation may all execute $PK, so a time-varying covariate must be correct wherever the model can use it. For screening storage, missing record-level values are completed by the covariate policy described in Section 6.10. That completion does not retroactively change the general model record's zero representation.
When a covariate changes between sparse observations, the dataset defines a step function only through the rows that carry the values. Add an event row at the change time if the model parameter must change then. Otherwise the change becomes visible at the next existing record.
Per-record versus subject-level questions
These are different scientific questions:
- Does current CRCL explain current clearance?
- Does baseline CRCL explain between-subject clearance differences?
- Does change from baseline predict an intra-subject parameter change?
A single covariate name does not distinguish them. Create explicit columns such as CRCL_BASE and CRCL_CHANGE when needed, and state how they were derived.
Assumptions and limits
Type inference and default centring use subject baseline values. They do not infer causal timing or protect against a covariate measured after the outcome.
Common mistakes
- Calling the first row's value “baseline” when it is missing.
- Updating a covariate only on observation rows when
$PKalso runs at doses. - Assuming a change applies before a row that records it.
- Mixing baseline and current-value interpretations under one name.
- Comparing engines without checking how each summarises time-varying values.
Checklist
- Baseline is verified from the first non-missing value.
- Change times have explicit records when required.
- Dose and event rows carry appropriate model values.
- Baseline, current and change-from-baseline columns are distinct.
- Engine-specific use of time variation is documented.
Further reading
Section 6.9 covers type and reference selection. Chapter 23 and Chapter 24 will define the frozen and posterior uses precisely.