Tutorials › Exam PA - Predictive Analytics › Comparing Missing-Data Strategies by Sensitivity

Exam PA · Missingness, Outliers, and Factor Levels · Tutorial 176 of 966

Comparing Missing-Data Strategies by Sensitivity

Learn to compare defensible missing-data treatments side by side and explain what changes—and what does not—when the treatment changes.

Intermediate 12 min read

What You'll Learn

  • Set a common comparison target before changing how missing values are treated.
  • Track which observations and outcomes each strategy retains or uses.
  • Compare means and variances after complete-case and imputed analyses.
  • Calculate how alternative imputations can change a regression fit and prediction.
  • Identify why a stable result across strategies is evidence of robustness, not proof of correctness.
  • Report missing-data sensitivity without overstating what the analysis establishes.

Why Compare Missing-Data Strategies?

A missing-value treatment is part of the analysis, not a clerical detail. Complete-case analysis can reduce the sample and change who is represented. Imputation can retain records, but it fills in values using assumptions that may affect summaries and model results. Comparing several treatments shows whether a conclusion depends on those choices; it does not, by itself, determine which choice is correct.

The comparison is most informative when the strategies answer the same question on the same underlying records. Keep the outcome definition, predictor set, and model specification fixed where possible. Then record what changes: the number and composition of cases, descriptive summaries, and downstream estimates or predictions.

Definition: A sensitivity analysis for missing data compares results under multiple plausible ways of handling missing values. A strategy specifies which cases are analyzed and, if applicable, how missing values are filled. The comparison describes how dependent the findings are on those choices; it does not establish that any one strategy is unbiased.

The earlier material on MCAR, MAR, and MNAR distinguishes assumptions about why values are missing. In brief, MCAR means missingness is unrelated to observed and unobserved data; MAR allows dependence on observed information; MNAR allows dependence on unobserved values even after accounting for observed information. These are working assumptions, not labels that can usually be confirmed from the observed data alone. A strategy should be considered in light of the data-collection process and the analysis objective.

One Data Set, Three Strategies

Consider a hypothetical insurer studying the association between a property’s inspection score \(X\) and an annual maintenance-cost index \(Y\). The index is in arbitrary units, not dollars. All six outcomes are recorded, but two inspection scores are missing. Group indicates whether the property is in Zone A or Zone B.

PropertyZoneInspection score \(X\)Cost index \(Y\)
1A12
2A34
3AMissing8
4B56
5B78
6BMissing4

We will compare three choices: retain only rows with observed \(X\) (complete-case analysis); fill both missing scores with the overall observed mean; and fill each missing score with the observed mean for its zone. The last two are single-imputation strategies: each missing value receives one assigned value, rather than a range that represents uncertainty.

Worked Example: Compare the Cases and Summary Statistics

Calculate the analysis size and mean and sample variance of \(X\) under each strategy. Also compare the complete-case mean of \(Y\) with the mean using all six recorded outcomes.

Method. First count the records used. For a sample \(x_1,\ldots,x_n\), calculate the mean \(\bar{x}=\sum x_i/n\) and sample variance \(s^2=\sum (x_i-\bar{x})^2/(n-1)\). The sample variance is undefined for a sample of size one; all three samples here have at least four scores.

Complete cases. The observed scores are \(1,3,5,7\), so \(n=4\) and \(\bar{x}=(1+3+5+7)/4=16/4=4\). The squared deviations from 4 are \(9,1,1,9\), with sum 20. Thus \(s^2=20/(4-1)=20/3=6.6667\), rounded to four decimals.

Overall-mean imputation. The observed-score mean is \(16/4=4\), so impute 4 for each missing score. The analysis now contains \(1,3,4,5,7,4\), giving \(n=6\) and \(\bar{x}=(1+3+4+5+7+4)/6=24/6=4\). The squared deviations are \(9,1,0,1,9,0\), summing to 20. Therefore \(s^2=20/(6-1)=4.0000\).

Within-zone mean imputation. Zone A’s observed scores are 1 and 3, with mean \((1+3)/2=2\). Zone B’s observed scores are 5 and 7, with mean \((5+7)/2=6\). After filling the missing values, the scores are \(1,3,2,5,7,6\). Their mean is \(24/6=4\); the squared deviations from 4 are \(9,1,4,1,9,4\), summing to 28. Thus \(s^2=28/5=5.6000\).

Outcome composition. The four complete cases have outcomes \(2,4,6,8\), whose mean is \(20/4=5\). All six recorded outcomes sum to \(2+4+8+6+8+4=32\), so their mean is \(32/6=5.3333\), rounded to four decimals. Complete-case analysis excludes the outcomes 8 and 4 along with their missing predictors; it does not erase them from the original data.

