The US Census Bureau has just released a major publication “Income, Poverty and Health Insurance Coverage in the United States: 2012″ that has set much of the US political and economic blogosphere alight. “The incomes of the middle class have stagnated!” they cry, pointing to a statistic that shows the median household income in 2012 down from a real terms peak of $56,080 in 1999 to its pre-recession peak of $55,628 in 2007, to a measly $51,017 last year. That means the median has grown just 3% since 1991, when the last major recession hit the bottom. On the headline measure, incomes are actually below 1989.

I do not doubt that the middle classes (and the poor!) have been hit hard by the recession (although in the UK the story might not work in exactly the same way). But to tell this as a general story of middle-class decline seems to be stretching it massively. I don’t just mean because we can now use excellent services like Facebook, Twitter, Google, and so on for free. Having said that, I think Tyler Cowen massively undercounts the importance of free internet services—we now have near-instant, cheap or free access to basically the entirety of human artistic output. A proper measure of consumption or income that included these would give a much more optimistic result.

Still, this isn’t my key point. We use median statistics because incomes are very unequally distributed—the US had a Gini coefficient of 0.463 in 2012, while the UK’s was 0.32 in 2011-12. A mean (like GDP/capita) does not tell us anything about how gains are distributed, it just tells us how big the gains have been, compared to the size of the population. A median, showing us the middle point, is less easily skewed. But a median can still be extremely misleading under certain circumstances.

One of those circumstances, and an empirically highly relevant one, is when there is mass immigration to a country. According to one official dataset and my simple calculations, legal inward migration to the US was 13m between the 1999 peak and 2011 (inclusive). Presumably illegal migrants aren’t counted in the figures, but for completeness we might note they seem to number more than 12m. If we assume that inward migration is typically lower skilled than the US population as a whole (which seems highly plausible), then it’s entirely possible that a median falls while every individual in the population becomes much richer. Indeed, this is particularly true if outward migration is largely made of particularly high-skilled people (which also seems plausible). The income per natural concept, developed for a different reason, but relevant, is the number we’d want to check to look at the real trends in incomes when the make-up of the population is changing significantly.

Immigrants to the USA have much higher incomes than they had before. US citizens’ incomes also rise, not just because migration boosts their wages but also because of the general effects of economic growth—GDP/capita is significantly up on 1989, 1991 or any of dates picked to generate shocking income statistics. Everyone is better off, but the statistics need not reflect that. Of course, since I haven’t picked the statistics apart absolutely conclusively, I can’t say for sure that this effect is actually driving the divergence between apparent prosperity for US middle classes and the statistics implying penury. But of course, without that level of digging, neither can the het up US wonks.