Contents/ Part XXXIII · Capstone Projects: Specialized Methods/ Chapter 202

Missing Data: What Dropping Rows Costs You

Capstone 39. Half of a 1,400-person health survey has a gap somewhere, and more than half of those gaps are not blank at all. Four ways of handling it are scored against the values that were actually removed, and the most sensible-looking method gets the right answer three times in 150.

⏱️ ~25 min read
🎯 MCAR, MAR, MNAR, multiple imputation
📊 Chapter 202
The brief
Setting
A county health department's community needs assessment. Fourteen hundred adults interviewed at clinics, with gaps in three columns that got there three different ways.
The question
How much higher is blood pressure per unit of BMI, and what is mean household income in the county? The first sizes an intervention. The second decides whether the county applies for a state grant.
Why it matters
Complete-case analysis would discard 717 of the 1,400 respondents. Whether that is harmless, costly or actively misleading depends on why each value is absent, and that is not a question about the size of the gap.
What we do
Find the gaps that are not blank, name the three mechanisms, score four methods against the values that were removed, repeat the whole study 150 times to measure how often each is right, and then handle the question that no method can answer.

This is a teaching dataset, so the removed values are on a Truth sheet and every method can be scored rather than argued about. Real work never has that sheet, which is exactly what makes the last section the important one.

1

Half the Study Has a Gap

Counting blank cells says 29.6 percent of respondents are missing something. The true figure is 51.2 percent, and everything in between is a gap wearing a disguise.

ColumnHow the gap was recordedWhat a tool does with it
bmiBlank, or the text not measuredThe text makes the whole column non-numeric, and the blank count comes out wrong
activity_min_wkCoded -1Averages it. Minus one minute of exercise a week is a perfectly good number
income_kCoded 999, or blankAverages it. A household on 999 thousand dollars pulls the mean a long way

The sentinels are the dangerous ones. A blank announces itself; every tool in the language has a function for counting blanks. A -1 does not weaken the activity variable, it corrupts it, and nothing will warn you, because as far as the arithmetic is concerned it is data.

Gaps visible as blanks
29.6%
of respondents
Gaps once sentinels are found
51.2%
of respondents
Complete cases left
683
of 1,400
Four panels. Top left: a missingness map with every respondent as a column and three rows for bmi, activity and income, sorted into blocks by pattern. Top right: a horizontal bar chart of which columns go missing together, with 683 respondents missing nothing, about 310 missing bmi alone, and smaller bars for combinations. Bottom left: two overlaid histograms of systolic blood pressure, showing that respondents whose bmi is missing sit about 11 mm Hg to the right of those whose bmi was recorded. Bottom right: two overlaid histograms of household income, showing the people who declined earn roughly twice what the people who answered earn.
Top left: the gaps are not scattered evenly. Top right: which columns go missing together, with the complete cases as the largest bar. Bottom left: whether BMI was recorded depends on the blood pressure reading, which is the condition under which dropping rows stops being safe. Bottom right: the same picture for income, drawn from the Truth sheet, which is the only reason it can be drawn at all.
2

Three Ways to Go Missing

The vocabulary decides what is possible, which is why it is worth being exact about.

MechanismIn this surveyCan it be fixed from the data?
Missing completely at randomThe tablet failed to record activity for 14.4 percent of interviewsYes. Those people look like everyone else, so dropping them costs precision and nothing else
Missing at randomBMI is missing where blood pressure was high and the respondent was olderYes, but not by dropping rows. The information that predicts the gap is in the file
Missing not at randomPeople declined to give income because of what their income wasNo. Nothing in the file distinguishes a refuser earning 200 from one earning 40

The middle name is a bad one. Nothing about missing at random is random. What it means is that the reason for the gap was recorded, somewhere, in a column you still have.

And you cannot test which one you have. Missing at random and missing not at random make identical predictions about the data you can see. The distinction is decidable here only because of a sheet that does not exist outside a textbook.

3

Four Methods, Scored Against the Truth

Each method estimates the same quantity: the adjusted association between BMI and systolic blood pressure. The complete data says 0.980 mm Hg per BMI unit, which is the answer the survey would have produced had nobody skipped anything.

