Documentation

6.10 Missing-covariate policies and carry-forward

Missing covariates are handled before either covariate-selection engine runs, so both engines receive the same subject set and baseline values. The policy applies only to covariates used by at least one non-excluded relationship.

Missing values and codes

Empty, ., NA and NAN are missing. missing_codes can add numeric or textual spellings such as -99. A declared code is evaluated for the covariate without changing unrelated columns.

Three policies

Policy Subject-level action Audit consequence
error stop when any analysed subject lacks a baseline value safest default; forces an explicit decision
drop_subject remove subjects missing that covariate warning, counts by covariate; --strict promotes it to failure
median continuous: median; categorical/ordinal: most frequent level warning and imputation count

Dropping occurs before range/type checks so later work uses the final population. If no subject remains, analysis fails. The name median is retained for the policy even though categorical values receive the mode.

Value validation

Observed continuous values can be constrained by positive=true and a declared range. Values outside those constraints stop the analysis and prompt a unit/missing-code check. Categorical and ordinal values must belong to declared levels.

These checks matter because an undeclared sentinel such as -99 can otherwise alter the median, make a power form invalid or create a spurious category.

Record-level completion

After baseline policy, nlmx fills missing record-level screening values in order. It begins with the subject's baseline; each finite record updates the last value; a missing record receives the last value. This is last-observation carried forward with baseline backfill before the first observed record-level value.

This completion is for the screening covariate representation. The general model record was already built with missing numeric items as zero. If $PK directly uses a time-varying covariate, write or mutate the intended value on every relevant row rather than assuming screening carry-forward changes model input.

Sensitivity analyses

Median imputation is fast and deterministic but understates uncertainty if treated as observed truth. Dropping can change the estimand and covariate distribution. At minimum, report missing counts and compare the retained/imputed population with the original. More advanced imputation belongs upstream or in a validated multiple-imputation workflow.

Common mistakes

  • Forgetting to declare -99 or another sentinel.
  • Believing categorical median computes a numerical median.
  • Assuming carry-forward modifies $PK's raw record values.
  • Reporting only the final N without per-covariate drop counts.
  • Treating deterministic imputation as uncertainty propagation.

Checklist

  • All missing spellings and sentinel codes are declared.
  • Each used covariate has an explicit policy.
  • Positive/range/level constraints are validated.
  • Drop and imputation counts are retained.
  • Model-record values are complete independently of screening carry-forward.

Further reading

Section 6.8 distinguishes baseline and record values. Chapter 22 will discuss estimand and bias consequences of missing covariates.