Sunday, 26 July 2015

Crime and employment - Color as a trend

I was playing around with Qlik Cloud again. I grabbed some data from the Irish Central Statistics Office on employment statistics in Ireland and reported crime - both over a period from Q1 2003 up to, and including, Q1 2015.

It was easy enough to upload the data to the cloud and then load it into the application. A scatter chart seemed to be a good choice to see if there is any correlation between the two sets of data:


My first impression of the correlation is that there doesn't appear to be one. Perhaps there is a small negative correlation that crime incidents will reduce as unemployment increases (which is not what I would have thought before looking at the data).

The second thing that I thought about was that I couldn't quickly see the trend of the data in this chart. Now, I know that a line chart would be more useful for seeing any trend, but I felt that, with each dot on the scatter representing a calendar quarter, it would be useful to discern the trend in this chart. I thought that it might be useful to use color to achieve this.

I had a field called QuarterNumber, which is a 5 digit number representing the four digit year and the quarter number from 1 to 4. I created this color expression:

  ColorMix1(
    (QuarterNumber-Min(Total QuarterNumber))/
    (Max(Total QuarterNumber)-Min(Total QuarterNumber)),
    LightGray(),
    LightBlue()
  )

This results in a chart in which it is very easy to see where in time a point exists. This, I believe, adds more clarity to the chart:



As to the analysis, it appears that the negative correlation is true for many crimes, and that shows up in the overall figure. However, crimes that people are quite concerned about - theft, burglary and robbery - show a different correlation:


With those three types selected, there is a distinct positive correlation.

The good news for the Irish is that the highest quarter - Q4 of 2014 - was only 29,088 of such incidents. This is a very low percentage and Ireland is actually one of the safest countries in the world to live.


Stephen Redmond is a Data Visualization professional. He is author of Mastering QlikView, QlikView Server and Publisher and the QlikView for Developer's Cookbook
Follow me on Twitter   LinkedIn

6 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete
  5. This comment has been removed by a blog administrator.

    ReplyDelete
  6. This comment has been removed by a blog administrator.

    ReplyDelete