MM Week 44: Scottish Index of Multiple Deprivation

This weeks Makeover Monday (week 44) focuses on the Scottish Index of Multiple Deprivation.

2016-10-30_21-54-04

Barcode charts like this can be useful for seeing small patterns in Data but the visualisation has some issues.

What works well

  • It shows all the data in a single view with no clicking / interaction
  • Density of lines shows where most areas lie e.g. Glasgow and North Lanarkshire can quickly be seen as having lots of areas among the most deprived
  • It is simple and eye catching

What does work as well

  • No indication of population in each area
  • Areas tend to blur together
  • It may be overly simple for the audience

In my first attempt to solve these problems I addressed the second problem above using a jitter (using the random() function)

2016-10-30_22-05-26

However it still didn’t address the population issue and given the vast majority of points had similar population with a few outliers (see below) I wondered whether to even address the issue.

2016-10-30_22-08-40

Then I realised I could perhaps go back to the original and simply expand on it with a box plot (adding a sort for clarity):

2016-10-30_22-16-23.jpg

Voila, a simple makeover that improves the original and adds meaning and understanding while staying true to the aims of the original. Time for dinner.

Done and dusted…wasn’t I? If I had any sense I would be but I wanted to find out more about the population of each area. Were the more populated areas also the more deprived?

There have been multiple discussions this week on Twitter about people stepping beyond what Makeover Monday is was intended to be about. However there was story to tell here and I dwelled on it over dinner and, with the recent debates about the aims of Makeover Monday (and data visualisation generally), swirling in my head I wondered what I should do.

I wondered about the rights and wrongs of continuing with a more complex visualisation, should finish here and show how simple Makeover Monday can be? Or should I satisfy my natural curiosity and investigate a chart that, while perhaps more complex, might show ways of presenting data that others hadn’t considered….

I had the data bug and I wanted to tell a story even if it meant diving a bit deeper and perhaps breaking the “rules” of Makeover Monday and spending longer on the visualisation. I caved in and went beyond a simple makeover….sorry Andy K.

Perhaps a scatter plot might work best focusing at the median deprivation of a given area (most deprived at the top by reversing the Rank axis):

2016-10-30_22-11-22

 

Meh, it’s simple but hides a lot of the detail. I added each Data Area and it got too messy as a scatter – but how about a Pareto type chart…

2016-10-30_22-23-23.jpg

So we can see from the running sum of population (ordered by the most deprived areas first) that lots of people live in deprived areas in Glasgow, but we also see the shape of the other lines is lost given so many people live in Glasgow.

So I added a secondary percent of total, not too complex….this is still within the Desktop II course for Tableau.

2016-10-30_22-26-03.jpg

Now we were getting somewhere. I can see from the shape of the line whether areas have high proportions of more or less deprived people. Time to add some annotation and explanation….as well as focus on the original 15% most deprived as in the original.

Click on the image below to go to the interactive version. This took me around 3 hours to build following some experimenting with commenting and drop lines that took me down blind (but fun) alleys before I wound back to this.

2016-10-30_21-51-53

Conclusion

Makeover Monday is good fun, I happened to have a bit more time tonight and I got the data bug. I could have produced the slightly improved visualisation and stuck with it, but that’s not how storytelling goes. We see different angles and viewpoints, constraining myself to too narrow a viewpoint felt like I was ignoring an itch that just needed scratching.

I’m glad I scratched it. I’m happy with my visualisation but I offer the following critique:

What works well:

  • it’s more engaging than the original, while it is more complex I hope the annotations offer enough detail to help draw the viewer in and get them exploring.
  • the purple labels show the user the legend at the same time as describing the data.
  • there is a story for the user to explore as they click, pop-up text adds extra details.
  • it adds context about population within areas.

What doesn’t work well:

  • the user is required to explore with clicks rather than simply scanning the image – a small concession given the improvement in engagement I hope I have made.
  • the visualisation take some understanding, percent of total cumulative population is a hard concept that many of the public simply won’t understand. The audience for this visualisation is therefore slightly more academic than the original. Would I say this is suitable for publishing on the original site? On balance I probably would say it was. The original website is text / table heavy and clearly intended for researchers not the public and therefore the audience can be expected to be willing to take longer to understand the detail.

Comment and critique welcomed and encouraged please.

Advertisements

Makeover Monday Week 43: US National Debt

2016-10-23_11-50-50

This weeks Makeover Monday tackles National Debt. Let’s start by looking at the original visualisation.

Apparently the US National Debt is one-third of the global total. Showing these two values in a pie chart is a good idea as it quickly shows the proportions involved. However the pie chart chosen does have a strange white think slice between the two colours and a black crescent / shadow effect on its outside edge which add no real value (in fact the white slice added a bit of confusion for me).

