Data cleaning

Data cleaning is the process of finding errors, gaps and duplicates in a dataset and correcting, flagging or removing them before the data is used. Statistical agencies call the detection and treatment of errors data editing.

Also called: data cleansing · data scrubbing · statistical data editing · data editing

What it is

Data cleaning is the work of detecting and treating errors, missing values and duplicates in a dataset so that it is fit for analysis or reporting. The European Commission statistics portal describes statistical data editing as the activities aimed at finding and fixing errors in collected data.

The work follows a sequence:

The same portal separates micro editing, which checks each record, from macro editing, which checks aggregated figures for suspicious values. Selective editing directs manual effort to the errors that most affect the final results.

The OECD glossary defines a deterministic edit as a check whose violation indicates an error with a probability of one, for example a recorded age of 5 combined with the status of mother. Edits with a lower probability only mark a value as suspicious.

The Eurostat recommended practices state that replacing missing values by zero is neither an acceptable imputation procedure nor an acceptable alternative to flagging them.

Why it matters

Analysis, models and reports inherit every error in their input. A duplicate counts a customer twice, and a misplaced decimal point distorts an average.

Cleaning turns a raw extract into a dataset whose limits are known. Each change is logged, so that a reader can trace a published figure back to the original value.

Worked example

Illustrative numbers. An extract holds 1,000 customer records.

The cleaned file holds 940 records, with 28 corrections or returns and 40 flagged gaps, all listed in a change log.

Assumptions

Who uses it

Common confusions

7Roles that need it

8Skills behind it

Sources behind this page (3) · Updated 5 Nov 2026
1Statistical Data Editingcros-legacy.ec.europa.eu · accessed 5 Nov 2026
2OECD Glossary of Statistical Terms: Deterministic editstats.oecd.org · accessed 5 Nov 2026

Concept