Sunday, 19 May 2013

Consistency of NBA Franchises from 1974 to now - are Indiana the most boring team?

As another NBA season draws to a close, I've started to think a little about what makes NBA success work in the long term. Why is it that some teams (the Spurs) seem to make a deep playoff run every year where as others (Dallas perhaps) go up and down like a yo-yo? Well first I wanted to visualise these differences in consistency to see if my impressions of the different franchises are actually correct. Hence the viz below.

Looking at franchise performance in terms of regular season wins from the 1973/74 season to now, I've used the average season wins and the variance in season wins to split the NBA franchises into four groups:

1. Consistent Winners - These guys win games year after year. Some do it in serious style and end up with titles (like the Lakers), while others plod a long as above average winners, but never go on to wn it all (Phoenix).

2. Inconsistent Winners - The Bulls, the Heat and The Mavericks all embody this trait perfectly. Periods of superstar led brilliance, followed by seasons of regrouping and rebuilding. I was surprised to see Boston in this group.

3. Consistent Losers - Every year these teams seem to perform below par, little surprise this group includes the Clippers and the Raptors.

4. Inconsistent Losers - There are only three teams in this group since 1973/74, the Cavs, the Grizzlies and the Timberwolves. Mostly these guys are in the doldrums, but on occasion something happens (something like LeBron James) to lift them to heady heights.



There is also I think a fifth distinct group, which are really the most boring  teams to follow in the NBA (the stats are saying it not me). I'm looking here at Indiana, Milwaukee, Atlanta and New York. Maybe thats a little unfair to the Knicks because the chat starts just after their last title, but hey that was 40 YEARS AGO! These teams are very consistent, have average seasons of 41 wins and don't win anything.

Which leads to another conclusion. Every team except Orlando in the Inconsistent Winners quadrant has won at least one, and often multiple, titles. But in the Consistent Winners quadrant there are 6 title-less teams. Maybe these results echo the appetite for risk of each team's owners. Some would rather aim for the occasional big win where as others want a consistent winning team but aren't willing to take the risks of crashing and rebuilding. And you have to take your hat off to the Spurs and the Lakers ownership and management for such high levels of consistent performance.

This being a Tableau viz there is of course the option to interact with it, so please go ahead and click on teams to compare, or change the period of time you're looking at. What else can you find?

Below is a screen shot comparing some of the key teams in the 'post Jordan' era.



Since 1999, San Antonio have shown an other-worldly ability to be consistently good, year after year after year with an unending supply of talented and overlooked players*. Other teams like Cleveland have seen their stock rise only to fall off a cliff when a key player departs.

My team is Chicago, I'm just hoping for an injury free season in 2013/14.

* @datajedininja has done an analysis of all the players the Spurs have drafted since 1966, check it out here 




Sunday, 12 May 2013

The Hopometer - Visualising beer strength and bitterness

This week's blog post is a team effort and is all about beer! My wife Heather (@highline_online) is, like me, a big craft beer fan so we decided to collaborate on this viz all about beer strength and bitterness. Plus Heather has much better design skills than me.....

Below are a bunch of mostly very hoppy beers (I love me some hops) plotted by their alcohol content and bitterness as measured in International Bittering Units (or IBUs). Introducing The Hopometer.....

Most of the beers come from a list of the top 100 most bitter beers in the world compiled by beertutor.com http://www.beertutor.com/beers/index.php?t=highest_ibu. And to give some perspective we've also added some of favourite slightly less hoppy beers, along with some popular mass market 'beers'. Are any of your favourites on the viz?

We had to strip out some beers from the top 100 because the massive amount of clustering between 8% and 10% alcohol and 100 and 130 IBU's was making things a bit crowded. And we used a log scale for the same reason. You'll see in this range the beers are mostly from the US, and Double or Triple IPA's dominate in that section.

Here's what About.com says about IBU, I particularly like the Example...

Definition:
IBU - International Bittering Units
This is a measure of the actual bitterness of a beer as contributed by the alpha acid from hops. Because the apparent bitterness of a beer is subjective to the taste of the drinker and the balancing malt sweetness of the beer this is not always an accurate measure of the "hoppiness" of a beer. But, generally speaking, beers with IBUs of less than 20 have little to no apparent hops presence. Beers with IBUs from 20 to 45 are the most common and have mild to pronounced hops presence. Beers with IBUs greater than 45 are heavily hopped and can be quite bitter.
Examples:
Not knowing that the barleywine had an IBU of 68, Rachel took a big swig from the glass then twisted up her face as the hops assaulted her taste buds.

