Ninety-seven percent of scientists agree: Climate change is real, man-made and dangerous. President Obama tweeted that, and it has been repeated by countless others. It is tempting for a politician to claim that 97 percent of experts agree with you. But do they?

The 97 percent claim was taken from a study paper by Australian John Cook, Climate Communications Fellow for the Global change Institute at the University of Queensland, and his colleagues, published in the journal Environmental Research Letters in May, 2013. The paper says nothing about the would-be dangers of climate change and it counts the number of publications, rather than the number of scientists, in support of human-made climate change. Never let facts get in the way of a good story.

The paper is a treasure trove of how-not-to lessons for a graduate class on survey design and analysis: the sample was not representative, statistical tests were ignored, and the results were misinterpreted.

What was an incompetent piece of research has become a highly influential study, its many errors covered up.

Some of the mistakes in the study should be obvious to all. There are hundreds of papers on the causes of climate change, and thousands of papers on the impacts of climate change and climate policy. Cook focused on the latter. A paper on the impact of a carbon tax on emissions was taken as evidence that the world is warming. A paper on the impact of climate change on the Red Panda was taken as evidence that humans caused this warming. And even a paper on the television coverage of climate change was seen by Cook as proof that carbon dioxide is to blame.

Cook and Co. analysed somewhere between 11,944 and 12,876 papers – they can’t get their story straight on the sample size – but only 64 of these explicitly state that humans are the primary cause of recent global warming. A reexamination of their data brought that number down to 41. That is half a per cent or less of the total, rather than 97 percent.

The remainder of Cook’s “evidence” is papers that said that humans caused some climate change and, more importantly, papers that Cook’s colleagues thought said as much.

There is vigorous debate about how much humans have contributed to climate change, but no one argues the effect is zero. By emitting greenhouse gases, changing the landscape, rerouting rivers, and huddling together in cities, we change the climate – perhaps by a little, perhaps by a lot – but not one expert doubts we do. However, a true consensus – 100 per cent agreement – does not serve to demonize those experts who raise credible concerns with the state of climate research.

The trouble does not end there. Cook has been reluctant to share his data for others to scrutinize. He has claimed that some data are protected by confidentiality agreements, even when they are not. He was claimed that some data were not collected, even when they were. The paper claims that each abstract was read by two independent readers, but they freely compared notes. Cook and Co. collected data, inspected the results, collected more data, inspected the results again, changed their data classification, collected yet more data, inspected the results once more, and changed their data classification again, before they found their magic 97 percent. People who express concern about the method have been smeared.

We would hope that the president of the United States of America does not spend time checking such trivia. That is the job of the editor of the journal, Dan Kammen of the University of California at Berkeley, who unfortunately has chosen to ignore all issues I and others raised about them. Similarly, the journal’s publisher, the Institute of Physics, and Cook’s employer, the University of Queensland, have turned a deaf ear to my concerns. What was an incompetent piece of research has become a highly influential study, its many errors covered up.

And for what? If Cook’s results are to be believed, 97 percent of experts agree that climate change is real and largely human-made. This does not tell us anything about the risks of climate change, let alone how these compare to the risks of climate policy.

That is a difficult trade-off, and it should be informed by the best possible science rather than dodgy work like Cook’s.

Richard Tol is a professor of economics at the University of Sussex and the Vrije Universiteit Amsterdam. He has been involved in the IPCC since 1994.