The visualisation then goes on to show $19.5 trillion dollars in proportion to several other (equally meaningless) large figures. The figures do add some perspective on just how big that figure is and the use of $100 billion blocks in the unit chart does allow an easy comparison. One slightly critical feature, if we were to pick holes in the visualisation, is that half-way through the view starts showing the shaded blocks to compare to the 19.5 trillion, whereas before it doesn’t.

2016-10-23_12-02-50

with shaded blocks

2016-10-23_12-03-18

no shaded blocks

Achieving consistency is important in data visualisation as it lets the reader know what to expect and gives them a consistent view each time to aid comparisons. So making a design decision to add shaded blocks across each comparison would perhaps have been a better choice as opposed to switching half way through.

Visualising Small Data

The dataset provided for the weeks makeover has simply two rows, showing the debt for each area (US and Rest of the World).

2016-10-23_12-10-08

Clearly this presents a visualisation challenge. Visualising small datasets is hard, as there are limited choices. One can attempt to include secondary datasets to show the numbers in context, as the original author has done but another, simpler choice, might be to show them relative to each other – similar the original’s pie chart. One might even attempt to show how the data corresponds to the population of the US or the world, attempting to bring the figure down to something manageable (in the US the debt is a more comprehensible $61,000 per head).

Before we attempt to visualise something though we need to think about the audience and message we want to provide. Are we simply trying to show the figures without any comment? or do we want to focus on how large they are? or are we commenting on how large the US debt is to the rest of the world and making a social / political comment?

With a dataset so small any editorial comment is difficult though. For example we have no context on the direction of movement of these figures. The US might be quickly bringing it’s debt under control, while the ROW grows, or the opposite might be true. The ROW figure might be dominated by other developed countries, or might be shared equally. How can we comment without further analysis on temporal change or the context of this figure?

If we can’t comment editorially then we are left with simply showing how huge these numbers are. My criticism of the original is that the number it shows in comparison are equally huge, and equally incomprehensible for a lay person. Given this visualisation is published on a website Visual Capitalist perhaps their audience is more familiar with global oil production or the size of companies but for any visualistion published away from the site a more meaningful figure is needed. Personally I think the amount per head is an especially powerful metaphor. In the US $61,000 dollars each would be required to clear the debt, the ROW world would just have to pay a little over $5.

To Visualise or not to Visualise

Now there is an important decision here, how to effectively show those figures in context. However with such small data is there any point in doing so? Everyone can quickly see $5 is much less than $61,000 – we don’t need a bar chart or bubble to show that, and we certainly don’t need a unit chart or anything even more complex. This is the problem with small datasets, any visual comparison is slightly academic given we can quickly mentally interpret the numbers.

One might be tempted to argue that a data visualisation is needed to engage our audience. Perhaps a beautiful and engaging data visual might do a good job of this, however so would the use of non-data images like the the below.

us-national-debt

Defining Data Visualisation

Makeover Monday is a weekly social data project, should a visual that includes only text be included?

What if the pile of dollars in the image above had exactly 61,000 dollar bills would that make it any more of a data visualisation than one that contained a random amount? What if, instead, we added as a unit chart with 12,200 units of $5 bills? These accompanying items don’t help us visualise the difference any better than the text. One could argue where the main purpose of a visualisation isn’t to inform or add meaning or context, and is instead used as a way of engaging the user, then it becomes no different to any other image used in this way. Therefore adding any more data related visualisations to the above text wouldn’t make the image any more of a data visualisation than the one above.

Semantic arguments that attempt to define data visualisation are interesting but academic. Ultimately each project that uses data does so because it needs to inform its audience, and it is the success of the transaction from author to audience that deems how successful the project is.

So should we define a data visualisation as more (or less) successful because of its accompanying “window decoration” (or lack thereof)? In my opinion yes. Accompanying visuals and text help provide information to the audience and can help speed up the transfer of information by giving visual and textual clues.

Do charts / visuals that make no attempt (or poor attempts) to inform the audience add any more value to a data visualisation project simply because they use data? In my opinion, no. This isn’t the same same thing as saying they have no value but simply producing a beautiful unit chart, say. with the data for this Makeover Monday project would add no intrinsic extra value in educating the audience and therefore would be no more valuable than any other picture or image.

Is the above image a successful Data Visualisation? Let’s wait and see on that one. I’m intrigued to see what the community makes of a purely text based “visualisation”.

Does it do a better job at informing the audience than the original? Again this is hard to answer but I believe I understand more about the size of the debt when it is visualised in terms of dollars per head. By bringing these numbers down to values I understand I did’t need to add any more visualisation elements in the same way as the original author, therefore you might say mine is more successful because it manages to pass across information in a simpler, more succinct transaction.