Check. All strategies give the same mean score of 4 in this example, but their sample variances differ. Equal means do not imply equal distributions or equal downstream model results.

How Imputation Changes a Regression

To make the downstream comparison explicit, fit a simple linear regression of \(Y\) on \(X\), with an intercept, separately under each strategy. For the point estimates, the model is \(Y_i=\beta_0+\beta_1X_i+\varepsilon_i\), and ordinary least squares chooses the line minimizing the sum of squared residuals. The slope is \(b_1=S_{XY}/S_{XX}\), where \(S_{XY}=\sum (x_i-\bar{x})(y_i-\bar{y})\) and \(S_{XX}=\sum (x_i-\bar{x})^2\); the intercept is \(b_0=\bar{y}-b_1\bar{x}\). These formulas require \(S_{XX}>0\). The usual interpretation of the fit as a conditional-mean model also requires that a linear mean is appropriate; standard errors and tests require additional assumptions. Here the calculations compare fitted lines, not evidence of causation or a claim that those assumptions hold.

Why the least-squares formula holds: For a fixed slope \(b_1\), the sum of squared residuals \(\sum [y_i-b_0-b_1x_i]^2\) is minimized over \(b_0\) when the residuals sum to zero. This gives \(b_0=\bar{y}-b_1\bar{x}\). Substituting that intercept makes the residual sum of squares \(\sum[(y_i-\bar{y})-b_1(x_i-\bar{x})]^2\). Differentiating with respect to \(b_1\) and setting the derivative to zero gives \(-2S_{XY}+2b_1S_{XX}=0\), hence \(b_1=S_{XY}/S_{XX}\) when \(S_{XX}>0\).

Worked Example: Calculate the Three Regression Fits

Use the data above to calculate the least-squares slope and intercept for each missing-data strategy. Give slopes and intercepts to four decimal places.

Complete cases. The four \((X,Y)\) pairs are \((1,2),(3,4),(5,6),(7,8)\). We have \(\bar{x}=4\) and \(\bar{y}=(2+4+6+8)/4=5\). From the previous calculation, \(S_{XX}=20\). The products \(xy\) sum to \(2+12+30+56=100\), so \(S_{XY}=\sum xy-n\bar{x}\bar{y}=100-(4)(4)(5)=20\). Therefore \(b_1=20/20=1\), and \(b_0=5-(1)(4)=1\). The fitted line is \(\hat{Y}=1+X\).

Overall-mean imputation. The six pairs are \((1,2),(3,4),(4,8),(5,6),(7,8),(4,4)\). Here \(\bar{x}=4\), \(\bar{y}=32/6=16/3\), and \(S_{XX}=20\). The products \(xy\) sum to \(2+12+32+30+56+16=148\). Thus \(S_{XY}=148-6(4)(16/3)=148-128=20\). The slope is \(20/20=1\); the intercept is \(16/3-4=4/3=1.3333\). The fitted line is \(\hat{Y}=1.3333+X\), with the displayed coefficients rounded to four decimals.

Within-zone mean imputation. The six pairs are \((1,2),(3,4),(2,8),(5,6),(7,8),(6,4)\). We have \(\bar{x}=4\), \(\bar{y}=16/3\), and \(S_{XX}=28\). The products \(xy\) sum to \(2+12+16+30+56+24=140\); therefore \(S_{XY}=140-6(4)(16/3)=140-128=12\). The slope is \(12/28=3/7=0.4286\), rounded to four decimals. The intercept is \(16/3-(3/7)(4)=76/21=3.6190\), rounded to four decimals. The fitted line is \(\hat{Y}=3.6190+0.4286X\), with rounded coefficients.

Check. The three slopes are 1, 1, and approximately 0.4286. The group-mean imputation places the two added scores at 2 and 6, paired with outcomes 8 and 4. Those pairs change the covariance between score and outcome, so the fitted slope changes. The calculation is internally consistent: each slope is the computed \(S_{XY}\) divided by its corresponding \(S_{XX}\).

Overall-mean imputation happens to preserve the slope here. This is a special algebraic result for a simple regression with an intercept when missing predictor values are all replaced by the observed predictor mean. The imputed scores equal \(\bar{x}\), so they add zero to the centered predictor sum of squares and to the centered cross-product; the mean of \(X\) also remains \(\bar{x}\). That does not make mean imputation generally harmless. It changes the intercept here, reduces the sample variance of \(X\), and can distort uncertainty estimates. With additional predictors, interactions, or a different model, the same invariance need not hold.

Worked Example: Test a Prediction Against a Decision Threshold

