Find a course

Module 2: Missing ValuesLesson 3 of 1213 min

Why Values Go Missing: MCAR, MAR and MNAR

Learn the three mechanisms behind missing data, why they matter for bias, and how to catch disguised blanks such as -999, N/A and 1900-01-01.

Step 1 of 11Learn

The survey that went quiet

A company sends a satisfaction survey to 2,000 employees. The results look great: an average of 4.3 out of 5. But only 900 people answered the question "How likely are you to stay another year?", and HR later learns that many of the people who skipped it left within six months.

The missing answers were not random noise. People who were unhappy were more likely to stay silent, so the answered questions described the happy half of the company. The blank cells carried information, and ignoring them produced a rosy, wrong picture.

This is the central idea of missing data: before deciding how to handle blanks, ask why they are blank. The reason determines which fixes are safe.

Statisticians describe three mechanisms, with names that sound technical but describe simple ideas. Data can be missing completely at random, missing at random given other information you have, or missing not at random, where the chance of being missing depends on the missing value itself. The next step explains each with an example. You will rarely know the mechanism for sure, but thinking it through tells you how worried to be.

Step 2 of 11Learn

Three mechanisms in plain language

MCAR: missing completely at random. The chance that a value is missing has nothing to do with any data, observed or not. A lab drops a tray and loses 40 blood samples; which samples were on the tray was pure chance. Dropping these rows shrinks your sample but does not bias it.

MAR: missing at random. Missingness depends on other variables you did record, but not on the missing value itself once you account for them. In a fitness study, older participants skip the online follow-up more often, and within each age group the skippers look like everyone else. Because you know everyone's age, you can correct for it, for example by imputing within age groups or weighting.

MNAR: missing not at random. Missingness depends on the unobserved value itself. People with very high incomes skip the income question; patients who feel worst miss their check-up appointment; the unhappy employees skip the retention question. No amount of cleverness with the observed data fully fixes this, because the information you need is exactly what's missing.

The names are confusing, MAR does not mean "random" in everyday language, so focus on the question behind them: does the chance of being blank depend on nothing, on things I measured, or on the missing value itself?

Step 3 of 11Practice · Match the pairs

Match each situation to the most likely missing-data mechanism.

Tap an answer, then tap the place where it belongs (or drag it there).

  1. A server outage wipes out a random hour of website logs
  2. Men skip a diet question more often than women, but within each sex skippers eat like answerers
  3. Heavy drinkers are the most likely to skip "How many drinks per week?"

Step 4 of 11Compare

MCAR, MAR and MNAR side by side

AspectMCARMARMNAR
Missingness depends onNothing, pure chanceOther recorded variablesThe missing value itself
ExampleA dropped tray of samplesOlder people skip the online follow-upUnhappy staff skip "will you stay?"
Dropping incomplete rowsSmaller sample, no biasBiased unless you account for those variablesBiased; data alone can't fix it
Can the data prove it?No, only give cluesNo, only give cluesNo; needs domain knowledge

Step 5 of 11Learn

Missing data in disguise

Not all missing values look empty. Systems and people invent their own ways to say "unknown", and profiling must catch them all:

  • Text placeholders: "N/A", "NA", "null", "NULL", "none", "-", "?", "unknown", "not provided".
  • Numeric sentinel values: -1, 0, 99, 999, -999, 9999. Old survey and medical systems used these heavily.
  • Default dates: 1900-01-01 or 1970-01-01, which appear when a blank date is converted to the system's starting point.
  • Whitespace: a cell containing a single space looks empty to a person but is a non-empty string to a computer.

Disguised missing values are dangerous because tools treat them as real data. Ten rows with weight 999 in a sample of 200 adults raise the average weight by roughly 45 kg. A spike of birthdays on January 1, 1900 makes a customer base look 125 years old.

The fix is to convert every placeholder to a single, true missing marker (None in Python, NaN in pandas, NULL in SQL) as early as possible, ideally when loading the file. In pandas, read_csv(..., na_values=["N/A", "-", "999"]) does this at load time. Write the list down: it is part of your cleaning rules.

Four disguises for missing valuesDisguised missingTextplaceholdersN/A, null, -Sentinelnumbers-1, 999Defaultdates1900-01-01Whitespace" "

Step 6 of 11Practice · Code challenge · Python

Write normalize_missing(values) that returns a new list where every placeholder for "unknown" becomes None. Treat these as missing: None, empty or space-only strings, the strings "NA", "N/A", "null", "-" and "unknown" (any capitalization, ignoring surrounding spaces), and the number -999. Keep every other value unchanged.

Real Python, running in a sandbox in your browser.
  • normalize_missing(["12", " N/A ", "", "7", "null"])
  • normalize_missing([5, -999, 0, None, "Unknown"])
  • normalize_missing(["Nadia", "-", " "])

Step 7 of 11Note

Step 8 of 11Learn

How to judge the mechanism from your data

You can never prove from the data alone that values are MCAR or MAR, because the missing values themselves are what you would need to check. But you can gather strong clues.

Compare rows with and without the missing value. Split the data into two groups, rows where income is present and rows where it is missing, and compare everything else you have: age, region, spending, sign-up channel. If the groups look alike, MCAR is plausible. If the missing group is much older or spends twice as much, missingness is related to those variables, so at least MAR, and you should account for them.

Look at when and where it happens. Blanks concentrated in one month, one store or one data source usually point to a process problem, such as a broken form field or a failed import, which is often fixable at the source.

Use domain knowledge. Would people with certain values have reasons to stay silent? Sensitive topics like income, weight, drug use or job satisfaction are classic MNAR risks.

Finally, treat missingness as a variable. A column flagging "income missing: yes/no" can itself predict outcomes. In credit and health data, the fact that someone did not answer is sometimes one of the strongest signals in the whole table.

Gathering clues about the missing-data mechanismSplit rows:has vs lacksCompare othercolumnsAlike?MCAR plausibleDifferent?at least MAR

Step 9 of 11Practice · What would you do?

What would you do?

In a customer table, 18% of rows have no value for annual spending. You compare those rows with the rest: customers with missing spending are mostly from one sign-up channel, a partner website launched last spring. Within that channel, the rows with and without spending look similar on age and region. What is the most reasonable interpretation and action?

Step 10 of 11Practice · True or false

By comparing rows that have a missing value with rows that do not, you can prove that the data is missing completely at random.

Step 11 of 11Practice · Choose one

A weather station dataset uses -999 for hours when the sensor failed. An analyst computes the average July temperature without changing anything. What happens?