“Fitted” Gannts in Tableau

The Challenge

During Makeover Monday this week (week 22) I came across a problem: I needed to produce a Gantt chart for a huge amount of overlapping dates. Gantt was really the only way for me to go with start and end dates in the data (in the back of my head I’m thinking Mr Cotgrave will be loving this data given his fascination with the Chart of Bigraphy by Priestly) and I was fixated with showing the data in that way (I blame Andy) but everything I tried in Tableau left me frustrated.

Jittering left wide areas of open space and no room for labels, even if I zoomed into one area would render leave lots of the data unexposed.

2016-05-30_21-58-59

I knew what I wanted to do…I wanted to neatly stack / fit the bars in a decent arrangement to optimise the space and show as much data as possible at the top of the viz. The original author in the link for the makeover had done this as such:

Now Makeover Monday usually has a self-imposed “rule” that I tend to adhere to, spend an hour or less (if I didn’t stick to this I could spend hours), but here I was after half an hour without any real inspiration except something I knew wasn’t possible in Tableau. It was a challenge and to hell with rules I do like a challenge – especially given the public holiday in the UK meant I had a little time.

The Algoritm

So I turned to Alteryx, but how to stack the bars neatly.

Firstly I needed a clean data set, so I fixed some of the problems in the data with blank “To” dates and negative dates using a few formula and then I summarised the data to just give me a Name, From and To date for their life.

Algorithm-wise I think I wanted to create a bunch of discrete bins, or slots, for the data. Each slot would be filled  as follows:

  1. Grab the earliest born person who hasn’t been assigned a slot
  2. Assign them to a slot
  3. Find the next person born after they die, and assign them to the same slot
  4. Repeat until present day

In theory this would fill up one line of the Gantt. Then I could start again with the remaining people.

An iterative macro would be needed because I would step through data, then perform a loop on the remainder. First though I realised I needed a scaffold dataset, as I needed all the years from the first person (3100BC to present day).

I used the Generate Rows tool to create a row per year, and then joined it to my Name, Birth, Year data to create a module that looked like:

2016-05-30_22-10-07

Data:

2016-05-30_22-11-17

I’d fill the “slot” variable in my iterative process. So next up my iterative macro.

Translating the above algorithm I came up with a series of multi-row formula:

2016-05-30_21-29-41.png

The first multi-row formula would assign the first person in the dataset a counter, which would count down from their age. Once it hit zero it would stay at zero until a new person was born, at which time it would start counting down from their age.

The second multi-row formula would then look for counters that had started to work out who had been “assigned” in this slot and assign them the iteration number for the macro, i.e. first run would see everyone going in slot 1, second in slot 2, etc.

Perfect! Now to run it and attach the results to the original data:

2016-05-30_22-19-25

Easy peasy Alteryx-squeezy. That took me 30 mins or so, really not a long time (but then I have been using Alteryx longer than you….practice makes perfect my friend).

The Viz

So now back to Tableau:

2016-05-30_22-23-24

Neat, progress! Look at how cool those fitted Gannt bars look.  Now what….

Well I need to label each Gantt with the individuals name but to do that I really have to make my viz wide to give each one enough space….

2016-05-30_22-25-06

The labelling above is on a dashboard the maximum 4000 wide…..we need wider! But how? Tableau won’t let me….

Let’s break out the XML (kids don’t try this at home). Opening up the .twb in Notepad and….

2016-05-30_22-27-58

I changed the highlighted widths and low and behold back in Tableau – super wide!

Now I can label the points but what do I want to show – those Domain colours look garish….

So I highlighted Gender and….pop. Out came the women from history – nice story I think to myself. I decided not to add a commentary, what the viewer takes from it is up to them (for me I see very few women in comparison to men).

Other decisions

  • I decided to reverse the axis show the latest data first and make the reader scroll right for the past, mainly I did this because the later data is more interesting
  • I decided to zoom in at the top of the viz, generally I expect viewers won’t scroll down to the data below but while I toyed with removing it I decided that leaving it was a slightly better option. The top “slots” I’m showing are arbitrarily chosen but I feel this doesn’t spoil the story.
  • I decided to add a parameter to highlight anything the user chose (Gender or Occupation) – tying it into the title too.
  • I fixed AD / BC ont he axis using a custom format

2016-05-30_22-41-28

Conclusion

So I spent a couple of hours in total on this, way more that I planned today but that’s what I love about Makeover Monday – it sets me challenges I’d never have had if I hadn’t been playing with the data. I’ve not seen this done in Tableau before so it was a fun challenge to set myself.

Click on the image below for the final viz

2016-05-30_21-17-19