Missing Data and Multiple Imputation: A Hands-on Course

From missing-data mechanisms to the pitfalls of complete-case analysis and single imputation, multiple imputation with mice and Rubin’s rules, and sensitivity analysis

Published

October 17, 2026

Introduction

English version — machine-assisted translation (by generative AI, Anthropic Claude) of the original Japanese hands-on. 日本語版はこちら.

Clinical research and epidemiological data almost always contain missing values. A participant didn’t come to the visit, blood couldn’t be drawn, a question went unanswered, someone dropped out of the study… R’s lm() silently drops rows with missing values before analysing. Behind that, however, many questions are being skipped:

  • Are the people who were dropped similar to those who remain?
  • Wouldn’t it be enough to fill in the mean?
  • What does “multiple imputation” do, and why is it correct?
  • What should go into the imputation model?
  • When you don’t know the missing-data mechanism, how far can you trust the conclusions?

In this hands-on, you create missingness yourself in data whose true values are known, and experience how to handle missing data by comparing the results of complete-case analysis, single imputation, and multiple imputation with the true values.

Goals of this hands-on

  1. Explain the missing-data mechanisms (MCAR, MAR, MNAR) and distinguish what the data can and cannot tell you
  2. Judge when complete-case analysis is biased and when it is not
  3. Explain the problems with single imputation such as mean imputation
  4. Explain the three steps of multiple imputation and Rubin’s rules by computing them by hand
  5. Perform multiple imputation with mice, and choose the imputation model, convergence checks, and m appropriately
  6. Perform sensitivity analyses for MNAR (delta adjustment, tipping point) and report how missing data were handled

Who this is for

  • People involved (or about to be involved) in analysing clinical research, epidemiological, or healthcare data
  • People with a rough understanding of means, standard deviations, regression, and confidence intervals
  • For R, it is enough if you can “read code, modify it a little, and run it”

R runs in your browser

The code cells in each chapter are executed by R inside your browser (a technology called webR). Edit the code and press “Run Code”, and the results change immediately. No installation is needed.

Note
  • Right after opening each chapter, loading R and the packages takes several tens of seconds to about a minute (a little longer from Chapter 5 onward, because the mice package is loaded)
  • Simulation and multiple-imputation cells can take a few seconds to a dozen or so seconds
  • Viewing on a PC is recommended

Data used

Data Description Main chapters
adults 10990 people aged 20–79 from NHANES 2009–2012. Age, sex, BMI, blood pressure, cholesterol, physical activity, income. Includes the actual missing values as they are 1, 2, 5, 7
full 2000 people selected from those in adults with no missing values. Used as data whose true values are known, in which you create missingness yourself 1–8
WarningNotes on the data
  • In full, systolic blood pressure has been regenerated by simulation, mimicking its NHANES relationship with age, BMI, and sex, so that the true relationship is known. The auxiliary variable home blood pressure is also generated for teaching purposes
  • The NHANES sample oversamples some racial and age groups. Because we tabulate without the survey weights, the numbers are not values for the US population (weights are covered in Chapter 5 of the Descriptive Statistics hands-on, in Japanese)

Chapter overview

Chapter Contents
1 Missing-data mechanisms (actual missing patterns, MCAR, MAR, MNAR, what the data can tell you)
2 Complete-case analysis (rows that silently disappear, means and regression coefficients, conditions for no bias, loss of precision)
3 Pitfalls of single imputation (mean imputation, regression imputation, stochastic regression imputation, coverage)
4 Multiple imputation and Rubin’s rules (multiple imputation by hand, proper imputation, coverage)
5 Multiple imputation with mice (3 steps, chained equations, predictive mean matching)
6 What to put in the imputation model (outcome, auxiliary variables, interactions)
7 Checking the imputations and choosing m (convergence, distribution of imputed values, m and the stability of standard errors)
8 Sensitivity analysis for MNAR and reporting (delta adjustment, tipping point, what to include in reports)
9 Exercises and a missing-data checklist

Each chapter follows the flow “create missingness in data whose true values are known → analyse with various methods → compare with the true values → repeat hundreds of times to check average bias and coverage”.

Related hands-ons (in Japanese): Descriptive Statistics hands-on (describing missingness in Chapter 4), Sample size and power hands-on (sample sizes that allow for dropout), Confounding hands-on (how to build regression models).