Saltar al contenido

Lección 7 · Missing Values

Why Data Is Missing: MCAR, MAR and MNAR

Learn the three missing data mechanisms, MCAR, MAR and MNAR, with simple simulations that show when dropping rows biases results and what you can check.

Before you decide what to do about missing values, ask why they are missing. The reason affects whether the remaining data still represents the whole. Statisticians describe three broad situations.

Three mechanisms

Why is it missing?

MCAR Pure chance
MAR Explained by known data
MNAR Tied to the unseen value
1 / 2

Missing completely at random (MCAR). The chance of a value being missing has nothing to do with any data, seen or unseen. Example: some paper forms are lost when coffee spills on a random part of the pile.

Missing at random (MAR). The name is confusing. It means the chance of being missing can be explained by information you do have. Within groups defined by that information, missingness is unrelated to the hidden value. Example: people who answer on a phone skip the income question more often, you know each person's device, and nothing else drives the skipping.

Missing not at random (MNAR). The chance of being missing still depends on the unseen value, even after using what you know. Example: people with very high incomes are more likely to leave income blank.

See the effect

In real data you do not know the hidden values. In a simulation you do, which makes the bias visible.

Python Simulate three kinds of missing data

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Read the three lines:

  • MCAR: the simple average stays close to the truth. You lose precision, but no systematic bias appears.
  • MAR: the simple average is too low because seniors are underrepresented. Averaging within groups and weighting by the known group shares brings it close again.
  • MNAR: group weighting helps only partly. High incomes are missing inside each group, and nothing in the observed data fully reveals how many.

Can you tell which one you have?

Only partly. You can look for evidence against MCAR: if the share of missing values differs clearly between groups, dates or sources, missingness is probably not pure chance.

Python Compare missing rates by group

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

With small groups, differences can appear by chance, so a statistical test may help. You generally cannot tell MAR from MNAR using the observed data alone, because the difference lies in the values you do not have. Evidence must come from outside: knowledge of how data was collected, a follow-up with a sample of non-responders or a comparison with a trusted external source.

Ask about the process

These questions often explain more than any test:

  1. How is each value collected, and by whom?
  2. Is the field optional? Is it shown only to some users?
  3. Did a form, system or sensor change at some date?
  4. Could someone prefer not to reveal this value?
  5. Does an extreme value make measurement fail?

Also separate not applicable from unknown. A "spouse name" that is blank because someone is unmarried is not a gap to fill. Use a status column if both cases occur.

Add a missing flag, such as income_missing, before you fill anything. It lets you compare groups later and keeps the fact that the value was absent.

Common mistake: saying "the data is missing at random" because you did not look. It is an assumption. State it, give your reasons and test how your conclusion changes if it is wrong.

Test your sensitivity

When MNAR is plausible, try several assumptions. For example, calculate the result if unseen values were similar to observed ones, 10% higher and 20% higher. If the conclusion stays the same, you can be more confident. If it flips, say so clearly. For high-stakes work, involve a statistician.

A short story

Imagine a survey about exercise. Some people skip the question about their weight. If a software fault dropped answers at random, the mechanism would be close to MCAR. If older respondents skipped it more often, and age is recorded and explains the pattern, MAR would be a reasonable assumption. If people skipped it because of their weight, even among people of the same age, the data would be MNAR.

All three situations can produce exactly the same looking table: some filled cells and some empty ones. That is why the mechanism cannot be read from the table alone.

What this means for your choices

If you believe Dropping incomplete rows A reasonable next step
MCAR Mostly costs precision Check how many rows you lose
MAR Can bias results Use the explaining variables, through weighting or suitable imputation
MNAR Can bias results, and common fixes may not remove it Collect more information and test several assumptions

The table is a simplification. Whether dropping rows biases a particular estimate also depends on what you are estimating and which variables drive the gaps. Treat it as a guide to the questions you should ask.

Write your assumption in the report in plain words, for example, "We assume that missing incomes are explained by device type and age. If high earners skipped the question more often, the average shown here is too low." A reader can then judge the risk, which is far better than a number that looks certain.

Different columns, different reasons

One dataset can contain several mechanisms. A phone number may be missing because the field was added late, while income is missing because people declined. Judge each important column separately.

Check your understanding

Quick check · 3 questions

of 3 answered You scored / 3 · perfect!

  1. 1. Younger users skip a question more often, and age is recorded. If age fully explains the skipping, which mechanism is this?

    Missingness is explained by an observed variable, which is the meaning of missing at random.
  2. 2. A sensor fails mostly when temperatures are extremely high, and no other recorded value explains it. What is this?

    The chance of missingness depends on the unrecorded temperature itself.
  3. 3. What can observed data usually NOT tell you on its own?

    The distinction depends on unseen values, so you need outside knowledge or follow-up.

Summary

  • MCAR is pure chance, MAR is explained by observed data and MNAR depends on unseen values.
  • Dropping rows can bias results when data is not MCAR.
  • Clear group differences in missing rates argue against MCAR.
  • Learn the collection process and test your assumptions.

Next: Filling or Dropping Missing Values

Tu progreso se guarda en este navegador. No necesitas una cuenta.