Suppose a hypothetical planning rule flags a property when its predicted cost index at inspection score \(X=6\) is at least 6.5. Use the three fitted lines to determine whether that rule flags the property under each strategy. Keep the unrounded coefficients in intermediate calculations and round predictions to four decimals.

Complete cases. The fitted line is \(\hat{Y}=1+X\). At \(X=6\), \(\hat{Y}=1+6=7.0000\), which is at least 6.5, so the property is flagged.

Overall-mean imputation. The exact intercept is \(4/3\), so \(\hat{Y}=4/3+6=22/3=7.3333\), rounded to four decimals. This is at least 6.5, so the property is flagged.

Within-zone mean imputation. The exact fitted line is \(\hat{Y}=76/21+(3/7)X\). At \(X=6\), \(\hat{Y}=76/21+18/7=76/21+54/21=130/21=6.1905\), rounded to four decimals. This is below 6.5, so the property is not flagged.

Check. The decision changes under within-zone imputation even though all three methods use the same original records and the same regression specification. The threshold result is therefore sensitive to the missing-score treatment. It does not establish which prediction is correct.

Interpreting and Reporting Sensitivity

A useful comparison reports both the result and its limits. In this example, the complete-case and overall-mean slopes match, while the within-zone slope is smaller. The threshold decision also changes under the within-zone strategy. These differences direct attention to the two records with missing scores, the relationship between zone and score, and the fact that their observed outcomes differ.

Do not select a strategy merely because it produces a preferred result. Consider why values are missing, which records are excluded, whether the imputation variables are substantively meaningful, and what the analysis is intended to estimate. A zone-specific mean may retain a group distinction, but it still assigns a single value and does not represent within-zone variation. A global mean is simple, but it may obscure meaningful subgroup differences. Complete cases preserve observed predictor values, but the retained sample may not represent the full target population.

In R, the comparison should be reproducible: define each treatment explicitly, fit the same outcome model, and record the number of rows used. Functions such as complete.cases can identify complete rows, and summaries should make any removal or imputation explicit. Avoid letting a model function silently drop different rows from different fits without checking its analysis sample. A comparison table can make the results auditable.

StrategyScore sample sizeMean of \(X\)Sample variance of \(X\)Regression slope
Complete cases446.66671.0000
Overall-mean imputation644.00001.0000
Within-zone mean imputation645.60000.4286

A stable conclusion across reasonable strategies supports the limited statement that the conclusion is not highly sensitive to the treatments compared. It does not prove that missingness is harmless or that every strategy is valid. A changed conclusion should be reported as a limitation and investigated in context, rather than hidden by presenting only one fit.

Common Mistake: Treating Imputation as New Information

A tempting but incorrect argument is: “The imputed data set has six records, so it contains six observed inspection scores and should be more informative than the four complete cases.” The arithmetic does produce six rows, but two scores were assigned rather than measured. For example, the overall-mean strategy produces six values and a sample variance of \(4.0000\), compared with \(6.6667\) among the four observed scores. That smaller variance is partly a mechanical consequence of inserting values at the mean; it is not evidence that the population has less score variability.

The correction is to describe both the row count and the source of the values: four scores were observed, two were imputed, and results are conditional on the imputation rule. In particular, single imputation does not carry the uncertainty about the missing values into ordinary model calculations. Do not treat a conventional standard error from a single-imputed data set as if the filled values had been observed.

Key takeaway: Compare missing-data strategies using the same target, outcome, and model where possible. Report case counts, distinguish observed from imputed values, calculate how summaries and conclusions change, and explain why no strategy is automatically correct.

Check Your Understanding

For each question, compare the treatment choices and check the arithmetic before interpreting the result.

  1. A study has 12 records, of which 9 have both outcome and predictor observed. How many records enter a complete-case analysis for a model using those two variables, and how many are excluded? (Answer: 9 enter; 3 are excluded.)
  2. The observed predictor values are 10, 20, and 30, and two predictor values are missing. If both missing values are filled with the observed mean, what is the mean of the five-value imputed sample? (Answer: 20.)
  3. In Zone C, the observed scores are 4 and 8; in Zone D, the only observed score is 12. One score is missing in each zone. Under within-zone mean imputation, what values are assigned? (Answer: Zone C receives 6; Zone D receives 12.)
  4. A complete-case model predicts an outcome of 9.2 at a specified predictor value. A second plausible treatment predicts 8.7, and a decision threshold is 9.0. What sensitivity should be reported? (Answer: The decision changes: the first prediction is above the threshold and the second is below it.)
  5. Four observed predictor values are 2, 4, 6, and 8. Two missing values are both imputed with their observed mean. What are the observed and imputed sample sizes, and what is the imputed sample mean? (Answer: 4 observed values and 6 values after imputation; the imputed sample mean is 5.)
Clinical Biostats