Documentation

22.19 Missing covariates and missing-value codes

The default --missing-covariates error stops when a scoped covariate is missing. This is intentionally conservative: missingness can change the analysis population and bias effects.

median imputes the continuous median or most frequent categorical level. It preserves subjects but treats missing values as typical, attenuates variation, and understates imputation uncertainty. drop_subject removes the entire subject, producing a complete-case population that may differ systematically.

Missingness policies have different consequences

Configuration can assign policies per covariate and declare missing_codes such as −99; . is recognized as missing. Convert and document source conventions before type/range detection. A negative sentinel left as data can corrupt medians, disable power forms, and create false effects.

Assess missingness by study, site, endpoint, covariate level, outcome, and subject characteristics. Report counts before and after policy. Compare reasonable policies when conclusions are sensitive. More advanced multiple-imputation workflows require propagation across complete covariate analyses; single median imputation is not equivalent.

Time-varying covariates need record-level missingness rules and temporal plausibility. Carry-forward or interpolation is a data-preparation decision, not automatically performed by a selection command.

Missingness is part of the estimand

Before choosing a policy, tabulate missingness by subject, study, treatment, visit, outcome availability, and other influential covariates. Median imputation keeps subjects but treats the imputed value as known and can attenuate relationships. Dropping subjects changes the analyzed population and may remove the sickest or least observed participants. An error policy is often safest during development because it forces an explicit decision. Numeric sentinels such as -99 must be declared before type detection and summary statistics. For time-varying covariates, distinguish an absent measurement from a value legitimately carried forward. Report counts and reasons, then repeat key conclusions under plausible alternative policies.

Common mistakes

  • Allowing sentinel codes into type detection.
  • Treating median imputation as uncertainty-free.
  • Dropping records rather than subjects inconsistently.
  • Reporting only the post-policy sample size.
  • Ignoring informative missingness by study or outcome.

Checklist

  • Inventory missing values and codes before selection.
  • Choose policy by covariate and scientific context.
  • Reconcile subjects/rows after handling.
  • Run sensitivity analyses when material.
  • Document limitations and imputation uncertainty.

Further reading

See automatic type detection, time-varying covariates, and Chapter 6 data handling.