On first meeting, it's fair to say Spiegelhalter appears a somewhat unlikely figure to spend many months sifting through the output and conclusions of sexuality's great, and often wildly eccentric, pioneers. He has the slightly abstracted manner of the career academic, not to mention the cluttered study, and, as Winston Professor of the Public Understanding of Risk at Cambridge University, he is more likely to be seen explaining why flying is still, statistically speaking, a safe way to travel, than discussing the ins and outs of physical intimacy.
He admits he is "a bit pedantic", but then who wants anything less in a statistician? However, when the Wellcome Collection planned this year's major exhibition, The Institute of Sexology, which explores the work of pioneering sexologists, the curators talked to Spiegelhalter's publishers about a tie-in book, to "cut through the confusion and explore the truth" behind their rhetoric and numbers.
One of the key phenomenons Spiegelhalter investigates is how unreliable assertions about sex end up in the public domain, before being extensively recycled. When I ask him if he has a pet hate among so-called "facts", he cites the old chestnut that "men think about sex every seven seconds", which has no basis in any scientific study. I tell him I loathe the spurious surveys that variously announce women are having the best sex of their lives in their thirties, forties, fifties and sixties, which clearly tell us nothing about desire, but much about how we all live in the moment. I don't admit to him that when I was editor of The Erotic Review magazine, I doctored a poll of our readers so that Margaret Thatcher became the second sexiest woman who had ever lived (rather than the fifth) and that the results were reported as far afield as Germany and Portugal. But I am sure the professor can sniff out my charlatan soul. He is like a ferret after the rat of dodgy data, declaring with a glint in his eye: "This book pretends to be a book about sex, but actually it's a book about biases in statistics."
Spiegelhalter warms to his theme: "The statistics of sex is a challenging area, because it's private, it's secret, we don't know what's going on... we cannot directly observe the things we're interested in. So we have to make inferences, either by asking people by surveys and doing our best to make sure that's accurate, or by inferring what behaviour there is by things we can measure: like how many babies are born, or how many people get diseases."
Accuracy being the professor's key theme, he has even created his own star system in the book for the methodology used to gather data on sex. Four-star ratings are those rare numbers we can assume to be reliable, such as the stats around births, marriages and divorces. Three-star stats are only "reasonably accurate", because they rely on those questioned telling you the truth. Two-star data can "be out by quite a long way", often because the person conducting the research isn't objective, while those questioned about their sexual habits aren't representative of the population as a whole. One-star numbers are simply "unreliable", and a zero rating is awarded to anything that's obviously made up, such as the 18th-century physician Samuel-August Tissot's assertion that losing 30g of sperm is more debilitating than losing 1000g of blood.
Several other Goliaths of sexual research are felled by Spiegelhalter's ratings. Kinsey's blockbuster studies merit only two stars because the "stats are pretty ropey". His eyes light up with mischief when he recounts how three renowned US statisticians of the 50s, including John Tukey, tried to take Kinsey to task when Sexual Behaviour in the Human Male was published in 1948. However, the sexologist refused to answer until all three men had taken his detailed questionnaire on their sex lives. As one author's revenge on three pedants, it takes some beating. Spiegelhalter shakes his head in bemusement and says: "These statisticians are my absolute heroes. It's extraordinary what they had to go through."
There are even sterner reprimands for the data in The Hite Report (much of it gleaned via women's groups and interested parties), which scores a dodgy one star. But, happily, Natsal - the British National Surveys of Sexual Attitudes and Lifestyle - scores a respectable three stars, due to the care taken to have a properly random selection of respondents, and a home-visiting system that ensured confidentiality. The professor applauds the "huge effort to elicit accurate answers about behaviours that might be considered transgressive". He cites the fact that "masturbation wasn't in the 1990 survey. It was included only in the last two surveys."
"Probably the question about how many sexual partners you've had is the one that attracts most attention, because the difference in response between men and women shows they can't both be right," says Spiegelhalter. Quite so. Blokes seem to brag a bit, while females tend to forget a few inconvenient truths. Furthermore, in one enlightening experiment, when women were wired up to fake lie detectors, their answers on the question were a far closer match to the men's. The professor points out that some of the disparity will also come down to any given individual's personal definition of "sex". Bill Clinton declared of Monica Lewinsky he "did not have sexual relations with that woman", and a 1999 survey from Indiana University showed 40 per cent of respondents believed that, like the President, oral pleasure did not constitute sex. But Natsal would disagree: for the purposes of its research, oral engagement is very much part of sex. You begin to see how finickity this sex terrain gets in terms of reliable data.
Even so, Spiegelhalter believes that the three Natsal surveys, conducted between 1990 and 2012, show some clear trends. We Britons do experience a seven-year itch (when relationships are most likely to break up) and, startlingly, established couples are having less sex now than people did when the first survey was conducted. Some people point the finger at social media as our iPads get taken to the bedroom and passion neglected, but the figures don't disclose the "why". We are far more tolerant across all age groups on the question of same-sex relationships than we were two decades ago. However, we are much less accepting of infidelity - or, as Spiegelhalter tactfully terms it, "extra-dyadic sex". He has no intention of being judgmental about the sexual behaviour of others (unless coercion is involved), believing it's the statistician's job to observe behaviour, not comment on morality. He warns against the temptation of making simplistic causal links, which might lead to overly simplistic remedies "with unintended consequences".
Indeed, Spiegelhalter's entire life's work is tilted at steering politicians and the public away from bad data and unfounded deductions. He tells me that "Britain has a fantastic reputation" in statistics and that the subject is "only going to become more and more important... I feel rather strongly that part of our education of everybody should be able to help us know how many statistics are constructed and the manipulations that can be done to them." Who could disagree? With a knighthood awarded in 2014 for services to statistics, Sir David, I feel sure, can be relied on to steer us gently in the right direction.
As I gather my possessions to leave his study, with its tranquil view of the Cam, I can't resist asking if he would ever offer up the intimate details of his own life to a stray researcher?
"No!" he says. "Mind your own business."
• Sex by Numbers is published by Profile Books and the Wellcome Collection.