Showing posts with label Dodgy Science. Show all posts
Showing posts with label Dodgy Science. Show all posts

Friday, 9 October 2009

Dodgy Mathematics Exposed #4: The Difference Between Correlation and Causation

It has been said by one Father Larry Lorenzoni that birthdays are good for you, as those who have more of them tend to live longer. This is an excellent example of today's lesson: the line between correlation and causation, which is becoming so blurred by media outlets as to have become virtually indistinguishable from a sign saying 'Please cross here'.

First, we must explain our terms.

'Correlation' is what happens when two things go together. For instance, it is true that the number of birthdays you have had correlates directly with how old you are (one may have to make a separate category for those born on 29th February, but the principle still holds). It is true that how heavy you are tends to roughly correlate with how tall you are, although admittedly the is getting weaker. It is also probably true that during a flu epidemic the amount of Lemsip sold goes up, while the number of beach umbrellas probably goes down (the latter is called negative correlation).

Two things are 'uncorrelated' if they are unrelated, such as the number of spots on my dalmation (if I had one), and the frequency of buses on the Cregagh Road.

'Causation' is a different thing, and happens when one thing causes another to happen. For example, when people get colds and flus, they buy Lemsip to get rapid relief from their symptoms. I don't though, because I hate Lemsips, but this is not statistically significant. They are also less likely to go to the beach, and so do not need a beach umbrella.

From this you should be able to see that 'correlation' and 'causation' are not at all the same thing, and should not be confused. There are three Important Things to remember here:


1. Correlation may be coincidental

For instance, it has been pointed out that a decrease in piracy worldwide has correlated with an increase in global warming; this does not, of course, indicate that pirates were good for the environment.
Similarly, the rise of reality TV shows roughly corresponded with my own progression through university, but I think we can safely assume that they did not help me in any way and that I would probably have gone through university regardless.


2. Correlation may arise from a root cause
During a flu epidemic, we have seen that Lemsip sales will increase; it is also likely that more people will take time off work. This does not, however, imply that buying Lemsip makes you take a day off, or that having a sneaky day off makes us all so gleeful that we rush out to Boots and crack open the cold rememdies. It is merely that they are both caused by the same thing.
A similar effect happens when you give teenagers injections, and this leads to much suspicion about vaccines such as the cervical Cancer one. If you inject a teenage girl with anything at all, including water, or indeed nothing - if, in fact, you stick a needle in the arm of a teenage girl, you will find that very often you don't hear the end of it for days. This is not the same thing as a side effect of whatever you injected. Therefore it is not correct to assume that a rise in headaches in the days after a vaccination programme implies that the vaccination causes headaches; in reality, it may be that sticking a needle in the arm caused an excuse for a bit of drama in the mind of a 14-year old.


3. Causation may not work in the expected direction
This is where the birthday thing comes in, because Father Larry has extrapolated in the wrong direction: it is not so much that having more birthdays makes you live longer, but that living longer makes you have more birtdays. This phenomenon, which we will call 'Causation Direction Reversal' is a good source of potential humour.


I trust that everyone now understands the difference between correlation and causation, and that you will now be better equipped to make up jokes.

Wednesday, 18 March 2009

The Dangers of Self-Selecting Samples

Now first up, you will have noticed a new addition to the blogroll on the left, with the addition of the excellent JustLife, "a space dedicated to exploring the connections between faith, money, justice and lifestyle". So if you would like to explore the connections between faith, money, justice and lifestyle, then do follow the link and discover.

Secondly, you may have been following, with interest or otherwise, the tales of St Patrick's Day riots in the Holylands area of Belfast. Now, there have been a number of calls for the university to suspend students who were involved, but frankly I wonder why this should be necessary. All I know is that, when I was a student, if I had been seen on national television, being drunk in the street and throwing things at people, my parents would have been hot-footing it up to Belfast and there wouldn't have been enough pieces of me left for the university to bother suspending me. In any case I would probably not have been seen doing any of those things at all, for I would have been in the library gaining both an Education and Curvature of the Spine.

But to get to today's point, which is the latest in our series on Dodgy Mathematics. Our topic today is 'The danger of the self-selecting sample', and I think we shall use our second point from above as an illustration, although it was not, in fact, the inspiration behind the post.

You will be aware that if you wish to find out something about people (let us say, their behaviour when drunk), it is not normally practical to survey everyone; instead one selects a sample of people (let us say 400 persons), and aims to ensure that one's sample is representative (so one selects 200 men and 200 women, all of a range of ages and so on, covering all pertinent factors). One carries out an experiment (plying the people with alcohol) on the sample of people, and then we use a process called extrapolation, which essentially says that if half the people in our sample get drunk and see pink rabbits, then half of all people everywhere will get drunk and see pink rabbits.

However. This is well and good in a laboratory, but it is a little too scientific for the modern media, who are less concerned with truth and more with selling papers, and who therefore do not take time to select a careful sample, but just listen to whoever shouts loudest. Hence we see that all students shown on the news last night were rioting, and we are led to conclude that 'Students Riot'; this ignores the students like WhyNotSmile who are not drunk in the street because they are in the library reading books and not being drunk at all.

