Data quality
Serendipity through rigour: the findings nobody was looking for
Some of the most valuable findings of our engagements were not the question we were asked. They appeared while we were checking something else, cleaning, encoding, imputing or joining data with one aim only: that every important number explain itself. This article describes those checks, what they found, and what to do with each error once it is found. Rigour, not luck alone.
Not the question we were asked
Horace Walpole coined the word serendipity in 1754, after a tale whose princes were always making discoveries “by accidents and sagacity, of things which they were not in quest of”. Accidents and sagacity: in data work, the accident is an error nobody suspected, and the sagacity is the rigour that refuses to move on while a number does not make sense. Pasteur said it another way: chance favours only the prepared mind. Serendipity is not luck alone.
One finding shows it better than any definition. For a health insurer, the engagement was to rebuild reliable insurance data, then estimate the remaining cost of claims. While identifiers, dates and exposure periods were reconciled with claims, some members turned out to have been paid for claims over periods when they were no longer insured. More than ILS 1 million was recovered on a single group scheme, from a check that was looking for something else. How the exposure was computed and the databases joined is told in our article on claims leakage.
Make every important number explain itself
The method has no secret ingredient. Every important number is asked to explain itself, and the work does not move on until it has. Seven questions do most of the work:
- Is the value possible? An age of 190, a negative exposure, a date of care before birth cannot exist. The domain of each variable is declared before looking at the data; between impossible and common lies a band of values that are possible but rare, such as ages around 100, and those go to an expert, not to the bin.
- Is the combination coherent? A five-year-old smoker, a date of loss outside the period of cover, an amount paid above the amount claimed: valid in each column does not mean valid together. Official statistics has formalised such edit rules since Fellegi and Holt.
- Does the distribution have the shape it should? Two heads with a gap between them often mean two units or two populations, such as amounts in cents next to amounts in units; a value repeated far more often than any other is often a code, 9999, −1 or 0 written for “unknown”, rather than a fact. Declared rules turn such codes into missing values, which are then imputed properly; the same value written fifty ways is reconciled with dictionaries and an expert.
- Do the sources reconcile? Totals must agree from one system to another and records must find their match: a claim with no cover, platforms whose reported sales add up to more than the company sold. Each system can look consistent on its own while the error lives between them.
- Does the relationship survive the right statistical assumptions? Twenty variables with no link to an outcome, each tested at the 5% level, gave at least one “relation” in 62.5% of our simulated studies, and five rows of one customer are not five customers. Our article on correlations measures both traps.
- Is time manufacturing the correlation? Two series that both trend look related whatever their link: on 200 pairs of independent random walks, the usual test declared a relation in 80% of them. Dates must also follow their natural order, and no value may be used before it could have been known.
- Is the finding driven by one corrupted period or one record? A day when every detector turns red points to one cause upstream; a correlation that moves from −7% to +71% once the corrupted periods are set aside was reading the errors as much as the process. And a total can be right because the errors of its parts offset each other.
None of these checks is automatic. Each one is declared by the analyst and written with the business: the domain of each variable, the rules that cross them, the sources that must agree. A tool can run them on every row; only someone who knows the data can write them.
Preparation decisions are modelling decisions
Cleaning, encoding, imputing and setting outliers aside are often treated as chores before the real work. They are modelling decisions, and their errors do not show: the model runs, the score looks fine, and the reasons it gives are wrong. In the simulation of our imputation article, filling missing values with the mean gives a correlated variable with no effect of its own a coefficient of 0.87 instead of 0; deleting large claims makes a severity model look better and the tariff too cheap, as our article on outliers explains.
Preparation is also the only moment when every value is looked at, one variable at a time, then in pairs, then across sources, with a single question: can this be true? A model never asks it. That is why preparation done with rigour finds what no model will: it is where the errors are, and where they are still cheap to fix.
What these checks found in our engagements
In our engagements, these checks found far more than typos:
- A join. For a health insurer, crossing claims, contracts and payments at a level of detail nobody had combined before brought to light more than ILS 1 million paid outside coverage on one group scheme.
- A domain. In one project, values outside the possible domain showed that some databases were wrong; age carries a huge weight in pricing, and the impact was immediate.
- A pair of variables. In one of our projects, five-year-old children were recorded as smokers, which called into question both the age and the smoker variable, one of the heaviest in a health tariff.
- A date. At SGTech, all the outlier detectors turned red on 19 December 2023: by the team’s account, the temperature was not being measured in the right place, and since the process relies on living organisms, every other measurement was affected.
- A ratio of sums. Grouping 74 breeds by risk for a pet insurer, meant to make the tariff readable, showed nine breeds paying out 107% of their premiums in claims: priced below their cost.
- An addition. At Hulken, the sales each advertising platform claimed added up to more than the company actually made.
Each one, with what it led to and why a simple check was enough, is told on our anecdotes page.
What to do with each finding
A finding is not a deletion. Each one gets one of three answers, and the answer depends on what is known, not on what is convenient:
- Correct, when the rule is certain and the true value can be recovered: a declared code turned into a missing value, an amount in cents brought back to units, a payment loaded twice counted once, overlapping cover rows merged. The original value is kept next to the correction.
- Ask the expert, when the value is possible but doubtful: an age around 100, a large claim that may be genuine, two spellings that may or may not name the same thing. Statistics can rank the doubts; only someone who knows the business can settle them.
- Flag it to the owner of the data, when the error comes from the source: a database that is wrong, a field filled by default, premiums refunded by a retroactive cancellation while a claim of the same months stayed paid, a sensor in the wrong place. Correcting the copy without telling the owner leaves the error in place for everyone else, and it comes back with the next extraction.
Whatever the answer, it is recorded: the rule that flagged the value, the decision and who took it, the number of records and the amounts affected. A period or a record is set aside only for a documented reason, independent of the result hoped for; removing data because it is inconvenient is never a reason. And the finding that matters most is often not the error itself, but what it says about the process that produced it.
Why it matters
An error found during preparation is cheap; the same error found after the model is expensive, because everything built on it inherits it. A wrong age moves every premium where age is a rating factor. A smoker status that cannot be trusted weakens one of the heaviest variables of a health tariff. A corrupted period can turn a correlation around, and the conclusion drawn from it with it. A payment outside coverage is money that left and can sometimes be recovered; a group of breeds paying out more than its premiums loses money until the tariff changes.
That is why these checks are not a preliminary to the work: often, they are the work, and what they find can matter more than the model they were preparing. Rigour does not guarantee a finding; when there is one, it makes it much less likely to go unnoticed.
What these checks cannot do
They find what the data can show. A wrong value that is plausible, an age of 42 typed instead of 24, passes every domain and every consistency rule; only a comparison with another source can catch it. A rule is only as good as the knowledge written into it, so the rules are written with the business, and they change when the business changes. A flag is not an error: some payments outside the rules were agreed exceptions, and some apparent outliers are the claims that matter most. And the decision to correct, recover or keep belongs to the people responsible for the data and the contract, not to the analyst.
References
H. Walpole (1754), letter to Horace Mann of 28 January 1754, where the word serendipity first appears; L. Pasteur (1854), speech of 7 December 1854 at the opening of the Faculty of Sciences of Lille; I. P. Fellegi and D. Holt (1976), “A systematic approach to automatic edit and imputation”, Journal of the American Statistical Association; J. W. Tukey (1977), Exploratory Data Analysis, Addison-Wesley; T. Dasu and T. Johnson (2003), Exploratory Data Mining and Data Cleaning, Wiley.
More publications
PublicationsOne value, fifty spellings: dictionaries, fuzzy matching and human validation
A city typed in capitals, a product with a missing letter, “N/A” where nothing was known: free-text fields multiply the spellings of a few real values, and every analysis built on them inherits the noise. Cleaning them is not about making a machine “understand language”. It is about never letting a resemblance become a false business fact: certain rules first, a key that destroys nothing, similarity as a suggestion only, vetoes, and the last word to someone who knows the business.
Read the articleData qualityOne column, several populations: finding the real anomalies without flagging a second population
Payments around 100 and around 3,000 in one column: a usual detection flags the second group (55 of 55 values); ours recognises it and flags none.
Read the articleClaims controlClaims leakage analytics: exposure, joins and what should not have been paid
Exposure–claim reconciliation, coverage and limit rules, duplicates and provider outliers, and how to turn leakage flags into recoveries.
Read the articleLet’s build better decisions together
Tell us about the decision you need to make.
A few lines are enough: your sector, the data you have and what you want to improve. We reply personally with a first view of the approach.
- A few lines are enough
- NDA on request
- Code and documentation handed over


