Machine learning · 5 compared
Missing-data methods
Dropping rows and filling gaps are both decisions about the answer. Which one is safe depends on why the values are missing, and on which number you report.
Comparison
| Name What it does | Under MAR | Spread and relationships | Uncertainty |
|---|---|---|---|
| Complete case Drop every row with a gap. Costs only sample size when the gaps are random; otherwise it changes who is left. Full page → | mean wrong, slope right | kept | honest, on fewer rows |
| Mean imputation Fill each gap with its column's average. Puts a spike at the centre and weakens every relationship the column is in. Full page → | mean wrong, slope shrunk | shrunk | understated |
| Regression imputation Predict each gap from the other columns. Recovers what those columns explain, and puts every filled point on the line. Full page → | mean and slope recovered | relationships overstated | understated |
| Regression + residuals The same prediction, plus a residual drawn from the observed rows, so the filled points scatter like real ones. Full page → | mean and slope recovered | kept | understated |
| Multiple imputation Impute several times with different random draws and combine, so the analysis sees how unsure the filled values are. Full page → | as its imputer allows | kept | carried through |
On the cheat sheet: Missing data and outliers →
Drop or fill
Dropping incomplete rows "comes at the price of losing data which may be valuable (even though incomplete)"; the alternative is to impute, "to infer them from the known part of the data" [1, §8.4]. Neither can invent what was never recorded, and both change the answer when the gaps are not random.
Why the values are missing decides the row
Missing completely at random, every row here is safe for the mean. Missing because of another column you have, a model of that column recovers the answer. Missing because of the value itself, no row recovers it: the information left with the deleted values. The missing data page measures all three.
Reading the rows
Filled values look like observed ones. Filling a series with a smooth estimate "understates the noise in the series", and the remedy is "adding in resampled residuals" [2, §12.5]: the difference between the third and fourth rows.
A single imputation understates uncertainty. scikit-learn's iterative imputer
returns a single imputation, and "can also be used for multiple imputations by
applying it repeatedly to the same dataset with different random seeds when
sample_posterior=True" [1, §8.4.3.2].
Keep the gaps visible. "When using imputation, preserving the information about which values had been missing can be informative" [1, §8.4.6]: add the indicator column whichever row you choose.
Sources
- scikit-learn User Guide — Imputation of missing valuesdocs · retrieved 2026-10-24https://scikit-learn.org/stable/modules/impute.html
- Think Statsbook · retrieved 2026-10-24https://greenteapress.com/thinkstats2/html/thinkstats2013.html