Monday, 7 March 2016

Life expectancy at 65 in England (Local Authority highs and lows, with some asides about line charts)



Life expectancy at 65 has increased over time in England for both males and females: male life expectancy at 65 increased from 16.2 years for 2000-02 to 18.5 years for 2011-13, whilst female life expectancy over the same period rose from 19.2 years to 21.0 years. Male life expectancy at 65 increased faster than female life expectancy, reducing the gender gap from three years (for 2000-02) to 2.5 years (2011-13).  

Overall, this is an encouraging picture. Nevertheless, beneath the England level figures, substantial variation is found at local local authority (LA) level (and local authority district (LAD) level for two tier authorities).  Figures 1 and 2 show the time series data for female and male life expectancy at 65 for the LAs/LADs with the highest and lowest life expectancy as of 2011-13. 

Figure 1 shows that the highest female life expectancy at 65 were found in Chiltern (a rural LAD in Buckinghamshire) and Camden (in London): the lowest life expectancy of 18.8 years was found in Halton Borough Council (which covers Widnes and Runcorn).  Camden's life expectancy increased rapidly, by 2.9 years, between 2004-06 and 2008-10.  Female life expectancy at 65 for Halton has actually decreased in each of the last two available years: from 19.5 in 2009-11 to 18.8 in 2011-13. I'd expect that there are some public health people in Halton who are pretty unhappy about that.


Figure 1:  Female life expectancy at age 65: highest and lowest local authorities / local authority districts as of 2013

Female life expectancy at 65 for Chiltern, Camden, England and Halton
Notes: Upper and lower 95% confidence limits are shown in faint lines for local authority/local authority district life expectancy. Life expectancy is calculated using a rolling average over a three year period.

Figure 2 shows that for 2011-13, Harrow (in Greater London) had the highest male life expectancy at 65 (21.1 years). Manchester, the LA area covering central Manchester, had the lowest life expectancy (16.0 years).  This male life expectancy gap of 5.1 years is similar to that seen for women (5.2 years).


Figure 2: Male life expectancy at age 65: highest and lowest local authorities as of 2013
Time series chart showing male life expectancy at age 65 for Harrow, England and Manchester


Notes: Upper and lower 95% confidence limits are shown in faint lines for local authority/local authority district life expectancy. Life expectancy is calculated using a rolling average over a three year period.

Whilst these charts show that the life expectancy gap for these particular LAs / LADs has increased over time, it doesn't show anything about what the LA/LAD level life expectancy gap has done in general over this period (Harrow and Manchester are at the extremes of the range in 2011-13, but not necessarily for other years). I'll be pulling together some charts that look at how the life expectancy gap has changed over time for another post.

About the charts

