Wednesday, December 9, 2015

B is for Bayesian Inference

Just  a note to say that I guest blogged for the University of Oxford's Mathematics Alphabet this week, on B is for Bayesian Inference.  Do check it out!

Thursday, October 16, 2014

Ebola hunting

Here's a quick prediction for what happens now that the UK has started screening people for Ebola at Heathrow (soon to be extended to other airports and terminals).  They'll find a lot of people with minor stomach bugs of some sort.

Ebola virus
Image: CDC

Wednesday, October 15, 2014

What price a preposition?

The headline to this article made me aware of a pretty big ambiguity in its contents: there's a big difference between saying that "in 30 seats UKIP are likely to win", and "UKIP are likely to win 30 seats". 

To see this, consider the statement: "Chelsea are likely to win every game they play this season".  Interpreted one way, you're just saying that Chelsea are favourites in each game they play (plausible).  Another meaning would be that Chelsea are likely to win all the games they play, which is exceptionally unlikely (no-one has ever come close).

Of course the results in different seats in general elections are strongly correlated, much more so than football matches.  But I'd still like to know what exactly the Guardian means.

Sunday, October 12, 2014

Can a gamble ever be right or wrong?

A couple of weeks back I was feeling fairly smug, having put a bit of money on a 'No' vote in the Scottish referendum.  I then placed a few quid on UKIP to win the Heywood and Middleton by-election last Thursday, which they didn't.  But the latter result was quite close, so I felt that somehow it had been a 'good bet' to have made.  So what makes a person right or wrong to have placed a bet in the first place?  (Mathematically that is, leave your morals at your home page.)

Sunday, January 26, 2014

Frog kissing. Or, why do we never learn?

