Not all missing data is the same. Statisticians describe three mechanisms, and the right handling method depends on which one you have.
| Type | Meaning | Example |
|---|---|---|
| MCAR — Missing Completely At Random | Missingness is random and unrelated to any variable in the dataset | A lab sample is lost by accident |
| MAR — Missing At Random | Missingness depends on other observed variables, not on the missing value itself | Younger users skip the "income" question more often |
| MNAR — Missing Not At Random | Missingness is directly related to the missing value itself | High-income individuals choose not to report income |
How this affects your decision
- MCAR is the easiest case. Dropping rows or simple imputation usually causes little bias.
- MAR can be handled well with imputation that uses the other columns (KNN, regression, iterative imputation).
- MNAR is the hardest. The fact that a value is missing carries information, so consider adding a missing-indicator column and gathering more data, if possible.
A quick practical test
# Is "Age" missingness related to another column?
df["Age_missing"] = df["Age"].isnull().astype(int)
print(df.groupby("Pclass")["Age_missing"].mean()) # share of missing Age per class
print(df.groupby("Sex")["Age_missing"].mean())
If missing values in one column are strongly related to other columns, the data is probably MAR rather than MCAR.