When Good Data Go Bad: Detecting Data Quality Problems Before You Analyze
“Garbage in, garbage out.” It’s one of the oldest sayings in statistics, and for good reason. Even the most sophisticated statistical methods cannot rescue poor-quality data. Before choosing a statistical test, fitting a regression model, or creating your first graph, it is essential to ensure that your data accurately represent what you intended to measure.
Data quality issues are surprisingly common. They can arise during data collection, data entry, data transfer, or data management. Left undetected, these problems can lead to biased estimates, misleading conclusions, and, ultimately, poor decisions.
Fortunately, many data quality problems can be identified with a systematic review before any formal analysis begins.
Why Data Quality Matters
Imagine conducting a clinical study with 300 participants. You carefully select your statistical methods, meet all the assumptions of your chosen analyses, and obtain statistically significant results. Later, you discover that several participants’ ages were entered incorrectly, treatment groups were miscoded, and some outcome values were duplicated.
Your statistical analysis may have been technically correct—but it was performed on flawed data.
Data cleaning is not a tedious administrative task; it is a critical component of sound statistical practice.
Common Data Quality Problems
1. Missing Data
Missing values are one of the most common challenges researchers encounter. Some participants skip survey questions, laboratory results may be unavailable, or equipment failures may prevent data collection.
Before analyzing your data, ask:
- How much data are missing?
- Are missing values concentrated within specific variables?
- Do certain participant groups have more missing data than others?
Understanding the pattern of missing data is just as important as knowing the amount of missing data.
2. Duplicate Records
Duplicate observations can unintentionally overweight certain participants or measurements.
Duplicates may occur because:
- A participant completed a survey twice.
- Data were imported multiple times.
- Multiple databases were merged incorrectly.
Always verify that each observation represents exactly one intended unit of analysis.
3. Impossible Values
Some errors are immediately obvious.
Examples include:
- Age = 250 years
- Heart rate = –15 beats per minute
- Height = 18 feet
- Pain score = 17 on a 0–10 scale
These values often result from data entry errors, coding mistakes, or unit conversion problems.
Simple frequency tables and summary statistics frequently identify these issues quickly.
4. Inconsistent Coding
Variables should be coded consistently throughout the dataset.
For example, gender might appear as:
- Male / Female
- M / F
- 1 / 2
- 0 / 1
If all of these appear within the same dataset, analysis becomes more complicated and errors become more likely.
Develop and maintain a clear coding dictionary before beginning analysis.
5. Outliers
Not every unusual observation is an error.
An exceptionally high blood pressure reading may represent a patient experiencing a hypertensive crisis rather than a mistake.
When identifying outliers, ask:
- Is the value biologically or clinically plausible?
- Could it result from a recording error?
- Does supporting documentation confirm the observation?
The goal is not to eliminate unusual values but to understand them.
6. Inconsistent Dates
Date-related errors often go unnoticed.
Examples include:
- Follow-up visits occurring before enrollment.
- Birth dates after treatment dates.
- Negative lengths of stay.
- Assessment dates outside the study period.
Sorting data chronologically can quickly reveal these inconsistencies.
Five Simple Checks Before Any Statistical Analysis
Developing a routine data quality checklist can prevent countless downstream problems.
Consider completing these five steps before beginning formal analyses:
✓ Review Summary Statistics
Calculate:
- Minimum and maximum values
- Means and medians
- Standard deviations
- Frequency distributions
Unexpected values often become immediately apparent.
✓ Examine Frequency Tables
Categorical variables should be reviewed individually.
Look for:
- Unexpected categories
- Misspellings
- Blank responses
- Rare coding values
✓ Create Simple Graphs
Histograms, boxplots, and scatterplots often reveal problems that summary statistics miss.
Visual inspection can identify:
- Outliers
- Data entry errors
- Unusual distributions
- Clustering
- Recording mistakes
✓ Verify Variable Types
Ensure variables have been imported correctly.
Examples:
- Numeric variables imported as text
- Dates stored as character strings
- Categorical variables treated as continuous measures
Incorrect variable types can cause statistical software to produce misleading results or generate errors.
✓ Compare Sample Characteristics
Review participant characteristics against your expectations.
Ask:
- Are the demographics reasonable?
- Do sample sizes match recruitment records?
- Are treatment groups balanced as expected?
- Do descriptive statistics align with previous reports?
Large discrepancies often signal underlying data issues.
Data Cleaning Is Not Data Manipulation
Some researchers worry that cleaning data somehow changes the results. In reality, responsible data cleaning improves the accuracy and transparency of an analysis.
Every modification should be:
- Documented
- Justified
- Reproducible
Maintaining an audit trail of corrections allows others to understand exactly how the final dataset was prepared.
Make Data Quality a Habit
Experienced statisticians rarely begin with hypothesis tests. They begin by getting to know the data.
A careful review of your dataset can uncover problems that would otherwise remain hidden until reviewers—or worse, readers—discover them. Investing time in data quality assessment not only strengthens the credibility of your statistical analyses but also increases confidence in the conclusions you ultimately report.
Before running your next statistical test, spend a few minutes asking a simple question:
“Can I trust my data?”
The answer may be the most important result you obtain all day.
Stats Tip
Think of data analysis like building a house. Sophisticated statistical methods are the roof, walls, and finishing touches—but data quality is the foundation. No matter how impressive the analysis, a weak foundation will eventually cause problems. Always inspect, clean, and understand your data before moving on to statistical testing.