For more info on IBU's the are loads of places to look on the web, but this is a good start http://www.popsci.com/science/article/2013-04/beersci-ibus-explained
All that vizing has made me thirsty.....

Sources: beertutor.com, draftmag.com, general googling....



Quick shameless plug. Heather runs a record label Highline Records, and this is the latest release by The Ralfe Band:



Tuesday, 30 April 2013

Guest Post - Floating Dashboards and NBA Player Comparisons

This week I'm featuring what I hope is only the first of many guest posts by @datajedininja, otherwise known as Carl Allchin. A fellow NBA and Tableau nut......



It’s NBA playoff time which means anyone who sees me day-to-day will expect more mood swings than a teenager! If the Spurs are winning then I’m insufferably smug. Yet, if the Spurs are losing then I’m insufferably grumpy.
Using Tableau has become somewhat a way of life for me and there is not many of my interests that I don’t analyse from a data perspective; analysis of the NBA is no different. I wanted to understand how players perform in regards to not just the league but also their own team. Below is a quick walkthrough of how I have achieved this without having to create a large number of weightings that sway bench-warmers in to allstars or give the reader migraines trying to decipher – I’m looking at you Hollinger!


Sunday, 21 April 2013

A handy use of Attributes in Tableau - colouring waterfall charts

For a long time I've noticed the choice of making a Tableau field an 'Attribute' (as below, between Dimension and Measure) once it is in the view and not really known what to do with it, or had the need.


This week I found myself in a situation where I needed to use a Dimension in Colour, without that Dimension splitting up the view, and discovered one example where the 'Attribute' really comes into effective use. So here's the story:

I was making a waterfall chart at work based on some sub categories and needed to add the category one level up as colour. Since I can't divulge the actual data set I was working on I thought it might be useful to show a similar example using Superstore Sales. If you haven't made a waterfall chart yet in Tableau I'm not going to describe the process here but the online training video is very clear http://www.tableausoftware.com/learn/tutorials/on-demand/waterfall-charts-chart-type-8 . Below is the basic waterfall chart of profit split by product sub-category from Superstore Sales, just as shown in the video. Only I've sorted the categories by ascending profit.


Now in the video they go one step further and colour each bar red or green depending on whether the profit is positive or negative. In my case however I wanted to colour the bars by the categorisation level one level up, in the case of Superstore Sales simply Category. So the obvious thing to do is to drag Category into Colour on the marks card. But then this happens.....



....Eeeek! That's not what I wanted. So what's going on here is that the running total calculation is now being separated for each Category. In other words placing Category into Colour didn't just change the colours of the bars, it also added a an extra dimension by which the calculated fields would be based. So how do we get out of this conundrum? Well it turns out the easiest way is to change Category from a Dimension to an Attribute. Just right click on the marks card and select Attribute.


And that solves the problem, see below, and everybody's happy! The sub categories are coloured by category, but the structure of the original waterfall chart stays intact.



 Now I don't think I've fully realised the potential of how Attribute can be used, but this has certainly opened my eyes to how I might be able to use it effectively in future. Essentially any time where adding a Dimension to add visual clarity is also going to split the data set in way you don't desire, changing that Dimension to an Attribute might solve the problem. I'd suggest if you are interested in this then have a play with the function using all the different chart types, for example see what it does to packed bubbles:




Sunday, 7 April 2013

Demonstrating how Logarithmic Scales work, with the help of Chillies and Hot Sauces.....

