Missing-data handling
Audit unavailable measurements, distinguish re-extraction from imputation, and test how missing-data assumptions change the answer.
Start with the missing result, not the replacement
Missing-data handling is a sequence of decisions about unavailable measurements. This Guide starts after a feature table exists; use data analysis for the wider workflow. Decide whether the immediate goal is visualization, prediction, or estimating an abundance difference. A completed matrix convenient for a heatmap is not automatically suitable for a statistical test. All examples here are hypothetical.
Preserve the original table and a separate status mask. Distinguish a missing abundance, a rejected integration, an unacquired measurement, and a measured signal without an accepted identity. Check the export convention: zero may mean a measured number or a software placeholder. Do not convert every blank to zero, or every reported zero to missing, without checking its origin.
Build a missingness audit
Count observed values per feature and per independent sample, then separate those counts by condition, batch, and run order. Inspect whether failed samples have many unrelated gaps. Review selected source traces and controls, including borderline and well-measured cases, rather than only promising biological hits.
| Feature | C1 | C2 | C3 | T1 | T2 | T3 |
|---|---|---|---|---|---|---|
| P | 100 | 110 | 120 | 200 | 220 | 240 |
| Q | 100 | NA | 120 | 200 | 220 | 240 |
| R | 12 | 11 | 13 | NA | NA | NA |
Q is observed in 5/6 samples, but R is observed in 3/3 controls and 0/3 treated samples. One global completeness percentage hides that distinction. R could reflect a biological difference, a condition-linked failure, or a processing problem. Its pattern does not prove absence. A requirement for complete observations in both groups would remove R; retain an exclusion ledger so the resulting scope is visible.
Separate re-extraction from imputation
First ask whether the source signal can support a defensible measurement. In xcms, gap filling integrates acquired signal in a feature's m/z–retention-time region and flags filled peaks. This is signal re-extraction, not statistical prediction of a missing table entry. [1] Review boundaries, alignment, interference, and background; an integrated region can contain noise or the wrong peak. Re-extraction cannot recover an acquisition that never happened. Keep its provenance distinct from both original detection and imputation.
Use mechanism labels as assumptions
The missingness mechanism describes how the probability of a missingness pattern relates to the full data. Rubin's framework distinguishes what is observed from what remains unobserved. [2]
- MCAR, missing completely at random: missingness does not depend on observed or unobserved values in the modeled dataset.
- MAR, missing at random: conditional on the observed information, the pattern's probability does not additionally depend on unobserved values. Dependence on a recorded batch can be compatible with MAR.
- MNAR, missing not at random: dependence on unobserved values remains after conditioning on observed information. A tendency to lose weaker, unobserved signals is one plausible example.
These are not three shapes that a heatmap can diagnose. Associations with observed variables can challenge MCAR, but observed patterns alone generally cannot distinguish MAR from MNAR or establish either. Mechanisms can coexist, and the classification depends on which information is available. State the scientific and acquisition evidence supporting the assumption. The target quantity matters too; these labels do not prescribe one handling method. [3]
Calculate how replacement changes the answer
For Q, the observed control mean is (100 + 120) / 2 = 110; the treated mean is 220. The ratio of observed arithmetic means is 2. Consider two deliberately different replacement assumptions:
- Replace the missing control with 110: the completed control mean remains 110 and the ratio remains 2.
- Replace it with 20: the completed mean becomes
(100 + 20 + 120) / 3 = 80, so the ratio becomes220 / 80 = 2.75.
Zero replacement would instead give a control mean of approximately 73.3 and a ratio of 3. None recovers the unknown observation. Even unchanged means can hide altered variances and misleading certainty. These are arithmetic-mean ratios, not coefficients from a log-scale model. An observed-only calculation also needs assumptions; it is a comparator, not ground truth.
Choose an analysis that can represent uncertainty
- Analyze available measurements: use an appropriate model only where the design and remaining observations support estimation. Record per-feature sample counts; dropping incomplete cases can select a different population.
- Model censoring: if a justified reporting rule establishes that a value is below a known limit L, retain that bound. A continuous censoring likelihood uses the probability of being below L, rather than pretending L/2 was observed. Left-censored observations can be represented as intervals. [4] Generic missingness does not supply such a bound.
- Impute explicitly: choose a model consistent with the intended analysis, plausible missingness, and sample structure. Neighbors or latent factors need informative observed relationships. Single replacement does not propagate missing-value uncertainty; multiple imputation requires suitable models and combination rules, not merely repeated random fills. [5]
For R, fabricating three small treated values and running an ordinary test can manufacture both an effect and its apparent precision. Consider a justified censoring or detection model, or report the comparison as insufficiently quantified. Benchmark evidence supports comparing downstream conclusions with an unimputed alternative, rather than choosing the method that creates the most discoveries. [6]
Keep evaluation and reporting honest
For prediction, split at the independent biological unit before fitting preprocessing. Within each training fold, learn imputation, scaling, and feature selection; apply the fitted operations to its held-out fold without using held-out outcomes. Fitting a data-dependent imputation model on the full dataset before splitting can leak held-out information. [7] Inferential imputation may appropriately include study-design variables, but its uncertainty must enter inference.
Repeat key comparisons under plausible handling choices and report changed directions, effect sizes, intervals, and retained feature sets. Randomly masking observed entries tests reconstruction of those entries, not necessarily real missing signals. Preserve masks, exclusion rules, parameters, seeds, and processing order alongside outputs. These details make the analysis inspectable. [8]
Check your understanding
Does lower reconstruction error guarantee better differential-abundance testing?
No. Reconstruction and valid inference are different goals. Evaluate effects, uncertainty, and error behavior for the intended task.
Can an all-missing group be called zero abundance?
No. Investigate acquisition and processing evidence. A missing table entry supplies neither an exact zero nor a known censoring limit.
References & further reading
- xcms. Gap Filling: fillChromPeaks documentation.
Official documentation inspected 2026-10-07. Describes integration of acquired signal in a feature m/z–retention-time region, is_filled flags, and retained NA when no signal is present. Used to distinguish signal re-extraction from statistical imputation; no current defaults or universal parameter settings are prescribed.
- Rubin, D. B. (1976). Inference and missing data. Biometrika 63(3), 581–592.
Foundational missing-data mechanism and ignorability framework. Harvard institutional record and abstract verified; publisher direct access failed, and an accessible scanned paper did not expose extractable text. The precise observed/unobserved distinction is additionally checked against the fully inspected Lee et al. 2023 primary methodological paper; no claim that a table pattern diagnoses MAR or MNAR is made.
- Lee, Carlin, Simpson & Moreno-Betancur (2023). Assumptions and analysis planning in studies with missing data in multiple variables: moving beyond the MCAR/MAR/MNAR classification. International Journal of Epidemiology 52(4), 1268–1275.
Publisher full text inspected. Original methodological framework supports distinguishing missingness-pattern assumptions from a method-selection rule and conditioning on what is observed for a pattern. Applied only to general statistical reasoning; epidemiological case-study results are not transferred to mass spectrometry.
- R survival package. Surv: Create a Survival Object.
Official documentation inspected for interval representation of left-censored versus exact observations. The hard-threshold abundance example and its mean bounds are independently constructed and explicitly idealized; actual mass-spectrometric detection is not assumed deterministic.
- mice. Combine estimates by pooling rules: pool documentation.
Official documentation inspected, including separate imputation, model fitting, and estimate/standard-error pooling and the within/between-imputation variance rule. The associated van Buuren & Groothuis-Oudshoorn (2011) JSS paper metadata and abstract were also checked. Supports uncertainty propagation, not a recommendation that chained equations solve every proteomics missingness mechanism.
- Harris, Fondrie, Oh & Noble (2023). Evaluating Proteomics Imputation Methods with Improved Criteria. Journal of Proteome Research 22, 3427–3438.
Original benchmark across proteomics workflows. Supports experiment- and task-dependent imputation performance and the need for an unimputed comparator. Metadata/abstract and indexed primary PMC text (PMC10949645) verified; direct PMC access encountered a bot check. No method is recommended universally.
- scikit-learn. Common pitfalls and recommended practices: Data leakage.
Official documentation inspected 2026-10-07. Supports fitting transformations only on training data, including SimpleImputer and scaling, and using pipelines within cross-validation. Biological-unit splitting is a design-aware application rather than a claim about automatic software behavior.
- Goodacre et al. (2007). Proposed minimum reporting standards for data analysis in metabolomics. Metabolomics 3, 231–241.
MSI reporting recommendations. Publisher text supports recording design, acquisition scheduling, preprocessing, algorithms, validation splits, and blind testing. The batch-confounding example and modern audit checklist are explicitly pedagogical reasoning built on those principles.