MethodEstimateStandard error
Complete data (Truth sheet)0.9800.055the target
Complete-case, drop the row0.8740.077low, and it used 683 people
Mean imputation0.8950.072low
Single regression imputation1.3240.063high, and the most confident of the four
Multiple imputation, m = 200.9540.066closest

Single regression imputation predicts each missing BMI from the other columns, including blood pressure, and then treats the prediction as a measurement. The imputed values agree with blood pressure perfectly, because they were built out of it, and the regression duly reports a stronger relationship than exists. It is also the narrowest interval of any method that used all 1,400 rows.

But one dataset is one draw, and three of these four intervals happen to contain the right answer. Judging a missing-data method by running it once is not possible.

4

Running the Whole Study 150 Times

The question that matters is not what a method returns once. It is how often its 95 percent interval contains the truth, which should be 95 percent of the time.

Single regression imputation
2.7%
four intervals out of 150
Mean imputation
78.0%
biased down 0.086
Multiple imputation
88.7%
biased down 0.018
Two panels. Left: the mean estimate from each of five methods over 150 runs with error bars, against a dashed line at the true value of 0.90. Complete data sits on the line, complete-case and mean imputation sit slightly below it, multiple imputation sits just below, and single regression imputation sits far above at 1.23. Right: a bar chart of how often each method's 95 percent interval contained the truth: complete data 96 percent, complete-case 83, mean imputation 78, single regression 3, multiple imputation 89, against a dashed line at the nominal 95 percent.
Left: where each method centers. The single-regression cloud barely overlaps the truth at all. Right: how often the interval was right. A method can be confidently and repeatably wrong, and nothing in its own output will say so.

Single regression imputation is biased by 0.330, more than a third of the quantity being estimated, and its intervals are narrow enough that they miss almost every time. The most natural of the four fixes is the only catastrophic one, and on any single dataset it looks like the most precise.

Complete-case analysis is not neutral either. It cannot be, because whether a row survives depends on the outcome being modeled. Multiple imputation is much the best of the four and still short of 95 percent, because one column is missing not at random and no imputation model can repair that.

5

What Multiple Imputation Actually Does

The difference between the method that fails at 2.7 percent and the method that works is one word: noise. Both predict a missing BMI from the other columns. One writes the prediction down. The other draws from the distribution around it, twenty times, and carries the disagreement between those twenty answers into the standard error.

Filling a gap with one number claims the value is known. Filling it with twenty different numbers records that it is not, and the spread across draws here is 3.57 BMI units against an observed spread of 4.56.

The fraction of missing information says what the gaps cost in precision on this particular question: 25.4 percent. The 683 complete cases were worth about three quarters of a complete 1,400-person survey, which is a far better outcome than discarding the other 717 to find out.

6

The Question Nothing Can Fix

The second question is mean household income, and a state grant is available where that mean is below 65 thousand dollars.

MethodMean household incomeDoes the county apply?
Complete-case59.40kyes
Mean imputation59.40kyes
Multiple imputation, m = 2059.42kyes
The Truth sheet68.16kno, it does not qualify

Multiple imputation gave 59.42 against a complete-case 59.40. It did not help, and it was never going to. Every imputation model in the chapter assumes the data can explain the gaps. Here the gap is explained by income, and the file does not contain it.

Agreement between methods is not evidence. They agree because they share an assumption, and the assumption is wrong.

7

A Tipping Point Instead of an Estimate

What can be done is to state the size of the assumption the answer depends on. Suppose every refuser earns some amount more than the model predicts for them, and vary that amount.

Two panels. Left: estimated mean income rising linearly as the assumed shortfall of a non-responder rises from zero to ninety thousand, crossing the sixty-five thousand grant threshold at thirty-five thousand, with the region below the threshold shaded green and above it red. Right: a bar chart of mean income under complete-case, mean imputation and multiple imputation, all near 59.4 thousand and all below the threshold, against the truth at 68.2 thousand which is above it.
Left: the estimate as a function of an assumption that cannot be checked. Right: the three feasible methods and the truth. The bar that matters is the gap between the first three and the fourth.

The conclusion survives only while refusers earn less than 35 thousand more than the model predicts for them. Ask whether that is plausible and the answer is not difficult: people who decline to state their income on a government survey are not, as a rule, the ones earning below average. The Truth sheet puts the real figure near 52 thousand, half again past the tipping point.