These are fairly simple Excel-based time series charts (primarily made as mock-ups for a data explorer I'm making in SSRS). If you like this design, there are a few things that may be worth noting about how to build these.

Y axis scales

Y-axis scales for time series charts don't have to start at zero. The main purpose of these (and similar) charts is to examine change over time. Starting the y-axis at zero would make the changes too difficult to see clearly - and make the chart unhelpful to users. But - if you are going to ask your readers to compare different charts, make sure the charts use a common format:

  • Apply the same y-axis range to all the charts that will be compared. To do this in Excel 2016, select the y-axis and look under  'Format Axis - Axis options - Axis options.' The option needed is 'Bounds - Minimum and Maximum'  
  • Ensure that the charts to be compared are the same size.  This is straightforward in Excel 2016: under 'Format chart area - Size and properties' check under properties that 'Don't size or move with charts' is selected (this keeps the chart from re-sizing if you expand a column or row) and then  under 'Size', set the chart height and width to the desired dimensions
  • Ensure that colour use is as consistent as possible across charts. In Figures 1 and 2, for example, 'blue' denotes the LA with the lowest life expectancy; teal is used for England-level life expectancy and 'orange' is used for high life expectancy (gray is also used in Figure 1, where two local authorities had the same female life expectancy at 65 for 2011-13).

Replace legends with data labels
Using data labels instead of legends makes it easier for readers to interpret charts quickly.
Ordinarily for charts like these, I'd include both the series name and the final data value as a data label at the right of the chart. This won't work for Figure 1 as Camden and Chiltern share the same final data value. Whilst both series names and final values could still be displayed to the right (just offset up and down), it would be unclear which label related to which data series. I got around this in Figure 1 by adding a blank cell to the start of the x-axis series and to each data series. This provided space to include data series names at the start of the data series, without overlapping the y-axis.

Legends slow readers down, forcing them to look away from the actual chart for extra information. Keep them in reserve for cases where there are no viable alternatives (for example, where data series start and end on the same values).

Line weights combined with tints/shades can be used to emphasise or deemphasise data 

This is a pain in Excel (each series has to be set manually, and chart templates don't seem to consistently solve the problem, unless one is very particular about data set up), but pleasantly straightforward in SSRS.  I've used thin line weights and tints to show the upper and lower 95% confidence limits for the the LA/LAD results. I've also moved the confidence limit series to the top of the data series list (in the 'Select Data' pane), meaning that data series showing life expectancy will always cross in front of confidence limit series.


Tuesday, 1 March 2016

Nobody wants to look at your chart



People don't want to carefully match the colours in the legend to the different data series, or take out their ruler and check that the chart is drawn to scale. They don't want to check that the proportions in the pie chart add to 100 (insert solemn ritual to ward off the evil pie here). People really, really, oh so really don't want to check that the y-axes used in that set of small multiples share a common scale.

Sometimes people don't want to look at charts because charts make them feel anxious and ignorant, reminding them of real or imagined mathematical skill deficits.  No-one likes feeling anxious or ignorant - though there's a real high to be had from transforming 'anxiety and ignorance' into 'temporary sense of relief and slightly-less ignorance').

Sometimes people don't want to look at charts because they're badly designed. One does not simply read these charts. There are bars with lengths difficult to compare, and chart text running in many directions. There are data labels obscured by bars, and legends in little boxes. The very page is riddled with garish colours, 3d effects and heavy gridlines...

And there are a lot of them. Open any annual report, or government publication: it's about even odds that you'll find some proper doozies.

Finally, people don't want to look at charts because, ideally, they want to already know the stuff that's in the chart, without having to look at the chart at all (much like Goran Peuc's product users).

Given that telepathy is not currently an option - and that charts can be a quick way to share findings - what can be done to get people to look at charts?

It probably helps to distinguish between some different kinds of charts.

Charts that analysts use to figure stuff out

Analysts generally do like to look at charts - but the way they use them is often different from other users. When I'm doing data analysis, I end up making lot of charts - they're a quick way to try and spot interesting things. In that exploratory context, it doesn't matter if the colours are hideous and the text is on its side (I already know what it says). Getting rid of chart cruft is nice - but a lot of the time it doesn't really matter because I'm going to just chuck the whole chart anyway. For analysts, charts are quick, cheap and disposable - and most of them get tossed.   

This means that when analysts have found the cool stuff, it's important that they switch gear from thinking about exploring the data (where charts are cheap disposable ephemera), to thinking about how to show off the data in presentations and reports (where charts live on forever in pdf - or at least until bitrot takes them). 

Presentation and report charts

The main audiences for report and presentation charts are people who make decisions that are supposed to be data-driven / evidence-based.  Many of these people (policy makers, service planners etc.) do not want to look at your charts - for all the reasons outlined above - but especially, because they're busy and they'd just like to know the stuff already.  

The risk is that they won't look at your chart, but will make policy or plan services anyway. 

What can you do to minimise this risk? 
  • Present your key findings with static charts: use interactive tools as supplementary enrichment for your more engaged users. Interactive tools - even really clear, aesthetically pleasing and well-designed tools - involve both some time and a learning curve.
  • Make your charts easy to read and interpret. A few things to do are listed below:
    • getting rid of all vertical text
    • showing data labels where possible (people go back and forth about including data labels: I've usually found that policy makers / service planners want them, and that they serve as helpful reference points in discussions).
    • labeling data series (and avoiding legends)
    • getting rid of boxes and borders
    • removing chart cruft and avoiding bad default settings
    • using white space to chunk related data series (for bar charts)
    • Using colour sparingly and with purpose
  • Talk to your users and be on hand to explain things that aren't clear 
  • Assess whether the potential gain from an innovative chart design exceeds the likely costs associated with unfamiliarity and the time needed to learn to interpret it

Charts for public education

From what I've seen, charts for public education split into two broad types: infographics and interactive visualisations. The former frequently suffer from what I'm sure I've seen described as 'loads of blokes waiting for the toilet' syndrome.  Here's an example from vis4net  (given as an illustration of a terrible infographic).

U.S. insurance reform infographic

There are good ones to be found though.

Interactive data visualisations - even those using directed stories - require users to invest time both to learn the interface and explore the data. Good design - both in terms of interface and aesthetics - strongly influences whether this is an enjoyable or frustrating process (and hence user attrition rates).
There are some great examples out there:  Nelson Davis's Visualizing 'A Problem from Hell' - The Effect of Genocide and War is one of the best I've seen recently.


Thanks to Goran Peuc's 'Nobody wants to use your product' which seems very applicable to chart design (and is a great read).