## 24 May 2015 15:14 GMT

For the last nine months, along with my day-to-day work for the House of Commons Library, I have been working on a project to produce a 2015 General Election results dataset for Parliament, as well as a briefing paper summarising the results.

As you can probably imagine, Parliament needs detailed and accurate election results data as soon as possible in order to carry out its functions, for everything from allocating office space and Short Money, to reporting the gender balance of MPs, to simply finding out as quickly as possible who is coming to work as an MP for the first time.

It was an intense project that involved developing a database and a web front-end for managing the data, as well as recruiting a team of (amazing) volunteers to gather and verify it.

We started entering election results data at 4:00am on the Friday following the election, which was very exciting, although we could have done without the fire alarm that meant we had to evacuate the building for half an hour at 5:15.

This week we made our data public. The full results can be downloaded in two CSVs from Parliament's research briefings website, along with the briefing paper. You can also explore the same data interactively through a new website developed by Parliament's rapid apps team called General Elections Online, or Geo for short.

The results have been gathered directly from Returning Officers and include complete data on polling day electorates and invalid ballots. A future edition of the dataset will also include declaration times.

While we have done everything possible to ensure the figures are accurate, the data should be treated as *provisional*. We will correct any errors we find as quickly as possible, so always check online for the latest version of the dataset and briefing paper whenever you intend to use them.

## 25 May 2015 15:01 GMT

When I first launched this blog I designed it around a single colour theme. Everything was rendered in black and white with a blue accent, which was present in the masthead and the links, and which became the predominant colour in all of the graphics. I now realise what a terrible idea that was for a blog that features data visualisation.

Trying to keep all of the graphics consistent with the colour scheme proved extremely limiting and was starting to make the site feel predictable and dull. More importantly, the choice of colours in a visualisation should be decided by what you are trying to reveal in the data, rather than the context in which the data is presented.

So I have tweaked the design to make the look and feel completely neutral with regard to colour, leaving me free to choose whatever colours I want or need for visualisation purposes. I have also retrospectively changed some of the earlier visualisations to introduce more variety to the visual style and to use more appropriate colours.

Lesson learned: information design should not be artificially constrained by web design.

## 25 May 2015 15:45 GMT

How much experience of Parliamentary service does the newly elected House of Commons have? The answer is that it depends on how you measure it. The following chart shows the mean and the median number of years served in the Commons by MPs elected at each general election since 1983.

The mean is what people typically think of when they talk about averages — it's the total number of years that MPs in each group have worked in the Commons divided by the number of MPs in the group; while the median is the value which divides the group in half — in each group of MPs, half have fewer years of Parliamentary service than the median and half have more.

As the chart shows, the typical number of years service among MPs elected at each general election differs depending on whether you measure it using the mean or the median. What's more, the trends differ between the two measures.

Using the mean, the MPs elected in 1997 were the least experienced of any Parliament since 1983. But using the median, the group of MPs elected in 2001 were the least experienced.

So which is the more appropriate measure? Arguably, you need to consider both measures, because the difference between the two reflects the shape of the distribution of experience among the MPs in each group.

The following histograms show the distribution of Parliamentary experience among each cohort of MPs elected at general elections from 1983 to 2015. In each histogram the bars show the percentage of MPs whose total length of service in the House of Commons falls between the numbers shown on the X axis at the bottom of the chart.

So around 29% of MPs elected at the 2015 General Election have fewer than four years experience in the Commons — these are the MPs elected for the first time at the 2015 General Election plus some of those elected at by-elections during the last Parliament.

The difference between the mean and the median in a group is determined by the overall shape of the distribution. In more normal distributions — the more convex and bell-shaped groups — the mean and the median are closer together; while in more skewed distributions — the more concave and L-shaped groups — the mean and the median are further apart.

Generally speaking, the mean is the better measure for normally distributed data, while the median is a better way to summarise data that is skewed. Here the skewness of the distribution varies among groups of MPs, so if you had to choose just one measure of Parliamentary experience, the median is the more robust statistic.

The distribution of experience among MPs elected in 2010 and in 2015 is similar, but not identical. Both distributions are skewed. But both the mean and the median years of service are almost exactly the same in both groups. And although it is possible to identify the group of MPs newly elected in 2010 as a more experienced group in 2015 (among those with four to eight years experience) a similar sized group of newly elected MPs also joined the House in 2015, while at the same time the proportion of MPs with more than 12 years service fell.

So while many ministers now have several years experience in government, the new House of Commons is on the whole no more experienced than the last. But the precise mix of experience among elected MPs is particular to each Parliament.