A little learning is a dangerous thing. Anyone in any doubt over the truth of Alexander Pope’s dictum might want to peruse politicians’ careless use of official statistics. It’s a malady that has infected even Downing Street. Last month, David Cameron wrote a newspaper article in which he attempted to shoot Ukip’s fox by claiming foreign workers were no longer displacing natives in the jobs market.

The Prime Minister quoted national statistics as evidence: “While most new jobs used to go to foreign workers, in the past year more than three-quarters have gone to British workers”.

That prompted Jonathan Portes, the director of the National Institute of Economics and Social Research, to complain to the UK Statistics Authority watchdog, arguing that the Prime Minister’s words misrepresented official data. The watchdog’s head, Sir Andrew Dilnot, wrote a response this week which explains why Mr Portes’ concerns were warranted and why Mr Cameron’s claim was incorrect.

Click on graphic above to enlarge

Here are the essential facts. The Office for National Statistics each month publishes the estimated number of people in employment in the UK. The change in the level of this series represents the growth, or contraction, in the number of jobs across the entire economy. But the ONS also publishes estimates of the number of UK nationals and non-UK nationals in employment each month.

What the Prime Minister (or more likely his advisers) did was to note the annual changes in the number of UK nationals and non-UK nationals in employment in recent years and then to translate these figures into a share of the total change in the number of jobs across the economy in each year.

The table shows what this exercise would produce. In 2013-14 it would appear that, of the 741,000 increase in jobs across the economy, some 563,000 (or 76 per cent) were accounted for by UK nationals. That’s apparently up from 2010-11, when UK nationals accounted for 187,000 (or just 44 per cent) of the additional 421,000 jobs across the economy over that year.

From this table, the Prime Minister evidently drew the conclusion that the proportion of “new jobs” going to non-UK nationals used to be significant but has since fallen back.

But this is based on a misunderstanding of the statistics. As Mr Dilnot carefully pointed out in his response, the change in the headline figures represents not “new jobs”, as the Prime Minister put it, but the net change in the number of jobs in the economy. The distinction might sound tediously academic but it is actually vital.

The change in the number of jobs in the economy does not merely reflect, as one might naively assume, the number of people who move into employment from unemployment over a given period. It also reflects the people who move from inactivity to employment. And there are also flows in the other direction that feed into the headline figure: people moving from employment to unemployment and people moving from employment to inactivity. As the second chart makes clear, these flows into and out of the employment are vast. In the three months to March, more than 1 million people entered employment, while 779,000 people left employment. That left a quarterly change in the employment stock of 259,000. The net new jobs figure, then, is the difference between two very large numbers.

To understand this is to grasp the reason one must be careful not to talk about the number of “new jobs” the economy has created based on this headline figure. That net new jobs figure can rise strongly if the number of people entering employment remains the same but the number of people slipping from employment to inactivity falls (which has indeed been happening in recent years). It also implies that the Prime Minister’s calculation – splitting the net new jobs figure into shares belonging to UK and non-UK workers – doesn’t make sense as a way of representing the relative success of the two groups in finding work. Indeed, it risks stoking the potent fear that foreigners are “coming over here and taking our jobs”.

There is an analogous confusion here with the official migration statistics that are brandished in the political debate. The Conservatives responded to public anxiety about immigration before the last election by pledging to reduce net annual migration flows to “the tens of thousands”. But they have been unable to do so. The net migration figures have, in fact, barely changed since 2010 in spite of the Coalition’s cap on migration for people outside the European Union. And one of the reasons is that emigration rates have fallen alongside immigration rates over the past four years. Net migration is used a shorthand for “foreigners entering Britain” but it also reflects the numbers leaving, or staying, in Britain.

The impact of immigration on the labour market is a serious subject. And there has been some serious academic research on it. Work by Jonathan Wadsworth at the London School of Economics suggests that around 17 per cent of new hires in the economy have been going to people born outside the UK. That’s roughly in line with their share of the workforce.

Research by Stephen Nickell and Jumana Saleheen suggests that immigration does seem to have a small negative effect on wages for those at the unskilled end of the labour market. Yet other work strongly suggests that migration inflows are good for GDP growth per head and also productivity.