Mathwords logoMathwords

Imputation — Definition, Formula & Example

Imputation is filling in missing values in a data set with reasonable estimates so you can still analyze all your cases. The estimate might be the mean of the other values, a prediction from a related variable, or a value borrowed from a similar case.

Given a data set in which some entries are missing, imputation applies a specified rule to the observed entries to produce a substitute value for each missing entry. The result is a completed data set. Common rules include mean or median imputation, regression imputation (predicting the missing value from other variables), and hot-deck imputation (copying a value from a similar observed case). Multiple imputation repeats a random version of this process several times to reflect uncertainty about the missing values.

Key Formula

x^miss=xˉobs=1m∑i∈obsxi\hat{x}_{\text{miss}} = \bar{x}_{\text{obs}} = \frac{1}{m}\sum_{i \in \text{obs}} x_i
Where:
  • x^miss\hat{x}_{\text{miss}} = the value filled in for a missing entry (mean imputation)
  • xˉobs\bar{x}_{\text{obs}} = the mean of the values that were actually recorded
  • mm = the number of observed (non-missing) values
  • xix_i = each observed value

Worked Example

Problem: A runner's watch logged these distances (in miles) over six days: 3, 5, missing, 4, 6, 2. Use mean imputation to fill in the missing day. Then compare the sample standard deviation before and after imputing.
Step 1: Find the mean of the five observed values. This is the imputed value for the missing day.
xˉobs=3+5+4+6+25=205=4 miles\bar{x}_{\text{obs}} = \frac{3+5+4+6+2}{5} = \frac{20}{5} = 4 \text{ miles}
Step 2: Compute the sample standard deviation of the five observed values. The deviations from 4 are −1,1,0,2,−2-1, 1, 0, 2, -2.
s=(−1)2+12+02+22+(−2)25−1=104≈1.58s = \sqrt{\frac{(-1)^2+1^2+0^2+2^2+(-2)^2}{5-1}} = \sqrt{\frac{10}{4}} \approx 1.58
Step 3: Now include the imputed 4. The completed data set is 3, 5, 4, 4, 6, 2, and its mean is still 24/6=424/6 = 4. The new value has deviation 0, so the sum of squares stays at 10 while n−1n - 1 grows from 4 to 5.
s=10+026−1=2≈1.41s = \sqrt{\frac{10 + 0^2}{6-1}} = \sqrt{2} \approx 1.41
Answer: The missing day is imputed as 4 miles. The mean stays at 4 miles, but the standard deviation drops from about 1.58 to about 1.41 miles. Mean imputation makes the data look less variable than it really is.

Why It Matters

Real surveys and experiments almost always have gaps, such as skipped questions or broken sensors. Dropping every incomplete case can shrink your sample and bias results if the people who skipped differ from those who answered. Data scientists and medical researchers use imputation, especially multiple imputation, to keep those cases without pretending the guesses are certain.

Common Mistakes

Mistake: Treating imputed values as if they were real measurements when you report spread, margins of error, or significance.
Correction: Single imputation adds values with no real variability, so the standard deviation and standard errors come out too small. State which values were imputed. Also ask why the data are missing. If the missing values differ systematically from the observed ones, no simple fill-in will remove the bias.

Related Terms

  • Univariate Data — Single-variable data where mean or median imputation applies
  • Bivariate Data — Paired variables that make regression imputation possible
  • Scatterplot — Shows whether a related variable can predict missing values
  • Regression — Predicts missing values from a related variable
  • Median — Common fill-in value for missing data