Statistics: Telling Stories with Data Visualization
By: Priyam Banerjee
Tags: Data Science, Statistics, Data Visualization, Charts And Graphs, Data

Statistics: Telling Stories with Data Visualization

Pictures say a thousand words. Visualization of data prepares the human mind to create insight based action.

Photo by Adeolu Eletu on Unsplash

In my earlier post, I had written about the effective usage of tables to draw insights from raw data. However effective tables may be in capturing the nuances from the data, sometimes too many numbers make it look cumbersome. In such a case how do you tell say a story from the data? In this article, I’ll attempt to put forward some effective techniques to pictorially represent data.

Before I start, a valid question to ask is what comes to the mind at the mention of the words “pictures” or “visuals”? I would guess, some form of art. You think of the portrait hanging on your room’s walls or more famous work of art like Monalisa and others. It is the same while mining data, it is a work of art and it all depends on how best you can use imagery to convey a driving point to your audience. It all depends on the end objective that you wish to solve.

Hence, it is difficult for any single blog post to give you an exact direction on what chart to draw for each situation. Rather, this post will:

Explain the need for visualization Describe the steps required for effective visualization Demonstrate data visualization in action Provide a simple overview of creating these visualization using one of the most commonly available tools — MS PowerPoint

The reader who will use it needs to use his/her own intuition and grow with experience to make those tell the story.

Why do we need Visualization?

The world is facing a deluge of data. You would have heard quotes like “Data is the new Oil” or “it is a nuclear power” multiple times. But what does trillions of data points being generated around the world every second mean to you? It is probably just a stream of numbers. Yes, up to a point of time you would be able to produce tables to summarize it, but beyond that, it becomes too much for the brain to process it. Is there an easier way of understanding it? Why don’t we make the use of sufficient imagery or in essence, data visualization? Data visualization can arrange the data in an efficient manner, making it easier for the human mind to understand the composition of the data, highlight any patterns or outliers, compare one group of data with other and also identify any relationship between them, if any.

A visualization well done can tell a story. In 2020, the data on top of anyone’s mind is Covid-19. If at any point in time, you wanted to know how the infection has progressed over time in any country, say India, it is easiest to look at the chart of daily confirmed cases:

Fig 1: Daily Covid-19 confirmed cases in India

Look at the chart and think what can you see in this simple representation? India went from 0 cases in end-January, 2020 to a per day infection of about 3,500 in mid-May. The cases started picking up slightly around end-March to early-April. While it increased steadily in April, in May the huge jump has been very concerning. So, look how just drawing a line chart made you think of at least 3 observations! Think of the thousands of data points, i.e., Covid-19 test results of thousands of people that have been summarized by this simple curve!

What happens if you want to add some more information? How about we want to know how recoveries fared over time? Look at the chart and think of the insights you can infer. Also, notice how the chart and the vertical axis titles have been changed to tell the crux of the story. A legend has been added to explain which curve shows confirmed case vs recovery.

Fig 2: Daily confirmed and recovered Covid-19 cases in India

Let us take another example. Have you wondered, on LinkedIn, when you have thousands of contacts and followers, is there a way to understand how all of them are connected to you professionally and socially? LinkedIn had a map to visualize them for you. Look at the video below, narrated by none other than DJ Patil, on how prior to 2014 they used to give you the ability to understand your network connections better through cool visualizations:

Video: Erstwhile LinkedIn Network Maps

While the above has been discontinued in 2014, the feature was one of the coolest features of LinkedIn. However, some recent open source tools like Python can create some similar visuals, if not exactly the same.

We spoke about the niceties of data visualization. But are there any disadvantages? Take a look at the Covid-19 charts. Does it show the exact number of confirmed and/or recovery cases per day? It can’t show you the exact count or precision which specific groups like Governments, scientists and front-line healthcare workers may need for their work, which can be obtained via a tabular representation. However, they provide an approximate understanding, which is good for a larger group of people who are tracking the infection growth and praying for a “flattening of the curve”. Also, a good story via visualization takes a long time to create.

How to Start?

In a room full of audience, when you want to share a message, you may sometimes want to draw pictures on the whiteboard. What goes on in your mind then? Probably, what is the best way to convey your message and what is the best form of a drawing that would convey that very easily? So, as you can imagine there are a few steps you need to follow:

Fig 3: Steps to an impactful visualization

Data Visualization in Action

To look at various types of visualization in action, we need to understand the different situations where they are necessary. The following are three important things it can do with your data:

Fig 4: How does visualization help?

Let us first start with the first thing, breaking down the components. These are times when you have data and you wish to understand what makes it up. For example, if you wish to understand the composition of workers in a factory, following are a few ways to visualize:

Fig 5: Pie chart showing the proportion of different age employees among 10,000 total employees

