Keepin’ the Customers satisfied

As a young lad in Geelong, I sold newspapers, for the Experience. Around that time I bought a 45 single, Bridge Over Troubled Water by Simon & Garfunkel. Bit orchestrated but amazing song, although  I didn’t much care for the flip side ‘Keep the customer satisfied’. I didn’t think it all that good a song, and it didn’t seem to have much to do with customers, or not the sort of customers I was likely to come across across back then.

I like that song more now, but still don’t think it has much to do with customers, apart from the snappy title. Similarly, the great Australian song Esmerelda by the Indelible Murtceps (an anagram of their alter ego Spectrum), sang about ‘always one more customer to go’, but once again, not the sort of customers a newspaper ‘distributor’ or Statistical consultant is (hopefully) likely to meet.

Bridge Over Troubled Water sounds better though, with its message of hope and reassurance (although a some of the words are admittedly a bit dodgy). Reassurance is vital in Statistical Consulting, where clients are often scared of statistics. The other important thing, in any form of consulting, is that clients must feel they come out with something positive that they didn’t come in with (information, a new ‘clever consultant riff they can try in SPSS or whatever), as well as feeling a bit more relaxed.

Whether it be cafe’s or consulting , offering a glass of water or cup of tea or coffee, keeping up an interesting patter about the daily specials, or how it is that median quartile regression may help to make length of stay data clearer, you always got to

Keep the Customer Satisfied!

Coin Chops: Can the Law of Averages be Replaced by the Law of Probability?

Alas, to the ‘average’ consumer of statistics, unlike we statisticians and data analysts, Probability is a sort of Comic I mean Cosmic Force i.e. ‘The Laws of Probability’ . David Hand OBE FBA has entertainingly looked at misunderstandings of this Comic Force and Coincidences in ‘the improbability principle: why coincidences, miracles and rare events happen all the time’ (2014).

But sitting here in the State Library of Victoria, I’m reading Frank ‘Power Without Glory’ Hardy’s novel ‘Four-legged lottery’ (1958). On page 179 of the Gold Star paperback edition there’s a bit of blarney about the ‘law of probability’ replacing the ‘law of averages’ where one of the two main characters, a professional gambler by the name of Jim Roberts, talks about the Anglo-Australian game of Two-Up which involves throws of pairs of coins, and is legal in Australian casino’s and traditionally, on the streets on ANZAC Day (25th April)..

‘in an honestly conducted two-up school, an equal number of heads and tails will be thrown over a long period; both head and tail bettor must lose [as the ‘house’ must take a percentage]. [To try and overcome the Law of Averages, giggle!] a tail better can back the tail on every spin – only for two throws, doubling [the] stake on the second throw if the spinner [bets heads] the first time. In this way [he or she] defeats the law of average <by winning> every time a spinner throws [both tails or one head and one tail and only loses when spinner throws both heads]’. Time for a simulation !

Watch this space. Same Stat Time! Same Stat Channel!

 

Hobart and Randomicity

Mona, lower case, is a great 50’s song by Bo Diddely, covered a few years later by the Rolling Stones on their first album.

MONA, upper case, standing for Museum of Old and New Art, is an amazing underground (literally) art gallery in Hobart, the capital of Tasmania, the island state of Australia.

Hobart is the second oldest state capital in Australia (after Sydney), was liked by both Mark Twain and Agatha Christie, and is the birthplace of Hollywood actor Errol Flynn (1909-1959), as well as the final resting place of the last thylacine or ‘Tasmanian Tiger’ a carnivorous mammal, the last of which died in captivity in 1936. Hobart is also the setting for the development, in the mid 1930’s,  of Edward James George Pitman’s (1897-1993) development of randomization or permutation tests, which Sir Ronald Aylmer Fisher had also worked on. Permutation tests rely (these days) on computers, and don’t require reference to statistical arcana such as the Normal and Student’s T distributions, etc.

As shown by the late Julian Simon and more recently in that wonderful stats book that sounds like a law firm (Lock, Frazer Lock, Lock Morgan, Lock and Lock, 2012), permutation tests can also be easier to understand by students than the parametric alternatives.

