Multiple Imputation for Missing Data
Statistics
Principled Missing Data Handling With Rubins Rules
Multiple imputation creates several plausible completed datasets, analyzes each separately, and combines results using Rubins rules. It properly accounts for the uncertainty introduced by the imputation process.
-
Epidemiology â Handle missing biomarker data in cohort studies
-
Economics â Complete income data with observed correlates in survey analysis
-
Healthcare â Impute missing lab values while preserving statistical validity
Multiply imputing once is better than single-imputing with false confidence.
Multiple imputation (MI) creates several plausible completed datasets by filling in missing values, analyzes each separately, and combines results using Rubin's rules.
Why Multiple Imputation?
The MICE Algorithm
Multiple Imputation by Chained Equations (MICE) is the most popular MI method.
Steps
| Step | Action |
|------|--------|
| 1 | Initialize missing values with simple imputation (e.g., mean) |
| 2 | For each variable with missing values: fit regression on other variables |
| 3 | Draw imputed values from the predictive distribution |
| 4 | Repeat steps 2-3 for many cycles (typically 10-20) |
| 5 | After convergence, save the imputed dataset |
| 6 | Repeat steps 1-5 M times to create M datasets |
Predictive Mean Matching (PMM)
Steps for each missing value:
-
Fit a regression predicting from other variables using observed data
-
Predict for both observed and missing cases
-
For each missing case, find the observed case with the closest predicted value
-
Use the observed value as the imputation
Rubin's Rules
Combined Point Estimate
Combined Variance
Number of Imputations
| Missing Fraction | Recommended M |
|-----------------|---------------|
| < 10% | 5-10 |
| 10-30% | 20-40 |
| 30-50% | 40-100 |
| > 50% | > 100 |
Diagnostics
Convergence
Plot the mean and variance of imputed values across iterations. They should stabilize after 10-20 iterations.
Imputation Quality
| Diagnostic | What to Check |
|-----------|---------------|
| Density plots | Imputed and observed distributions should overlap |
| Scatter plots | Relationships between variables should be similar |
| Trace plots | MICE chains should mix and converge |
Assumptions
Python Implementation
import numpy as np
import pandas as pd
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer
import matplotlib.pyplot as plt
np.random.seed(42)
# Simulate data
n = 500
X1 = np.random.randn(n)
X2 = 0.6 * X1 + np.random.randn(n) * 0.5
X3 = 0.3 * X1 + 0.5 * X2 + np.random.randn(n) * 0.7
# Create MAR missingness in X1
missing_prob = 1 / (1 + np.exp(-(-1 + 0.8*X2)))
R = np.random.binomial(1, missing_prob)
X1_obs = X1.copy()
X1_obs[R == 1] = np.nan
df = pd.DataFrame({'X1': X1_obs, 'X2': X2, 'X3': X3})
true_mean = X1.mean()
obs_mean = np.nanmean(X1_obs)
missing_pct = df['X1'].isna().mean()
print(f"True X1 mean: {true_mean:.3f}")
print(f"Observed X1 mean: {obs_mean:.3f}")
print(f"Missing: {missing_pct:.1%}")
# Multiple Imputation (M = 30)
M = 30
estimates = []
for m in range(M):
imputer = IterativeImputer(random_state=m, max_iter=20)
imputed = imputer.fit_transform(df)
estimates.append(imputed[:, 0].mean())
# Rubin's rules
Q_bar = np.mean(estimates)
B = np.var(estimates, ddof=1)
# Approximate within-imputation variance
U_bar = np.var(X1) / (n * (1 - missing_pct))
T = U_bar + (1 + 1/M) * B
SE = np.sqrt(T)
print(f"\nMI estimate: {Q_bar:.3f} (SE: {SE:.3f})")
print(f"95% CI: [{Q_bar - 1.96*SE:.3f}, {Q_bar + 1.96*SE:.3f}]")
# Plot convergence
fig, axes = plt.subplots(1, 2, figsize=(12, 5))
axes[0].plot(estimates, 'o-')
axes[0].axhline(y=true_mean, color='red', linestyle='--', label='True')
axes[0].set_xlabel('Imputation')
axes[0].set_ylabel('X1 Mean')
axes[0].set_title('Imputation Convergence')
axes[0].legend()
# Density comparison
axes[1].hist(X1, bins=30, alpha=0.5, density=True, label='Observed')
axes[1].hist([e for e in estimates], bins=30, alpha=0.3, density=True, label='Imputed means')
axes[1].legend()
axes[1].set_title('Density Comparison')
plt.tight_layout()
plt.show()
Worked Example
Key Takeaways
Related Topics
-
See Missing Data for mechanisms (MCAR, MAR, MNAR)
-
See Bootstrap Methods for resampling methods
-
See Regression Diagnostics for model checking
Extended Learning: Beyond the Basics
Key Concepts Summary
This lesson covers fundamental concepts that serve as building blocks for more advanced topics. Master these basics before moving to intermediate and advanced material.
Prerequisite Knowledge
Before studying this topic in depth, ensure you understand:
- Basic definitions and terminology
- Core formulas and their derivations
- Common applications in real-world scenarios
- Typical pitfalls and misconceptions
Step-by-Step Walkthrough
Let us work through a complete example to solidify understanding:
Step 1: Identify the problem type. Determine which category this problem falls into and which approach is most appropriate.
Step 2: Apply the relevant formula. Substitute known values into the appropriate equation, paying attention to units and constraints.
Step 3: Simplify and solve. Work through the algebra step by step, checking each intermediate result.
Step 4: Verify the answer. Check that the solution satisfies the original conditions and makes logical sense.
Common Mistakes to Avoid
- Misidentifying the problem type â Always start by categorizing the problem
- Incorrect formula application â Verify the formula applies to your specific case
- Unit errors â Always check units are consistent throughout
- Sign errors â Pay careful attention to positive and negative values
- Rounding too early â Keep full precision until the final answer
- Forgetting constraints â Check that solutions satisfy all given conditions
Real-World Applications
Understanding this concept is essential for:
- Advanced problem solving in examinations
- Building intuition for more complex topics
- Developing analytical thinking skills
- Applying mathematical reasoning to practical situations
Practice Exercises
- Basic: Solve 5 problems of increasing difficulty using the core concept.
- Intermediate: Apply the concept to word problems with multiple steps.
- Advanced: Combine this concept with 2-3 other topics in a comprehensive problem.
- Challenge: Create your own problem that requires this concept plus additional knowledge.
Interview and Exam Tips
- Common question patterns: Identify which exam or interview formats test this topic
- Time management: Practice completing problems within time constraints
- Common traps: Know the typical mistakes examiners set as distractors
- Verification strategy: Develop a quick method to check your answer
Related Topics
- Previous Topic â Build on the foundation laid here
- Next Topic â See how this concept extends to more advanced material
- Practice Problems â Additional exercises with solutions
- Video Explanation â Visual walkthrough of key concepts
Quick Reference Card
| Concept | Formula/Rule | Key Insight | Common Use |
|---|---|---|---|
| Core Definition | See main text | Understand the intuition | Foundation for all applications |
| Key Formula | See main text | Memorize the derivation | Direct problem solving |
| Special Case | See main text | Recognize when it applies | Simplifies complex problems |
| Edge Case | See main text | Know the limitations | Avoids errors |
Further Reading
For students who want to go deeper:
- Standard textbooks on the subject
- Research papers applying this concept
- Online courses with video explanations
- Practice problem collections with detailed solutions