Next, A 100% Stacked Column chart (below, Fig 6) can show the sub-groups within a group. In this example, we can easily find the gender composition within age buckets. Notice how we can infer better by better usage of colours.

Fig 6: 100% Stacked Column chart showing % of males vs females within age groups

Also, note how these charts help in comparing (our second interest area, per fig 4) the groups on the basis of proportion. If a comparison based on absolute difference is needed, a stacked column chart (not 100%) like Fig 7 can help.

Fig 7: Stacked Column chart showing count of males vs females within age groups

The bar charts are an extension of the column charts, where the bars move horizontally instead of vertically in the case of column charts. Also, take a look at tree-map charts for composition and comparison:

Fig 8: Tree-map charts showing composition through accumulation as well as comparison with other groups

Other very important graphing techniques for quantitative data to understand their composition are area charts and waterfall charts.

Fig 9: Area chart

Fig 10: Waterfall Chart

We have now seen some charts that show how to break down data into granular constituents as well as some ways you can compare the data of those constituents. There are some other ways of comparing data constituents both over time and at static points. Take a look at the Covid-19 infection and recovery count charts above in Fig 1 and 2. These are line charts that compare how the number of infections and recoveries change over time or compare between 2 time points.

One can also make use of simple bar or column charts to show comparison over time as well as at a point in time. For example, among the workers of XYZ Inc., you may want to know which state they went to school in:

Fig 11: Bar Chart

Do note that you can create multiple bars for each category or time point on the horizontal axis if there is more than one information you would like to plot but which follow the same unit scale.

Let us move to the Statistical Analyses that can be demonstrated by visualization. Invariably, the first type is a histogram showing the distribution of the data. For example, if you wish to understand the distribution of XYZ Inc. workers’ heights, the histogram will explain the same:

Fig 12: Histogram showing distribution of workers’ heights

Note how this looks similar to a column chart, but in essence, is quite different from it. Firstly, the purpose is different with histogram showing a distribution while column charts compare categories or time periods. Next, a histogram can handle continuous forms of data with ranges grouped into bins.

Deciphering the distribution of data gives you the possible values of a particular variable like height and how often they occur. If you were to order for protective gear for the workers, you have an approximate understanding of what quantity to order using the histogram instead of measuring the exact height of each of the 10,000 workers which is time consuming.

While a variable like height generally follows a normal distribution (a bell curve like shape), there are many other variables in real life that do not. As an example, let us consider that the workers file a workers’ compensation insurance claim if they get hurt on the job.

Fig 13: Histogram showing distribution of workers’ insurance claims

Now that we have looked at plotting distributions, another important use of visualization in statistical analysis is understanding relationship and that brings us to scatter plots.

Fig 14: Scatter Plot

One other very useful chart for statistical analysis of data is the box plot (or sometimes called the “box and whiskers plot”). It can describe the data using multiple measures like minimum, first quartile, median, third quartile and maximum. What if you wanted to understand the data on the 3 products of XYZ Inc., for example, how many months pass by before you receive the first complaint for a product? Say you have collected data on 5,000 units each of portable coolers, smart inverters and central air conditioning systems. How do you represent?

Fig 15: Box Plot

While the techniques explained above can help in visualizing data in a large number of cases, there are multiple other innovative ways of visualizing data like demographic maps (see an example below), heat maps, etc. With multiple dashboard builders and open source tools easily available like Tableau, Qlikview, R-Shiny, Python, etc. many cool dashboards with such visualizations can be created. Reviewing the tools is beyond the scope of this article but we shall look at a commonly available tool, Microsoft PowerPoint, which can build a majority of these charts.

Fig 16: World Map using Microsoft PowerPoint

Creating Visualization using commonly available tools

All the charts shown above have been created using Microsoft’s PowerPoint which is a very commonly available tool if you work on a system with Microsoft Office. So, you actually do not need to purchase fancy tools to create effective stories using visualization. However, this is true for moderately sized datasets. If your data is big in size then there may be a need to look for alternatives that can handle size. Below is a simple step by step approach to create a visualization in PowerPoint:

Fig 17: Developing visualization using Microsoft PowerPoint

Conclusion

In this article, we have seen multiple techniques to develop multiple stories from data using pictures. When you have huge streams of data and you do not intend to dive into the mathematical intricacies, visualization of data can train your mind to infer the important conclusions. While there are multiple tools to develop visualization today, to get started with a moderately sized data, doesn’t need anything beyond commonly available tools like Microsoft Excel and PowerPoint. With the ever increasing amount of data in today’s world, it is imperative today to build a strategy to easily look at it and understand visible patterns to better formulate the analytics to follow. So, take the data set most accessible to you today and see what visuals you can create!