Wednesday, 2 June 2010

Druids Demonstrate Regression to the Mean perfectly

I once heard of an experiment that a friend of mine (an anti-speed camera campaigner) used to do when he was giving a presentation. He would get everyone in the room to randomly generate a 2-digit number (not sure how, exactly, maybe he used to carry some sort of 10-sided dice with him). He would then give everyone who rolled more than 80 a big picture of a speed camera and got them to generate a second set of numbers. Lo and behold, only a small fraction (on average around 1/5) of those carrying speed camera signs had high levels of deaths. The speed cameras had worked!

This is the purest way I've ever seen to explain the phenomenon of 'regression to the mean'. It's a well-known phenomenon, and explains a lot of things, from why test scores at the worst schools tend to improve the next year, through why patients who visit a homeopath seem to feel better, to the Sports Illustrated Jinx.

However, the Austrian motorway authority seems never to have heard of it. They recently asked some druids to reduce the number of fatalities at a few accident blackspots by burying some magnetic slates. The results were a roaring success:
Austrian motorway authority ASFINAG said it was sceptical at first and kept the project a secret. But it went public after the druids’ efforts cut the number of deaths at the notorious crash site from six a year to zero in two years.
I don't think there's much more to say.

Sunday, 30 May 2010

Why is the suicide rate so low at Foxconn.

Foxconn is a chinese company that you may have heard a lot about recently. There has, according to the BBC been "a string" of suicides there recently. According to the Times there is a "spiralling suicide crisis". Reuters says there has been "a spate of employee deaths".

10 people have committed suicide this year at a particular Foxconn factory in China (where a lot of parts for the iphone are made, apparently, which I think is why this is supposed to be a news story). The factory employs 300,000 people. I make that a suicide rate of (approximately) 7 people per 100,000 per year. The suicide rate in China is about 13 people per 100,000 per year. In other words, working for Foxconn cuts your chance of committing suicide almost in half!

How is it possible for every single person everywhere in the world's media to have gotten this story exactly backwards? There are a lot of very clever people suggesting "explanations" for the suicide rate at Foxconn. Unfortunately, they're trying to explain why it's so high, when they should be doing the opposite! This should lead us to seriously doubt these people's 'explanations' when the phenomena they're describing happen to be real. If your theory can explain anything, it has no explanatory power at all.

However, I think the main story here is how this became a story. What is going on? Why did someone decide to report the suicide rate at Foxconn instead of, say, the suicide rate among Tesco employees (another company which employs around 300,000 people, at least in the UK). And how did no-one notice that what they were reporting was in no way interesting.

Saturday, 29 May 2010

Deadweight Loss

I'm currently reading Joel Waldfogel's book "Scroogenomics". In it, he expands on some of the points made in his classic research paper "The Deadweight Loss of Christmas". The basic premise is that people (especially distant relatives) don't know what you want as well as you do, so any gifts they buy you are less desirable to you than anything you could have bought yourself with the money. He has plenty of facts and figures to back up this eminently plausible theory, and I think a serious point to make.

However, he does have at least one minor slip. In describing what deadweight loss is, he says the following:
If a dollar disappears from my pocket and appears in yours, it's a loss to me, but it's not a deadweight loss to society. If you take my dollar and destroy it lightling your Cohiba, then it's a deadweight loss.
This isn't quite right, for the simple reason that dollars only have purely symbolic value. Burning a dollar bill is a genuine loss of $1 to the burner, but can't possibly make society as a whole worse off... you can't eat money. So who benefits? As the wikipedia article on burning money explains, everyone. Burning a banknote has a (very) slightly deflationary effect, so makes all of the money in everyone else's pocket worth slightly more.

I first encountered this idea in Steve Lansburg's excellent Armchair economist, and it seems to be pretty standard fayre in economics literature, so how did Waldfogel miss it? Or did he think that burning money seemed more wasteful than any other genuine example of a deadweight loss, so sacrificed accuracy for impact?