A friend pointed me to this story about the average number of men (or rather frogs) a woman has to date before finding their 'Prince Charming' (apparently it's 15).  Let's leave aside for now how they came up with the number: I've no doubt the methodology conforms to the most rigorous standards that we've all come to expect from the internet.  I thought that this paragraph might give some people hope:
If you've made out with 11 men, great news! A new survey suggests you're only 4 away from Prince Charming. On average, anyway.
It's now my duty to crush that hope.
A prince
Distinguishing princes and frogs can be
difficult at first glance [Photo: Allen Warren]

The bad news is that (even if the rest of it is correct) the survey absolutely doesn't say that.  If you've been in 11 disastrous (but possibly ultimately affirming) relationships, you've guaranteed that the total number you end up in is at least 11.  But it could have been fewer than that (it happens apparently), so the possibility that you stayed with your childhood sweetheart is included in the average which arrives at 15.  Once you exclude that possibility, the average will only increase.

Friday, November 22, 2013

Just Instrument It

(With apologies to macro-economists.)

The amount of time you spend in education predicts your earnings quite strongly, and it's generally agreed (Simon Cowell aside) that if you want to do well in life, staying in education for longer is a good idea.

But how much effect does it have?  We could look at a survey of people's incomes and group them by education level, but this doesn't give a causal effect.  It might tell us that people who have a masters degree earn more during their lifetime, on average, than those who don't.  This could be because people from wealthy backgrounds can afford the tuition for a masters degree, and also have pals in the city who can help them get a big salary afterwards.  Or perhaps people who do masters degrees work harder than the rest.  We can't easily tell the difference: this problem is called confounding.
We can't tell whether time spent in education level causes earnings
to increase, or there's a third factor which affects both.

Thursday, November 14, 2013

But is it causal? Defining causality

As I alluded to in my last post, defining what it means for $X$ to cause $Y$ is no simple task.  It is not an idea that can be defined in purely probabilistic terms, because it says something about the mechanisms underlying the system we are studying, and what will happen if we interfere with that system in some way.

Consider the example given at the end of the last post.  The headline was:
How a short nap can raise the risk of diabetes
The implication of this is that the risk of diabetes increases because of the nap.  But what does this mean?

Friday, November 8, 2013

If correlation isn't causation, then what is?

I've started to get a little tired of writing entirely about media shenanigans, and in all likelihood so, dear readers, have you tired of reading about them.  So today I'm going to provide one of the 'educational pieces' alluded to in this blog's description; specifically I'm going to start talking about causal inference, which is the driving force behind the research I'm lucky enough to be paid to do.

We hear a lot in statistics classes (if you're inclined to go to them) and places like this blog, that "correlation is not causation."  Packaged within this pithy but stern warning is some very sound advice: just because you observe a relationship between two things doesn't tell you anything about the mechanism (if any) which creates that relationship.

Friday, September 13, 2013

The Monty Hall Problem

It's great to see pieces on familiar mathematics puzzles in the mass media, so I was pleased to see this article about the Monty Hall problem on the BBC News website.  However, I'm moved to write a little piece about this, because I think it uses a rather carelessly analogy.

A brief summary of the problem.  You're in a game show, and there are three doors; behind one of the doors is a prize, behind the other two is nothing (or possibly worse, a goat).  The procedure is as follows every time the game is played:
  1. you choose a door, say number 1 (but don't see what's behind it);
  2. the game show host, who knows where the prize is, opens one of the other two doors, say number 2, and reveals nothing;
  3. the host gives you the opportunity to either stick with your choice or door 1, or move to door 3;
  4. your choice is revealed.

The question is - should you stick, or switch, or does it make no difference?

The BBC video (with Marcus du Sautoy and Alan Davies) is very clear, and so is most of the article.  However the beginning includes a reference to Deal or No Deal: the reason I don't like this is that in Deal or No Deal the banker doesn't know where the money is.  As we will see, this point is absolutely critical to getting the right answer.


Wednesday, June 5, 2013

Twins, or In which newspapers mess up odds calculations (again)

This BBC piece interviews a couple who've been 'blessed' with three sets of twins (rather you than me).   The caption states that
Doctors told them the chances of having three sets of twins was 500,000-1.
Doctors that don't know much about genetics, perhaps.

Friday, April 19, 2013

Extreme Comparisons

This is just a fairly short note on what has been covered in other cases elsewhere.  The BBC reported today that Tameside in Greater Manchester is the "UK's heart disease capital".  This is on the basis that the rate of deaths from heart disease between 2009 and 2011 was higher than anywhere else, at 132 per 100,000 people.  The data come from the British Heart Foundation, and I couldn't immediately see how to get at it.

The article mades a particular point of noting that this rate is three times higher than that of Kensington and Chelsea.  This sounds very dramatic, but it really isn't, so don't go moving just yet (even if you can afford a house in Kensington).

Friday, March 22, 2013

Smoking rates: even the 'good guys' shouldn't be trusted

The Guardian reports today that the number of children under 16 (more precisely aged 11-15) taking up smoking has has risen by 50,000 in a single year.  This is a slightly irritating headline simply because the number is without context, but the sub-headline is more helpful: from 157,000 to 207,000, which is quite dramatic: a 32% increase.

First obvious question - is this statistically significant? Well, let's have a look at the research quoted by the Guardian, which comes from Cancer Research UK.  Their Figure 6.10 immediately arouses suspicion.  There does appear to be an uptick in the figures from 2010 to 2011, but they remain below the 2009 figure!  The overall trend in the numbers over the past 10 years is clearly downwards.  So either we believe that the number of children taking up smoking fell and then rose dramatically in consecutive years, or else we might just be witnessing a bit of noise in our data.

Monday, October 29, 2012

Independence, independence, independence

Multiplying probabilities without any thought is a dangerous game.  Just look at this piece in Rolling Stone, referenced in this Guardian article.
...warmest May on record for the Northern Hemisphere – the 327th consecutive month in which the temperature of the entire globe exceeded the 20th-century average, the odds of which occurring by simple chance were $3.7 \times 10^{-99}$, a number considerably larger than the number of stars in the universe.

Tuesday, October 16, 2012

Horse Racing and Coincidence

Just penned this to the BBC about why their piece on a jockey winning seven races in a single day quotes the wrong odds.
In your article on Richard Hughes winning seven races in a single day, you quote the odds of this event as being 10,168-1.  Whilst undoubtedly a fantastic achievement, these odds are incorrect, since they they ignore the fact that Mr Hughes raced in eight races that day.  The chances of him winning 7 out of 8 races (or more) is about 1,257-1, which is a bit more modest.  In particular, it seems fairly unlikely that someone would place a bet on the rider winning these particular seven races, and not the eighth.

Thursday, October 11, 2012

Fruit, Vegetables, Health and Happiness

Whilst perusing the Daily Mail today (my excuse is that it's next to the espresso machine) I saw this interesting health advice:
Forget five a day: Now scientists say you'll be healthier and happier eating seven daily portions of fruit and veg.

The phrase "scientists say" is always a red light. 

Tuesday, October 2, 2012

Trust your instincts

As Obi Wan almost said: "Let go your conscious self and act on instinct.  Your news articles, government agencies and other organisations can deceive you, don't trust them."

My brother Andrew (@andysstudy) has been studiously following this advice since 1977, and sent me this tweet:
See below. There are 73m children (u15) in EU I find it hard to believe 1:73 goes missing every year? http://www.euronews.com/2012/10/01/has-anyone-seen-my-child/

Thursday, September 13, 2012

Road safety - how not to reason from data

My apologies for going quiet over the summer.  I've been in China, and they're not too big on blogs there (blogger is blocked).

Just a short post here, on something fairly obvious.  Here's an extract from post number 51 by Cambridge News' Cycling Blog on speed limits.
In Great Britian in 2011, 7 people were killed on a road with a 20 mph limit. 636 killed in a 30 mph limit. 289 people were seriously injured in a 20 mph limit, 13,168 in a 30 mph limit... Yes, these are large numbers. But it is the proportions that matter here... So that is proof then. Lower speed limits means fewer people killed.
[In case you're wondering, there's no irony in the last sentence.  At all.]  I assume you're all thinking the same as me by now.

Friday, July 20, 2012

Polygraphs and Sex Offenders

Just a short post on the news story that a pilot scheme which administers polygraph tests ('lie detector tests') to sex offenders on probation has been deemed successful, and the Ministry of Justice plans to roll it out nationwide.

The MoJ's research seems reasonable enough: the pilot scheme took place in the Midlands, and comparison groups of offenders were selected from other areas.  The assignment was not randomised, which is unfortunately all too common, but the comparison group was similar to the treatment group on the basis of the most obvious covariates (age, original offence, risk or reoffending, criminal history, etc.).  Based on a quick-ish reading of the paper it seems fairly solid.

Wednesday, July 18, 2012

Reading too much into one number

The BBC points out that deaths from road accidents in the UK increased last year for the first time in 10 years.  In total 1,901 people were killed during 2011, which is 51 more than in 2010.  This is certainly not good.



But is it surprising, in a statistical sense?

Tuesday, July 3, 2012

Sigma-tised

Is it just me, or is everyone completely unable to explain what a confidence interval is?

The Higgs Boson is back in the news again, here's a Nature News article discussing Cern's latest discovery, which is that
The data contained “a significant excess" of collision events at a mass of around 125 gigaelectronvolts...
 Physicists have maintained that they will not announce the discovery of the Higgs until the signal surpasses 5 sigma, meaning that it has just a 0.00006% chance of being wrong. The ATLAS and CMS experiments are each seeing signals between 4.5 and 5 sigma, just a whisker away from a solid discovery claim.
This is wrong.