Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 15

Missing Data: Identify & Impute

Welcome back. In our last lesson, we quantified the precise impact of outliers, demonstrating how a single data point can drastically alter descriptive statistics and regression coefficients. This process of identifying and assessing problematic data is a crucial part of ensuring the integrity of any analysis. We will now turn our attention to another pervasive challenge in data collection: missing values.

This lesson addresses how to handle gaps in your dataset. We will first explore how to conceptualize why data might be missing by identifying common patterns of missingness. Then, we will move to the practical application of a fundamental technique, mean imputation, to fill in these gaps. Your experience as a researcher has undoubtedly exposed you to incomplete datasets, and this lesson will provide a structured, mathematical approach to your first line of defense.

Identifying Missing Data Patterns

Before you can decide how to handle missing data, you must first develop a hypothesis about why it is missing. The reason for the absence of data is not trivial; it has significant implications for whether your chosen correction method will introduce bias. In statistics, we classify missingness into three main categories.

  1. Missing Completely at Random (MCAR): The probability that a value is missing is completely independent of any variable in your dataset, whether observed or unobserved. The missingness is a purely random event. For example, a survey participant accidentally skips a question, or a test tube is dropped in a lab. This is the ideal scenario for many simple correction methods.

  2. Missing at Random (MAR): The probability that a value is missing is related to another observed variable in your dataset, but not to the missing value itself. For example, if men are less likely than women to answer questions about emotional vulnerability, the missingness on the "vulnerability" variable is not random, but it can be predicted by the "gender" variable, which is observed.

  3. Missing Not at Random (MNAR): The probability that a value is missing is related to the value that is missing. This is the most problematic case. For example, individuals with very high salaries may be less likely to disclose their income, or patients with the most severe symptoms might be more likely to drop out of a study. The reason for missingness is the value itself.

Let's consider how these patterns might manifest in your specific areas of interest.

Scenario 1: Bra-Fitting Business

Imagine you collect data from clients, including their age and their preferred band tightness on a scale of 1 (very loose) to 10 (very tight). You notice some clients did not answer the tightness question.

  • MCAR: The missing responses are randomly scattered across all clients, regardless of age or any other factor. Perhaps the online form glitched for a few random users.
  • MAR: You notice that clients over 60 are much more likely to have missing tightness preference scores than younger clients. The missingness depends on an observed variable: Age.
  • MNAR: You suspect that clients who prefer a very loose fit (e.g., a score of 1 or 2) are embarrassed to admit it because it goes against conventional fitting advice, so they leave the question blank. The missingness is dependent on the unobserved preference itself.

Scenario 2: Polyandrous Relationship Study

In your research on polyandrous "vee" relationships, you measure the number of years a relationship has existed and a "relationship satisfaction" score from 1 to 10. Some satisfaction scores are missing.

  • MCAR: A few participants simply forgot to fill out that question on the survey. There is no pattern.
  • MAR: You observe that participants in newer relationships (e.g., under 2 years) are less likely to provide a satisfaction score. Here, missingness on Satisfaction depends on the observed variable Years Together.
  • MNAR: You hypothesize that individuals in very unhappy relationships (low satisfaction scores) are the most likely to drop out of the study or refuse to answer the satisfaction question. The reason for the missingness is the low satisfaction score itself.

Distinguishing between these patterns is often a matter of judgment and subject-matter expertise, as it's difficult to prove definitively. However, having a working hypothesis is crucial before proceeding. For the purposes of learning the mechanics of imputation, we will proceed as if the data were MCAR or MAR, as mean imputation is generally considered inappropriate for MNAR data.


Applying Mean Imputation

Mean imputation is the process of replacing missing values in a variable with the mean of the observed values for that same variable. It is a simple and fast method, but it comes with a significant drawback: it artificially reduces the variance of the data. By filling in every blank with the exact same value, you are understating the true spread of your data. This can weaken correlations and affect other statistical measures.

Despite its flaws, it is a foundational technique to master. The procedure is straightforward:

  1. Isolate the variable with missing data.
  2. Calculate the arithmetic mean using only the non-missing, observed values.
  3. Replace each missing value in that variable with the calculated mean.

Let's perform the calculations for our two scenarios.

Numerical Example 1: Bra-Fitting Business

Scenario: You have band tightness preference scores from 10 clients. Two scores are missing.

Data (with missing values):

Client ID Age Band Tightness Preference (1-10)
C1 25 7
C2 42 5
C3 31 8
C4 55 4
C5 28 NA
C6 60 NA
C7 35 6
C8 22 9
C9 48 5
C10 39 7

Step 1: Isolate the variable. The variable is Band Tightness Preference.

Step 2: Calculate the mean of observed values.
The observed values are: 7, 5, 8, 4, 6, 9, 5, 7. There are such values.

Step 3: Replace missing values. We replace the 'NA' entries for clients C5 and C6 with the calculated mean, 6.375.

Data (after mean imputation):

Client ID Age Band Tightness Preference (1-10)
C1 25 7
C2 42 5
C3 31 8
C4 55 4
C5 28 6.375
C6 60 6.375
C7 35 6
C8 22 9
C9 48 5
C10 39 7

The dataset is now complete and can be used for further analysis, bearing in mind the potential distortion we've introduced.

Numerical Example 2: Polyandrous Relationship Study

Scenario: You have relationship satisfaction scores from a study of 12 "vee" relationships. Three scores are missing.

Data (with missing values):

Relationship ID Years Together Relationship Satisfaction (1-10)
R1 2 8
R2 8 6
R3 1 NA
R4 10 5
R5 5 7
R6 12 NA
R7 3 9
R8 0.5 8
R9 6 6
R10 15 4
R11 4 NA
R12 7 7

Step 1: Isolate the variable. The variable is Relationship Satisfaction.

Step 2: Calculate the mean of observed values.
The observed values are: 8, 6, 5, 7, 9, 8, 6, 4, 7. There are values.

Step 3: Replace missing values. We replace the 'NA' entries for R3, R6, and R11 with the calculated mean, 6.67.

Data (after mean imputation):

Relationship ID Years Together Relationship Satisfaction (1-10)
R1 2 8
R2 8 6
R3 1 6.67
R4 10 5
R5 5 7
R6 12 6.67
R7 3 9
R8 0.5 8
R9 6 6
R10 15 4
R11 4 6.67
R12 7 7

Again, the dataset is numerically complete. Notice how the imputed values pull the overall distribution towards the center, which is the core effect of this method.


Conclusion

In this lesson, you have learned to address one of the most common issues in real-world data: missing values. We began by classifying the reasons for missingness into three key patterns—MCAR, MAR, and MNAR—which helps frame the problem. You then performed the hand-calculations for mean imputation, a straightforward method for filling these gaps.

Key Takeaways:

  • Missing data can be classified as Missing Completely at Random (MCAR), Missing at Random (MAR), or Missing Not at Random (MNAR). Your hypothesis about the pattern of missingness influences the choice of a correction strategy.
  • Mean imputation replaces missing values with the arithmetic mean of the observed values for that variable.
  • The calculation is simple, but the method has a major drawback: it artificially reduces the variance of the variable, which can distort subsequent analyses.

You have now tackled outlier assessment and a basic method for handling missing data. This naturally leads to the question: what are the consequences of these choices? Is removing an outlier always better than keeping it? Is mean imputation better than simply deleting the records with missing data? Our next lesson will explore these trade-offs, helping you make more informed decisions when cleaning and preparing your data.