That number, and not 59.4, is the honest deliverable. The recommendation that follows is to go and get the data: a follow-up on a random sample of even a hundred refusers would settle a question no amount of modeling can.

8

What This Does Not Settle

The 150-run study is specific to this population. These missingness rates, this estimand and this imputation model. The ordering of methods can change when any of them change. What does not change is that imputing without noise invents precision.

The missing-at-random assumption behind the BMI answer is itself untestable. It is supported here by the Truth sheet and by nothing else, and outside a textbook it is an argument about how the data was collected rather than a result.

Multiple imputation reached 88.7 percent, not 95. The income column contaminates the regression too, mildly. Reporting it as the method that works is accurate only in comparison with the others.

Every method here assumes its model of the missing values is roughly right. A badly specified imputation model fails in ways this comparison would not detect, because every arm of it used the same specification.

9

What to Watch

10

Missing Data in Data Science & AI

Most machine-learning pipelines handle missingness by whichever method is one line long, and the default is usually the mean. That choice is rarely revisited, and it is made in the part of the code nobody reviews.

Where it appearsThe usual defaultWhat it assumes
A scikit-learn pipelineSimpleImputer with the meanMissing completely at random, and that shrinking the variance is free
Gradient boostingLearned default directions for missing valuesThat the pattern of missingness is a legitimate predictor, which it often is and sometimes must not be
Feature storesBackfill, or a sentinel like -1That downstream consumers know it is a sentinel
Survey and panel researchMultiple imputation with Rubin's rulesMissing at random, stated and defended rather than assumed
Clinical trialsSensitivity analysis over departures from MARNothing. That is the point of it

A missingness indicator is worth its own thought. Whether a value was recorded is sometimes the most predictive feature available, and a model that uses it can be both accurate and unusable, because it has learned who gets tested rather than who is ill. The next chapter has a version of the same problem, and the one after that is entirely about it.

Where the methods came from

Donald Rubin gave the three mechanisms their names in 1976 and set out multiple imputation in 1987, including the rules for combining estimates across imputed datasets that the notebook uses. Roderick Little and Rubin's Statistical Analysis with Missing Data remains the standard reference. Stef van Buuren's chained-equations approach, MICE, is what made it practical for datasets with many columns of different types and is the algorithm behind both implementations used here. The delta-adjustment sensitivity analysis in Section 7 follows the approach the pharmaceutical regulators now expect for clinical trials, where the untestable assumption has to be stressed rather than stated.

🐍

The full project, step by step

The companion notebook finds the three sentinel codes, maps which columns go missing together, implements four methods and scores each against the Truth sheet, repeats the entire study 150 times to measure bias and interval coverage, shows what multiple imputation is doing by printing the same missing value imputed five different ways, and finishes with the delta-adjustment tipping point.

📓 View Notebook (code & outputs) ▶ Open in Colab ⬇ View / Download on GitHub
Read the reports & get the data

The dataset (capstone-missing-data-imputation.xlsx) holds 1,400 respondents with the sentinel codes and duplicate rows still in place, plus a Truth sheet carrying the values that were removed so every method can be scored. Two written reports accompany it: a plain-language brief for the county health director, and a technical report covering the mechanisms, the simulation study and the sensitivity analysis.

🎓 Key Takeaways

  • More than half the gaps were not blank. Counting blanks found 29.6 percent of rows affected; the true figure was 51.2 percent, and the difference was sentinel codes that any tool would have analyzed as data.
  • What predicts the gap matters more than how big it is. Activity was missing completely at random and cost only precision. BMI was missing where the blood pressure reading was high, which is what makes dropping rows biased.
  • Single regression imputation covered the truth 3 percent of the time, biased by 0.330, while producing the narrowest interval of any method using all the rows. It is the most reasonable-looking fix and the only catastrophic one.
  • Multiple imputation reached 88.7 percent coverage against complete-case 82.7 and mean imputation 78.0, and used all 1,400 respondents rather than the 683 that were complete.
  • No imputation fixes missing not at random. All three feasible methods put mean income at 59.4 against a truth of 68.2, and agreed with each other because they shared the same wrong assumption.
  • When the mechanism cannot be tested, report the tipping point. The county's grant conclusion flips once refusers earn 35 thousand more than modeled, and the real gap is near 52.

Quiz: Test Yourself