MONA itself is currently showing the movie ‘David Bowie Is’, a segment of which talks about the London singer’s use of the William Burroughs / Brion Gysin cut-up technique and later a computer program called Verbasizer, to randomly suggest combinations of particular words to aid in the creative song-writing process.

While you may or may not be interested in randomicity, and the David Bowie movie may no longer be showing, but whether it’s out of the desire for adventure, curiosity, necessity or for purely random reasons, visit MONA and Hobart!!

Further reading:

Lock EH, Frazer Lock P, Lock Morgan K, Lock EF, Lock DF (2012). Statistics: unlocking the power of data. Wiley.

McKenzie D (2013). Chapter 14: Statistics and the Computer. In McKenzie S: Vital Statistics: an introduction for health science students. Elsevier.

Robinson ES (2011). Shift linguals: cut-up narratives from William S. Burroughs to the present. Rodopi.

Timms P (2012). Hobart. (revised edition). University of New South Wales Press.

Who gives a toss: the statistics of coins

Spring is here in Melbourne, and a time for fashionable horse racing, including The Melbourne Cup in November., once attended by Mark Twain. Australia is also home of the “two-up” coin tossing game (descended from the British pitch and toss), played in outback pubs, hidden city lanes and now Australian casino’s, described in great old Australian novels such as Come In Spinner, and the eerie book and 1971 movie Wake in Fright (aka Outback).

In the 18th century, the Comte de Buffon obtained 2048 heads from 4040 tosses, while more recently and not to be outdone the statistician Karl Pearson obtained 12,012 heads out of 24,000 tosses (The Jungles of Randomness by Ivars Peterson, 1998). Of course a misunderstanding of the law of large numbers or so-called law of averages, makes the uninitiated think that if there’s say seven heads in a row, a cosmic force will decide “hang on that coin is coming up heads more than 50%, better make the next one a tail”).

While it doesn’t look at two-up, “Digital Dice” by the always entertaining Paul Nahin (2008) examines a tricky coin-tossing problem posed in 1941 and not solved until 1966. Prof Paul shows how to solve it using a computer-based Monte Carlo method, itself named after that famous casino in Monaco, where James Bond correctly observed that “the cards have no memory”.

And who says stats isn’t relevant?!

Applied Australian Change-Point Analysis: Before the Shark Gets Jumped?

Ok I saw the (in)famous Season 5 Episode 3 “Jump the Shark” episode of Happy Days (when Fonzie water skiis over a shark pool) when I was 18 back in 1977, and hated it.

Definitely Uncool.
But one Saturday morning a month or two ago I saw it again and loved it. It’s wild! It’s glorious!

The term has come to mean the point at which a TV series goes down hill, when the wolf becomes a dog, to riff on a previous post.

http://articles.latimes.com/2010/sep/03/entertainment/la-et-jump-the-shark-20100903

Anyhow, Australia’s Professor Kerrie Mengersen and Dr Hassen Assareh have developed a snazzy new Bayesian Markov Chain Monte Carlo procedure for working out the change-point in a process, specifically the point where a key change happened to a hospital patient’s condition for example. Helping to identify the ‘why’, as well as the ‘when’.

https://www.additiveanalytics.com/blog/researchers-develop-new-statistical-technique-better-understand-clinical-outcomes/

It’s a great idea and yet another instance of how Statistics can help save the world, again!

When I grow up, I’m gonna be a Statistician!

How many of us said that, I wonder? Rather than children dressing up as sheriffs or doctors or possibly even scientists (?), how many dressed up like Statisticians? Did anyone even know much about Statisticians then? Mathematicians yes, they were sort of nerdy (although that word wasn’t around when I was a kid) but could do important things, like calculate odds of winning at Las Vegas or horse racing, and the chance of thermonuclear war.

 

But when I was young, inspired by Get Smart and The Man from UNCLE and James Bond I  mainly wanted to be a secret agent! I played with the idea of  becoming a private detective, sorry investigator, for a while until I found out that in real life, as opposed to TvLand and BookWorld, they mainly seemed to be involved in divorces. So, when I was in my very early teens, I toyed with the idea of joining the FBI. As an Australian citizen, this would have been rather difficult, I would have had to become a US citizen,  as well as either a lawyer or an accountant first. So I put that idea in the ‘too hard basket’. (Imagine, a lawyer or an accountant!).