Monday, 24 May 2010

What exactly are confidence intervals?

So, a friend (who would probably prefer to remain nameless) is currently looking for jobs in finance, and sent me some sample interview questions that they like to ask people. One of them is the following:
A drug trial gives the result that the drug works better than the
placebo, with 95% confidence. What exactly does this statement mean? What further assumptions are needed to be able to deduce that the probability of the drug working is actually 95%?
Now, I wasn't entirely sure I knew the answer to this question. I thought I did, but despite having studied rather a lot of statistics, I don't think anyone ever actually told me what a 95% confidence interval was, so I did what everyone does faced with such a situation, and checked the wikipedia article. Wikipedia is singularly confusing on the matter, but it gives the answer as roughly the following.

Thursday, 20 May 2010

My Favourite Limericks (of which precisely one is actually a limerick)

Here's the actual limerick:

There was a young man from place B
Who satisfied Predicate P,
He performed action A,
In adjective way,
Resulting in Consequence C.

Tuesday, 18 May 2010

Wikipedia can't add up

Have a look at this list of best-selling books. In particular, look at the Harry Potter books. There is one Harry Potter book in the list of best-selling books. Harry Potter and the Deathly Hallows, which has sold approximately 44 million copies. Harry Potter is also listed as the best-selling series of all time, with 400 million total copies sold.

In order to see why there is a problem with this, you just need to know that there are 7 Harry Potter books, and understand the Pigeonhole Principle.

There is a (sort of) explanation of the problem in the 'talk' page of the wikipedia article, but the inconsistency remains on the initial page. This actually highlights a fairly major problem with wikipedia's epistemology. The inconsistency has to remain because there's no 'credible source' for the figures for the other individual books. So even though everyone knows that the article is wrong, it can't be corrected because this would constitute 'original research'. Hmm... just how credible does a 'credible source' have to be? Will a mathematical proof do?

How to sample randomly

I was once told that 'duration of unemployment' figures were collected in the following way: people were telephoned at random during the day. If they answered, they were asked if they were unemployed. If they said yes, they were asked for how long they had been unemployed. Before you read any further, can you see what is horribly, horribly wrong with this method of data collection? (There are several things wrong with it, but one of them renders it entirely useless)

Before I give you the answer, a brief detour. When I was at school, I did a piece of statistics coursework (I think it was for GCSE's) in which I compared the average sentence length in a French text to an English text. I can't remember exactly which texts I chose, I think it was newspapers of 'equivalent' quality, but that's largely irrelevant. In order to estimate the average length of sentences in each text, I adopted the following method: pick a word uniformly at random from the text and count the number of words in the sentence containing it.

I had collected around 100 sentence lengths before I noticed the utter ridiculousness of this method. In case anyone hasn't spotted it yet, this 'random sampling' is guaranteed to massively overestimate the average sentence length in any given document, as the probability of any given sentence being chosen is in direct proportion to its length.

Consider the following passage:

"The quick brown fox jumps over the lazy dog whilst the five boxing wizards jump quickly over my lovely sphinx of quartz. Jesus wept"

 If we pick a few random words from this and compute the 'average' sentence length of the sentences that contain them, we're going to come up with something very close to 20 (if we pick every single word, we'll get 20.3333)  The actual average sentence length is 12.

Now, if you didn't immediately spot that this was the key problem with the method of collecting unemployment data I mentioned in the first paragraph (there are problems with telephone polls in general, of course, but they are essentially insignificant compared to the problem with the sampling method), this should make you worry about how easy it is to slip *exceedingly* dodgy statistics past people who aren't paying attention. I'll post a few examples of my favourite 'correlated for spurious reasons' statistics in another post later this week.

As an aside - if you do actually collect the data in the way suggested, you can presumably still get some information about the distribution you're studying - what's your best estimator for the mean? And what assumptions do you have to make about how the data are distributed?