Logarithmic scales are a very useful device when analysing data, but many people shy away from using them as they can sometimes be difficult to explain. Despite this, logarithmic scales are often quoted in common use, for example the Richter Scale for measuring the magnitude of an earthquake is a base 10 logarithmic scale that is part of the everyday vernacular. (For a good introductory read on Richter Scales and the measurement of earthquakes I recommend Nate Silver's book The Signal and the Noise).

Here I will do my bit for the understanding of Log Scales and will use the example of the heat of chilli's to show both how they work and why they can be useful in data visualisation.


So how do Logarithmic Scales work? Well wikipedia says this "The logarithm of a number is the exponent by which another fixed value, the base, must be raised to produce that number." 


If we take the number 10,000 and we use the base 10, to get from 10 to 10,000 we must raise it by the power 4: 10= 10,000, so the logarithm of 10,000 is 4. Likewise the logarithm of 100,000 is 5, the logarithm of 1,000,000 is 6 and so on. Not all logarithmic scales use base 10, any base is possible, but it is the most commonly used. (The base 2 logarithm of the number 16 for example is also 4 because 2= 16).


So how do we use logarithmic scales in data visualisation? Take a look at the first tab of the viz below. You will see two charts side by side, the first shows a selection of chilli peppers, hot sauces and pepper sprays mapped by their number of Scoville units. Scoville units are a measure of heat in food, for more information on the Scoville Scale take a look at http://en.wikipedia.org/wiki/Scoville_scale .


The vertical axis shows the number of Scoville units for each item, and the horizontal axis simply ranks the items within their categories (so the hottest sauce and pepper are both at place 1 on the scale). This first viz is quite useful, we can tell straight away that the sauce 'Blair's 16 Million Reserve' is way way way hotter than most of the other sauces and peppers. And for anyone who has ever got chilli in their eyes, you can also see that getting hit in the face with pepper spray probably isn't much fun. However what's harder to distinguish are the differences between the sauces and peppers at the lower end of the scale. For example the Pimento pepper is a lot less hot (by a factor of at least 10 in fact) than the Jalepeno, but its hard to tell on the standard scale.


This is where the logarithmic scale comes into its own. Tableau uses the base 10 logarithmic scale as its default, and you can see on the second viz that this has been applied on the vertical axis. Now the differences in heat (as measured by Scovilles) are much clearer, all across the scale. You can also see how using a log scale might come in useful when trying to identify patterns and relationships. When a variable is working on a power scale, using the log makes spotting relationships much easier.





This work then led me on to thinking about a possible adaptation of the Scoville scale to make it more like the Richter scale. The second tab in the Tableau viz above shows how this might look, using a base 10 log to give each pepper, sauce or spray a score. This has now become a linear scale where one movement in the scale implies a 10 times increase in heat from the chilli. I've got a feeling the sauce buying public might quite enjoy this system of measurement, imagine buying you hot wings on the same basis as people measure earthquakes? For now I'm going to call this the Scoville Richter Scale on which Original Tabasco scores a 3.6, Franks Red Hot a 2.7 and Habneno peppers a 5.4. It looks like the 7.3 score of Blair's 16 Million Reserve might be the hottest score possible as its made from capsaicin capsules (http://en.wikipedia.org/wiki/Capsaicin) but you never know.

Notes: Data for this viz was sourced from a number of websites, mainly wikipedia and http://www.chilliworld.com/FactFile/Scoville_Scale.asp . Where peppers are known to have a range of Scoville scores, I've used the mid point. The list I've presented certainly isn't an exhaustive list of sauces or peppers. And for the record, I'm a bit of a wuss when it comes to hot food, I probably wouldn't venture beyond a 4.5 on the Scoville Richter Scale.....





Saturday, 30 March 2013

Elite 8 Viz Makeover

UPDATE: I made it into the Elite 8, as the 8th seed. Very happy with that result, thanks Tableau judges! If you'd like to see it in context click here http://www.tableausoftware.com/public/elite_8_bracket

Well Tableau have launched a competition to make over in Tableau 8 one of the vizes previously built in Tableau 7 and published on the Tableau Public Gallery. http://www.tableausoftware.com/public/elite-8   Below is my effort.

My understanding of the competition (which may be wrong!) is to give the viz a makeover, rather than a complete redesign from scratch. So I've kept the basic format of the original, map followed by scatter plots. Plus I love scatter plots!

I've actually not used too much of the version 8 functionality in this instance as I didn't think that the new chart types for example would be relevant to this data set. Instead I've tried to open up the dashboard a bit, to show the national picture, to make comparisons between states and counties easier using colour and, as with my NBA viz below, to make it easier to spot outliers. I've not sized the bubbles as I don't like to repeat measures in bubbles, I would have sized by population if available.

One thing I have done with the new functionality is use the floating tiles quite subtly, allowing Hawaii to appear in the national picture, and placing a decent paramter based x axis label in the scatter plot.


Content wise, most of the links with obesity are well known. lack of exercise and poor diet lead to obesity, which in turn leads to health problems such as high blood pressure. this is well known and established so I didn't think there was much point trying to emphasise this too much (though it is there). Most interesting to me are the geographic differences, especially the outliers. For example, what are folks in Lawrence Kansas doing to stay trim? There are two tabs. One shows my version in Tableau 8, the other shows the original.

Comments?

NBA Quadrants redux

So its been an awful long time since I first posted a viz on here, but I'm getting back on track, starting with an improved version of the NBA player stats per minute comparison quadrant.

What really appeals to me about showing NBA player data in this format is the ease with which comparisons between players can be made on an even playing field, and players who are statistical outliers really stand out.

Since I posted my first effort I've learnt a lot more about Tableau, and hopefully this shows.
PS apologies for the weird alignment, haven't figured this out yet!