Well, I suppose it shows evidence of an inquiring mind. Further steps, trots, canters and gallops along the road to Statistics is a story for another time. But there were a couple of ‘residuals’ from that childhood long ago. Asking questions, even if  no one else was. The desire to do the right thing, and wear the right colour hat (even if in truth the Jack Palance baddie wearing black was far cooler/groovier/jazzier in the Shane movie, although not the book, than the light coloured cloth-wearing goodie, Alan Ladd).

And a 1963 book which I got for Christmas a year or two later, called The How and Why Wonder Book of Robots and Electronic Brains. I still have that book and I cited it in my PhD Thesis, although back then I was more interested in the robots, especially the black and red tin ones that could be wound up with a key!

 

But it was a 1979 Texas Instruments TI-55 (simple) programmable LED calculator I got for my 21st, that came with quite a thick manual, showing how one could do fun things like predicting future sales from advertising expenditure, that gave much more excitement, practicality and crunch to the Psych 101 Stats that I was undertaking.

http://www.datamath.org/Sci/MAJESTIC/TI-55.htm

And then, in the early summer of 1981 when I first used SPSS (submitted to be ran at 2300 hours) on a DEC System 20-60 I was truly hooked.

True, James Bond had his Beretta and Walther PPK and Aston Martin and Bentley and Sea Island shirts and Shaken Not Stirred, but at least in the early days, he never used a programmable calculator, let alone a Computer!

 

Hot Cross Buns: How Much Bang for the Buck?

Good Friday and Easter Monday are public holidays in Australia and UK (the former day is holiday in US  in 12 states). For many down here, including those who don’t pay much nevermind to symbols, Good Friday is traditionally the day to eat Hot Cross Buns. For the last few years, the Melbourne Age newspaper has rated a dozen such  buns for quality, as well as listing their price.

http://www.goodfood.com.au/good-food/search.html?ss=Good+Food&text=bunfight&type=

 

 

We would expect that, quality would increase, to some extent with price, although it would eventually flatten out (e.g. thrice as expensive doesn’t always mean thrice as good). Graphing programs such as Graphpad, Kaleidagraph and SigmaPlot, as well as R and most Stats packages, can readily fit a plethora of polynomial and other nonlinearities, but I used Stata to perform a preliminary scatterplot of the relationship between tasters’ score (out of 10)  and price per bun (A$), smoothed using Bill Cleveland’s locally weighted least squares Lowess/Loess algorithm. http://en.wikipedia.org/wiki/Lowess

easterbun14_lowess

 

The relationship shown above is vaguely linear or, rather, ‘monotonic’, at least until I can have a better go with some nonlinear routines.

A simple linear regression model accounts for around 42% of the variation in taste, in this small and hardly random sample, returning the equation y=1.71*unitprice+1.98, suggesting (at best) that subjective taste, not necessarily representing anyone in particular, increases by 1.7 with every dollar increase in unit price.

But the fun really begins when looking at the residuals, the difference between the actual taste score, and that predicted using the above model. Some buns had negative residuals, indicating (surprise surprise!) that their taste was (much) lower than expected, given their price. I won’t mention the negatives.

As to the positives, two bakeries, Woodfrog Bakery in St. Kilda (Melbourne, Australia) and  Candied Bakery in Spotswood (ditto), both cost $2.70 each and so were predicted to have a taste score out of 10 of 6.6, yet Woodfrog hopped in with an actual score 8.5 and Candied with an actual score of 8.

 

The results can’t be generalised, prove nothing at all, and mean extremely little, except to suggest that regression residuals can perhaps  be put to interesting uses, but please take care in trying this at home! Tread softly and carry a big (regression) book e.g Tabachnick and Fidell’s  Using Multivariate Statistics

(or the Manga Guide to Regression, when published!  http://www.nostarch.com/mg_regressionanalysis.htm)