01 / 24

Data Quality
Issues

Learn to identify and handle missing data, outliers, and measurement errors that compromise statistical analysis.

Business Statistics

What Is Data Quality?

Data quality measures how well a dataset serves its intended purpose. High-quality data is accurate, complete, consistent, and timely. When any of these properties break down, the conclusions we draw from statistical analysis become unreliable.

The Three Core Problems

Missing Data
Values that should exist but are absent: blank survey fields, sensor dropouts, or unrecorded transactions.
Outliers
Data points far removed from the rest: a salary of \(\$5{,}000{,}000\) in a dataset of entry-level wages.
Measurement Issues
Systematic or random errors in how data is collected: miscalibrated instruments, inconsistent units, or data-entry typos.

Why Data Quality Matters

Clean Data Good Analysis Sound Decisions Dirty Data Flawed Analysis Bad Decisions Garbage In = Garbage Out No statistical method can fix fundamentally flawed data

Types of Missing Data

MCAR
Missing Completely at Random: missingness is unrelated to any variable. Example: a survey accidentally skips printing page 3.
MAR
Missing at Random: missingness depends on observed variables. Example: younger respondents skip the income question more often.
MNAR
Missing Not at Random: missingness depends on the missing value itself. Example: high-income earners refuse to report their income.

Handling Missing Data

1
Listwise deletion: remove entire rows with any missing values. Simple but reduces sample size: if \( n = 200 \) and 40 rows are incomplete, you analyze only \( n = 160 \).
2
Mean / median imputation: replace missing values with the column's mean \( \bar{x} \) or median. Preserves \( n \) but underestimates variability.
3
Regression imputation: predict missing values using other variables. Better accuracy but can artificially inflate correlations.
4
Multiple imputation: create several plausible datasets, analyze each, and pool results. Considered the gold standard for MAR data.

What Is an Outlier?

An outlier is a data point that lies significantly outside the typical range of values. Formally, using the IQR method, a value is an outlier if it falls below \( Q_1 - 1.5 \times \text{IQR} \) or above \( Q_3 + 1.5 \times \text{IQR} \), where \( \text{IQR} = Q_3 - Q_1 \).

Normal range Outlier
\( Q_1 \)
\( Q_3 \)
\( Q_3+1.5 \cdot \text{IQR} \)

Detecting Outliers

IQR Method
Flag values outside \( [Q_1 - 1.5 \cdot \text{IQR},\; Q_3 + 1.5 \cdot \text{IQR}] \). Works well for skewed data.
Z-Score
Compute \( z = \frac{x - \bar{x}}{s} \). Values with \( |z| > 3 \) are typically flagged. Assumes roughly normal data.
Visual Methods
Box plots, scatter plots, and histograms let you see outliers directly. Always start with a visual check.

Outliers vs. Errors

Outlier (Legitimate) Error (Data Quality Issue)
Source Natural variation or rare event Typo, sensor malfunction, or wrong unit
Example A \(\$2\text{M}\) home in a \(\$300\text{K}\) neighborhood Age entered as 999 instead of 29
Action Keep but note its influence Correct or remove
Effect on \(\bar{x}\) Shifts mean but reflects reality Shifts mean in a misleading direction

Measurement Issues

Systematic Error (Bias)
Consistent shift in one direction. Example: a scale that always reads 2 kg too high. Affects accuracy.
Random Error
Unpredictable fluctuation around the true value. Example: slight variations each time you step on a scale. Affects precision.
Accurate + Precise Precise but Biased

Effect on Key Statistics

Consider a dataset of 10 employee salaries (in thousands): \( 35, 38, 40, 42, 44, 45, 47, 50, 52, 55 \). The mean is \( \bar{x} = 44.8 \) and the median is \( 44.5 \).

Mean \(\bar{x}\)
Sensitive to outliers. One extreme value can pull it far from center.
Median
Resistant to outliers. A better measure of center for skewed data.
Std Dev \(s\)
Inflated by outliers. Overstates the true spread in the data.

The IQR Rule Formally

1
Sort your data from smallest to largest.
2
Find \( Q_1 \) and \( Q_3 \) (the medians of the lower and upper halves).
3
Calculate \( \text{IQR} = Q_3 - Q_1 \) and both fences.
4
Flag any value below the lower fence or above the upper fence.

Data Quality Checklist

1
Inspect: check for blank cells, impossible values, and duplicate entries. Compute the missing rate per variable.
2
Visualize: create histograms and box plots to spot outliers and unusual distributions.
3
Diagnose: determine whether each issue is MCAR, MAR, or MNAR (for missing data) and whether outliers are errors or genuine.
4
Treat: apply the appropriate method: deletion, imputation, correction, or transformation (e.g., \(\ln(x)\) for skewed data).
5
Document: record every change made, the rationale, and how many values were affected. Reproducibility is critical.

Example 1: Finding Outliers

A store records daily sales (in units): \( 12, 15, 14, 13, 16, 15, 14, 42, 13, 15, 14, 16 \). Identify outliers using the IQR method.

Example 2: Handling Missing Data

A customer satisfaction survey has 500 responses. The "household income" field is blank for 80 respondents (16% missing). Analysis shows that younger respondents (< 25) are twice as likely to skip this question.

✕ Listwise Deletion
Loses 80 rows and biases the sample toward older respondents.
✓ Multiple Imputation
Uses patterns in the data to fill in plausible values while preserving uncertainty.

Example 3: Measurement Error

A warehouse logs package weights in kilograms. One clerk enters weights in pounds by mistake. The dataset contains: \( 2.3, 2.1, 4.8, 2.5, 2.2, 5.1, 2.4, 4.6, 2.3, 2.0 \) kg.

Common Mistakes

✕ Deleting All Outliers
Removing every extreme value without investigation throws away valuable information and can introduce bias.
✕ Ignoring Missing Data
Assuming blanks won't matter leads to biased estimates, especially when data is MNAR.
✕ Mean Imputation Only
Replacing all missing values with \(\bar{x}\) shrinks variance and distorts relationships between variables.

Summary Comparison

Missing Data Outliers Measurement Error
What is it? Absent values Extreme values Incorrect values
Detection Count blanks, check patterns IQR, z-score, box plots Domain knowledge, unit checks
Best Fix Multiple imputation Investigate, then decide Correct at the source
Risk if Ignored Biased sample Skewed \(\bar{x}\) and \(s\) Systematically wrong results

Let's Practice

Time to test your understanding of data quality issues. The following 5 questions cover missing data, outliers, and measurement errors.

Question 1 of 5

A dataset has \( Q_1 = 20 \), \( Q_3 = 40 \). Using the IQR method, what is the upper fence for outlier detection?

Question 2 of 5

In a medical study, patients with severe symptoms are less likely to complete follow-up surveys. The missing data mechanism is most likely:

Question 3 of 5

Replacing all missing values with the column mean \( \bar{x} \) is problematic primarily because it:

Question 4 of 5

A scale consistently reads 1.5 kg too high. This is an example of:

Question 5 of 5

Which measure of center is most resistant to the influence of outliers?