I mention this because I came across someone today who had been given new medication and was concerned for the side-effects. She promptly did what one should never do with any sort of medical condition, and Googled it. Now we all know that if you type any random selection of symptoms into Google, and click for long enough, you will sooner or later be told you are going to die, which is not entirely helpful and may not even be true; likewise, if you type in a drug name followed by "side effects", it is unlikely that you will be taken to a message board which consists of messages saying "I took this drug and it was fine", because, frankly, if you take a drug and nothing much goes wrong, you are not terribly likely to tell the internet (unless it asks); if, on the other hand, it turns you into a wibbly mess then you are highly likely to decide that the world needs to know.

So, to summarise, typing drug name + "side effects" into Google is not likely to be comforting, but fortunately is also unlikely to be representative, and is therefore A Bad Idea. Like rioting.

Sunday, 21 December 2008

Dodgy Mathematics Special Edition, Part 2: For The Slow People At The Back

I said I would only explain this once, but some people clearly weren't listening, so I am going to have to say it again. But differently, because this time it's for the slow people.

VAT.

I saw a sign in Carter's on Saturday (I should explain that I was not in Carter's, but going past on the bus; I should also explain that yes, I was in Belfast city centre on the Saturday before Christmas, and that I left quite quickly) which said that they are offering VAT-free prices (or some such; I forget the exact phrasing), by reducing prices by 15%.

But of course this is incorrect, and I shall now explain why.

Suppose that pre-sale, an item cost £100 (this is at the new, lower, rate of VAT).

Now, if they reduce it by 15%, the new price will be:
(£100*85)/100 = £85

However, if they merely removed the 15% VAT, then the new price would be:
(£100*100)/115 = £86.96

which is not so good, so you wonder why they make that claim.

Tuesday, 2 December 2008

Dodgy Maths Special Edition: On Calculating Prices Following The VAT Decrease

Right, I'm only going to explain this once, so please listen carefully.

The UK Government has reduced VAT by 2.5%. So how much of a saving does this represent?

Let us suppose, for ease of calculation, that an item cost £100 on Friday.

Now, we wish to determine how much it will cost today, having had VAT reduced by 2.5%.

Many people have supposed that it will now cost £97.50 - in other words, 2.5% of £100 is £2.50, so you pay £2.50 less.

But this is not correct, because it corresponds to a price reduction of 2.5%, not a VAT reduction of 2.5%.

Instead, we must calculate how much VAT is currently being paid on the £100 item, and then reduce that, and recalculate the total.

So:
£100 = full price
= cost of item + 17.5% of cost of item
= 117.5% of cost of item (because 'cost of item' = '100% of cost of item')

Hence:
cost of item = £(100/117.5)*100
= £85.11

So, if an item cost £100 on Friday, then that price was made up of £85.11 for the item, plus £14.89 for VAT.

However, the VAT is now 15%, instead of 17.5%. This means that the total cost of the item is now:
total cost of item = cost of item + 15% of cost of item
= £85.11 + (£85.11*15)/100
= £85.11 + £12.77
= £97.88

And thus we see that the saving is, in fact £2.12, and not £2.50 as has been proposed.

I think.

Thursday, 7 August 2008

Dodgy Maths Exposed #3: On Using Inequalities To Create False Impressions

Advertising is a skill which must be learned. The trick is to make sure that you make statements which sound good but commit you to nothing; for this purpose, dodgy mathematics frequently comes in handy.

