### Lies, damned lies, and Excel formulae

In Excel to use a function you just type into a cell something like "=average(1,3,5,7,9)" and magically you get the answer (5 in this case). So, what could be easier to do than type in:

"=stdev(1,3,5,7,9)" and see the answer appear? The trouble is that it doesn't. The answer pops up as 3.16, not 2.83 as I was expecting. Just in case you doubt my ability to calculate a standard deviation, feel free to do it the old-fashioned way by hand, and you will see that you get 2.83, not 3.16, so what is going on? After digging around the Excel help and chatting to a mathematician friend to check I was not going completely mad, I discovered that there are actually two different standard deviation functions in Excel, one designed for where you want the whole sample set measured, and one where you want to estimate a large population from a sample, which has a slightly different formula. Now I may be getting a bit slow these days, but I did do a maths degree and yet this distinction had eluded me all these years, so I doubt I'm the only person out there unaware of this difference. If you were the person at Microsoft naming Excel functions, which do you think that people would think was the "normal" version, "STDEV" or "STDEVP", which is what they actually named the function that calculates the standard deviation of a whole population. I am guessing that not too many of us go "aha, I'll try "=STDEVP I expect that will be it".

Now this may seem like a lot of fuss about an esoteric mathematical function, but be aware that standard deviation is one of the most commonly used statistical functions, used to look at samples of population, mechanical failure rates, delivery errors, temperatures, patient response rates, you name it. People take serious decisions based on statistics: which drug to put forward for clinical trials, traffic planning, machine maintenance and endless others; standard deviation is the most commonly used tool in "statistical process control", widespread in the manufacturing industry. Given that the most of the modern world uses Excel, I find it pretty surprising that a sizeable proportion of the world has been using the wrong standard deviation function for the last twenty years all because some idiot in Seattle chose a "precise" name rather than the obvious name that most of us would have chosen.

I suppose this is only what I should have expected from a product who thinks that 1900 is a leap year. Try the formula "=DATE(1900,2,29)" and watch it happily display the 29th February 1900. As we should all be aware after the fuss over Y2k, 1900 is NOT a leap year (leap years are every four years, except centuries which are not, expect every fourth century, which is, so 1600 and 2000 are leap years, but not 1800 or 1800 or 1900). The moral of this little story: don't take everything on trust!

## 3 Comments:

Just to let you know, I recently finished an undergrad statistics course. During the course, we were taught two different standard deviation formulas - one for an exact or small population and one for estimating a large population. Unfortunately, I don't have my book with me, but the calculator that we used also differentiated between the two formulas.

Thanks very much indeed for your comment. I now understand this distinction, but am amazed that Microsoft chose to name the “sample” version STDDEV and the more obvious one (that appears in every school text book) STDDEVP, as surely a lot of people are just going to assume that STDDEV is the “main” one? Rather than the other way around.

This comment has been removed by a blog administrator.

Post a Comment

<< Home