Sub topic 13
Common data quality pitfalls and how to prevent them
This chapter assumes you can write an operational definition, choose a sample size, and build a data collection plan with a check sheet. It also assumes you know what a measurement system check is. Here you learn how data goes wrong even when the plan is sound, and which controls catch the problems early.
Why good plans still produce bad data
A data collection plan describes what should happen. Data quality depends on what does happen on a busy Tuesday, when the collector is interrupted, the form is awkward, or the rule does not fit the case in front of them.
Most data quality problems fall into five groups:
- Definition problems: the rule is vague, or it changed during collection.
- Sampling problems: the items observed are not representative of the process.
- Measurement problems: people or instruments disagree, or drift.
- Recording problems: the correct value is observed but written down wrongly, late, or not at all.
- Handling problems: data is merged, cleaned, or filtered in ways that distort it.
Each group has a typical symptom and a prevention that belongs in the plan, not in the analysis.
The common pitfalls
| Pitfall | Typical symptom | Prevention |
|---|---|---|
| Vague or shifting definition | Defect rate jumps when a new collector starts | Written criterion, method and decision rule; version the definition |
| Convenience sampling | Data looks clean because only easy cases were checked | Select items by a rule, not by the collector's choice |
| Appraiser disagreement | Two people rate the same item differently | Agreement check before collection and again during it |
| Digit preference and rounding | Times cluster on 5s and 10s | Record the raw reading; use instruments that display finer units |
| Missing values | Blank fields, mostly from one team or shift | Required fields, a code for "not observable", daily review |
| Recording after the fact | Suspiciously regular data entered at end of shift | Record at the point of observation |
| Duplicates | Same item counted twice from two sources | Unique ID on every record |
| Lost stratification | Cannot split results by team or week | Capture the stratification fields on every record |
| Gaming and observer effect | Performance improves only while observed | Use data people cannot easily influence; collect before announcing |
| Silent cleaning | Outliers deleted without a trace | Keep raw data; log every change with a reason |
Definition problems
An ambiguous definition is the most expensive pitfall because it produces data that looks fine. If "late delivery" means "after the promised date" for one collector and "after the customer complained" for another, the numbers combine two metrics into one.
Prevent this in three ways:
- Include borderline examples in the definition. Show cases that count and cases that do not.
- Give the definition a version number and a date.
- If the definition must change, start a new data set. Do not append new data to the old set. A before-and-after comparison across a changed definition measures the definition change, not the process.
Sampling problems
Sampling bias happens when the way you pick items is related to the result. Examples are checking only the invoices that land on the auditor's desk first, measuring only the day shift, or inspecting parts only when the line is running smoothly.
The controls are the sampling strategies you already planned. Write the selection rule down so the collector has no discretion. If the rule says "every 20th invoice", the collector must not skip invoice 40 because it is hard to read. A skipped hard case is a bias toward easy cases.
Also watch for survivorship. Data collected from completed orders excludes cancelled orders, which may be exactly where the problem lives. Ask what population your records leave out.
Measurement problems
Even with a clear definition, people apply it differently, and instruments drift. The agreement check from the earlier chapter catches this before collection. It is also worth repeating during collection, because agreement decays as people develop habits, new collectors join, or the work changes.
A simple routine is to re-check a few items each week. Have two people rate the same items independently and compare. If agreement drops below the level you set at the start, stop and recalibrate before more data accumulates.
Recording problems
Recording errors include transcription mistakes, wrong units, illegible handwriting and values entered in the wrong field. Two patterns deserve special attention:
- Digit preference (heaping): collectors round to convenient numbers. Times end in 0 or 5, weights end in .0. If about 20% of values should end in 0 or 5 by chance and 70% do, your data was rounded.
- Late recording: entries written from memory at the end of the shift look tidy and are less accurate. Tidy data with few variations is a warning sign, not a good sign.
Prevention is mostly form design: required fields, drop-down choices instead of free text, units printed next to the field, and a place to record at the moment of observation.
Missing data
Missing values are rarely random. If one team leaves the "reason" field blank more often than the others, the blanks carry information. Deleting those rows removes that team's problems from your analysis.
Decide in the plan what a collector does when a value cannot be observed. A code such as NA-unreadable is better than a blank, because it separates "could not observe" from "forgot". Review the blank rate by collector and by stratum in the first days of collection.
Handling problems
Data goes wrong after collection too: copy-paste errors in a spreadsheet, merging two files with different definitions, and deleting "obviously wrong" values. Keep the raw data untouched. Do cleaning in a separate copy or a script, and keep a log of each change with a reason. An outlier may be a typing error, but it may also be the rare failure you are looking for. Check the source record before deleting it.
Automating the basic checks
Many of these problems can be detected with a short script run on the first day's data. The example below checks for duplicate IDs, unknown categories, missing results, out-of-range values and digit preference.
records = [
{"invoice_id": "INV-001", "team": "North", "result": "pass", "handling_min": 10},
{"invoice_id": "INV-002", "team": "North", "result": "fail", "handling_min": 15},
{"invoice_id": "INV-003", "team": "south", "result": "pass", "handling_min": 20},
{"invoice_id": "INV-003", "team": "South", "result": "pass", "handling_min": 20},
{"invoice_id": "INV-004", "team": "South", "result": None, "handling_min": 25},
{"invoice_id": "INV-005", "team": "North", "result": "fail", "handling_min": 900},
{"invoice_id": "INV-006", "team": "North", "result": "pass", "handling_min": 30},
{"invoice_id": "INV-007", "team": "South", "result": "pass", "handling_min": 10},
]
VALID_TEAMS = {"North", "South"}
VALID_RESULTS = {"pass", "fail"}
MAX_MINUTES = 240
problems = []
seen_ids = set()
for r in records:
rid = r["invoice_id"]
if rid in seen_ids:
problems.append(f"{rid}: duplicate invoice_id")
seen_ids.add(rid)
if r["team"] not in VALID_TEAMS:
problems.append(f"{rid}: unknown team {r['team']!r}")
if r["result"] not in VALID_RESULTS:
problems.append(f"{rid}: missing or invalid result {r['result']!r}")
if not 0 <= r["handling_min"] <= MAX_MINUTES:
problems.append(f"{rid}: handling_min {r['handling_min']} outside 0-{MAX_MINUTES}")
for p in problems:
print(p)
heaped = sum(r["handling_min"] % 5 == 0 for r in records)
share = heaped / len(records)
print(f"Share of times ending in 0 or 5: {share:.0%} (expect about 20%)")Running it prints:
INV-003: unknown team 'south'
INV-003: duplicate invoice_id
INV-004: missing or invalid result None
INV-005: handling_min 900 outside 0-240
Share of times ending in 0 or 5: 100% (expect about 20%)The script flags problems and does not fix them. Each flag leads to a check against the source record, and the fix and its reason go in the change log.
Edge cases and judgment calls
- The definition has to change mid-study. Stop, record the date, and keep the two data sets apart. If you must compare them, re-rate a sample of old items under the new definition so you can estimate the effect of the change.
- Collectors know they are being watched. Tell people what the data is for. If it will be used to rank individuals, expect distorted data. Say plainly that the purpose is to understand the process.
- A rule does not fit a real case. Give collectors a way to flag "rule unclear" instead of guessing. Collect these flags and use them to improve the definition.
- Automated data. System logs avoid human recording errors but have their own issues: time zones, clock drift, fields repurposed by other teams, and changes in system behaviour after software updates. Validate a sample of system data against a manual check.
- Pilot results look too good. A pilot with perfect completeness and no questions usually means the pilot was not tested on hard cases. Include some on purpose.
A prevention checklist
Before collection starts:
- The definition is written, versioned, and includes borderline examples.
- The selection rule leaves no discretion to the collector.
- Agreement between collectors has been checked and meets your target.
- The form has required fields, units, and codes for "not observable".
- Every record has a unique ID and the stratification fields.
During collection:
- Review completeness and blank rates by collector and stratum in the first days.
- Run validation checks for duplicates, impossible values and heaping.
- Re-check agreement periodically.
- Keep raw data unchanged and log all corrections.
Exercise
In a pilot, you find that 65% of recorded handling times end in 0 or 5, and that the blank rate for the "reason code" field is 30% for the night shift and 4% for the other shifts. Name the problem behind each finding, and give one prevention for each.
Show answer
The high share of times ending in 0 or 5 is digit preference (heaping): collectors are rounding. Prevent it by recording the raw instrument reading, using a timer that shows finer units, and having a form that asks for the exact time. The high blank rate on the night shift is a missing-data problem that is not random, so deleting the blank rows would hide the night shift's behaviour. Prevent it by making the field required, adding a code such as "NA-unreadable" for cases that cannot be observed, and finding out why the night shift cannot fill it in (for example, no supervisor available, or the form is not at their station).
Exercise
Halfway through a study, the team changes the definition of a defective invoice to include formatting differences. A colleague suggests appending the new data to the old file so there is a larger sample. Explain why this is a problem and what you would do instead.
Show answer
The two halves of the file measure different things, so combining them produces a defect rate that matches neither definition. Any change in the rate could come from the definition and not from the process. Instead, record the date of the change, keep the two data sets separate with a definition version on each record, and analyse them separately. If a comparison is needed, re-rate a sample of the earlier invoices under the new definition to estimate how much the change alone moves the rate.