Outliers &
Data Cleaning
Learn to identify outliers in biostatistical data, understand their impact on analysis, and apply principled data cleaning strategies.
What Is an Outlier?
An outlier is a data point that differs significantly from other observations. In biostatistics, an outlier might be a patient's lab value that falls far outside the expected range: it could signal a measurement error, a rare condition, or a data entry mistake.
Why Outliers Matter in Biostatistics
How One Outlier Shifts the Mean
The IQR Method for Detecting Outliers
The Interquartile Range (IQR) method is one of the most common techniques. It uses the spread of the middle 50% of data to define boundaries:
The Z-Score Method
The Z-score measures how many standard deviations a point is from the mean. It assumes the data is approximately normally distributed.
IQR vs Z-Score: Key Distinction
| IQR Method | Z-Score Method | |
|---|---|---|
| Assumption | None (non-parametric) | Approx. normal distribution |
| Formula | Uses fences based on \(1.5 \times \text{IQR}\) | \( |z| > 3 \) |
| Robustness | High: resistant to extreme values | Low: mean and SD shift with outliers |
| Best for | Skewed data, small samples | Large, symmetric datasets |
| Visualization | Box plot (whiskers) | Histogram + Z overlay |
What Is Data Cleaning?
Data cleaning is the process of detecting and correcting (or removing) corrupt, inaccurate, or irrelevant records from a dataset. In biostatistics, this includes handling outliers, missing values, duplicate entries, and measurement errors.
Types of Outliers
Data Cleaning Step by Step
Example 1: IQR Method
A clinical study records the white blood cell counts (\( \times 10^3 / \mu L \)) of 12 patients:
Example 1: Box Plot Visualization
Example 2: Z-Score Detection
Systolic blood pressure readings (mmHg) for 8 patients:
118, 122, 125, 119, 130, 121, 127, 210
Example 3: Decision Framework
A drug trial records patient weight (kg). One participant is listed as 8.2 kg while all others range from 55-95 kg. What should you do?
Common Mistakes
Summary: Detection & Action
| Scenario | Detection | Action |
|---|---|---|
| Data entry error | IQR or Z-score | Correct from source |
| Instrument malfunction | Visual inspection | Exclude + document |
| Natural extreme | IQR or Z-score | Keep + flag |
| Influential point | Cook's distance, leverage | Sensitivity analysis |
| Unknown cause | Multiple methods | Analyze with and without |
Question 1 of 5
A dataset has \( Q_1 = 20 \), \( Q_3 = 40 \), and \( \text{IQR} = 20 \). Using the 1.5 IQR rule, what is the upper fence?
Question 2 of 5
Which outlier detection method is most appropriate for a small, right-skewed dataset?
Question 3 of 5
A patient's recorded weight in a clinical trial is \( 7.5 \text{ kg} \), while all other patients range from \( 60-100 \text{ kg} \). After investigation, no source record can be found. What is the best course of action?
Question 4 of 5
A key weakness of the Z-score method for outlier detection is that:
Question 5 of 5
In a clinical trial, one patient shows an unusually high liver enzyme value. The value is confirmed as accurate by the lab. What should the researcher do?