Take an advert I saw in the paper, for a TV: "This TV has a lifetime of up to 100,000 hours". Now, at first glance this sounds quite impressive - your new TV will last up to 4166 days, or 11.4 years (which brings us to some secondary dodgy maths - because 100,000 hours sounds quite impressive, but 11 years, for a TV, isn't all that great. Mine is about 15 and going strong. But I digress). The problem arises with the second glance, when you realise that 'up to 100,000 hours' technically means 'less than or equal to 100,000 hours', which is anything from 0 hours to 100,000 hours. So, really, it could break next week, which isn't so hot.

In fact, the only way the advertisers could be hauled over the coals for making misleading statements is if the TV lasts 100,001 hours, so I'd say it'd be a fairly safe bet that they've made it so it won't.

I find that much the same thing happens with energy-saving lightbulbs. Now, I don't want to discourage anyone from buying these, but I do want to point out that when they say 'lasts up to 10 times as long as a normal bulb', they're not proved wrong if it blows up the first time it's switched on - this is simply an instance of it lasting 0 times as long as a normal bulb, and since 0 is less than 10, they were correct.

This is probably all the fault of the EU, or the Office For The Prevention Of Misleading Promotion, or some such, or else advertisers have just realised they're onto a winner, but of course the phenomenon has spread to everyday talk, and this is how we get Liberal Democrat leader Nick Clegg claiming he has slept with 'not more than 30 women'.

Which sounds (and was heralded by the media as) rather on the enthusiastic side, until you realise that I could make the same claim myself, and not be lying.

Tuesday, 22 July 2008

Dodgy Mathematics Exposed: #2, The Danger Drawing of Conclusions From Absolute Values

Every year around about now the TV Licence people bring out their latest figures on how many people are avoiding paying for a TV licence while still watching TV, and they rank the list according to city. And every year I listen in disbelief when they announce that London is the city with the most TV Licence evaders. If I happen to hear this gem on local radio, it is usually followed by something along the lines of 'and the city in Northern Ireland with the highest number of people avoiding paying the licence was Belfast'.

And every year I dig around in vain to try to find out what point on earth they are trying to convey to us with this information. It is, of course, always said in a tone that implies that the entire population of Belfast always looked a bit dodgy and if it weren't for the moderating influence of the honest villagers then the whole province would be racing headlong to hell in a handcart, so I assume this is somehow related to whatever point they're trying to make.

Now obviously you wouldn't catch 30,000 people in Portavogie failing to pay their TV Licence. But that's mainly because you'd be lucky to find 30,000 people in Portavogie with mains electricity, or indeed 30,000 people in Portavogie at all, outside of The Twelfth.

I dare say that if we did a survey of 'number of people with 2 arms' or 'number of people who had breakfast yesterday', or 'number of people who pretty much anything', Belfast would come first and Drumbo wouldn't. It might not be a winner in absolutely everything - 'number of people who own sheep' being an obvious example - but these are what are known as 'statistical blips' and do not prove anything.

So of course the wider point here is that if there are more people here than there then here will always come higher up than there in most leagues that count the number of people in any given category, and that a far more informative picture would be gained by providing us with the number of people who do these things 'per head of population'. But they don't do that.

Monday, 14 January 2008

Dodgy Mathematics Exposed: #1, The Perils of The Incorrect Underlying Assumption

I meant to mention this before now, but hadn't got round to it. As a mathematician, I am often appalled by some of the ways in which The Glorious Discipline is manhandled in the popular media. So I have decided to expose such lapses when I come across them, for the sake of your education. Our subject today is what we shall call The Incorrect Underlying Assumption. An Underlying Assumption occurs when you assume something and then use that in the process of your analysis; if this Underlying Assumption is Incorrect, your analysis becomes nonsense.

On Boxing Day I was reading The Times (you can't buy The Guardian in Ballywalter; it took a certain level of persuasion to convince my dad that The Daily Mail was not an adequate substitute before we finally settled on The Times, which had a splendid pull-out puzzle section that day) and there was an article about the complexity of various recipe books (clearly a Boxing Day filler).

What they had done was to analyse various recipe books and see how easy they were to understand. So far, so good. But the way they had done this (I say 'they', I mean some scientists with too much time on their hands, not the people at The Times, who were just reporting the story) was that they had compared the number of big words in each, where a 'big word' was one with three or more syllables. They also counted what they described as 'technical terms', such as 'simmering'. The one with the least number of big words and technical terms was deemed the simplest, and therefore the winner.

So the Underlying Assumption here is that words with 3 or more syllables are more complicated than words with less than 3 syllables. Hence, broccolli is more complicated to cook than duck.
To use mathematical parlance, complexity of cooking is directly proportional to complexity of spelling.

One can back up the Underlying Assumption by pointing out that beans on toast is quite simple to cook, whereas ratatouille is rather more complex.

Now the difficulty which arises here should be fairly obvious: if your recipe requires the cook to simmer cauliflower, for instance, you need to tell people to... well... simmer the cauliflower. There is no way to say 'cauliflower' in a way that has less than 3 syllables; indeed, some of our English viewers will pronounce it with 4. Likewise, if you need an aubergine, you need an aubergine, and you can't just tell people to chuck in a kipper instead, even for the sake of simplicity.

This approach will lead to a recipe for coq au vin being simpler than one for mashed potato, which would be nice if only it were true. In fact, on this basis, a bowl of Weetabix is the height of sophisticated cuisine, especially if you throw a handful of sultanas on top and wash it down with a lingonberry smoothie. You are not advised to even attempt to use tortellini, avocados or coriander without supervision; any attempt at anything vegetarian and you could do yourself a mischief. On the other hand, you're quite safe to plough ahead with souffles, meringues and pastry, which are all straighforward.

Now, clearly this is nonsense, and the reason is that our Underlying Assumption is Incorrect. Sauerkraut may be more complicated to cook than peas, but this is not because it is a longer word.

All of this reminded me of a piece of GCSE coursework where we had to compare two newspapers and decide which was more complicated to read. So we all bought our copies of The Sun and The Times, and hypothesised that 'The Times will be more complicated so it will have more big words' and then proceeded to chart pretty graphs of how many letters there were in each word of a corresponding story in each paper. But of course The Sun had more big words, mainly things like 'babelicious' and 'snogtastic', which blew our hypothesis right out of the water; this was because it rested on our Underlying Assumption that a big word is more complicated than a little word, which was Incorrect (if you're still having doubts, please define both 'qat' and 'caravan' for me, without reference to a dictionary or thesaurus, using the comments link below).

And so we see how the Incorrect Underlying Assumption leads us to nonsense, and I hope we have all learned to question what we think is true before we start drawing conclusions from it.