10 Ways to Visualize your data

You’ve been avidly collecting data. You’ve figured out how to process it all and set up your formulas… but how do you transform those into powerful KPI dashboards and genuinely valuable data visualizations that bring your insights to life?

There’s an array of data visualization types, and which you choose for your data depends on what measurement you are trying to emphasize and what information you are trying to reveal. If you want to know when you should use a column chart versus a line chart – and yes, there’s a big difference – then this is the guide for you.

Indicators

What is Indicator?

An indicator data visualization is a vivid way to present changes that you’re tracking in your data. Typically, this uses something like a gauge or a ticker to show which direction the numbers are heading in.

What does it visualize?

This allows you to display one or two numeric values. You can also add additional titles and a color-coded indicator icon, such as a green “up” arrow or a red “down” arrow to represent the value, and changes in this value, in the clearest way possible.

What does it measure?

Indicators are clear, simple ways to demonstrate how your organization is doing on a particular metric, and whether you’re heading in the right direction.

What Sources of Data Does It Use?

You can feed in just about any form of numerical data source, so long as you can continually refresh
these numbers, so that the movement of the ticker / gauge / color coding is accurate.

Example:

Above you can see a “gauge” indicator showing how revenue figures are progressing towards the target, and a “numeric” value indicator showing the annual increase to average admission cost

Line Chart

What is Line Chart?

Line charts plot data points on a graph and then join them up with a single line that zigzags from each point to the next.

What does it visualize?

These are super simple and very popular, because they give you an immediate idea of how a trend emerged over time. You can see when peaks and troughs hit, whether the overall values are going up or down, and when there’s a sharp spike or drop in numbers.

What does it measure?

There are many different business cases that work well with line charts. Pretty much anything that compares data, or shows changes, over time is well suited to this type of visualization.

Again, it’s all about visualizing a trend. You can also compare changes over the same period of time for more than one group or category very easily, by adding a “break by” category.

What Sources of Data Does It Use?

Again, anything that gives solid, discrete numbers, organized by time. So, you could use sales figures
from your CRM, pull in tables of data showing total numbers of new sign-ups, record showing income
per month. Info from SQL databases is particularly easy to translate into line charts.

Example

This line chart shows sales revenue over the past year. For more granular detail, could then add a “break by” category to analyze expenditures of different business units, also over the past year.

Column Charts

What is Column Chart?

A column chart graphically represents data by displaying vertical bars next to each other, lined up on the horizontal axis.

Each bar represents a different category, and the height of the bar correlates with numbers on the values axis, on the left hand side.

What does it visualize?

Column charts give you an immediate way to compare values for related data sets side by side, highlighting trends in a swift, visual way.

They can include multiple values on both the X and Y axis, as well as a breakdown by categories displayed on the Y axis.

What does it measure?

Like a line chart, column charts are often used to show trends over time, for example sales figures from month to month or year to year.

However, they’re also useful for comparing different things side by side, e.g. how well two different products are selling in the same month.

What Sources of Data Does It Use?

Column charts are straightforward visualizations and can draw on data from just about any data source,
so long as it’s consistent and presented numerically.

Example

This column chart shows total page views and sessions spent on a website by online visitors on consecutive months

If you want to emphasize overlapping trends over time, you can also combine column charts with line charts, as in this chart that compares total revenue with units sold, month by month.

Bar Chart

What is Bar Chart?

A bar chart is essentially a column chart on its side: values are presented on the horizontal axis and the categories are on vertical axis, on the left.

What does it visualize?

Bar charts are more commonly used to compare different values, items and categories of data. From a purely practical perspective, they’re also used over column charts when the names of the categories are too long to comfortably read on their side! They are not usually used to show trends over time.

What does it measure?

Like column charts, bar charts are frequently used to compare the total number of items within a category, for example total sales or the number of respondents that selected a particular answer.

However, they’re also handy for visualizing sub-categories using color coding.

What Sources of Data Does It Use?

Data used to compile bar charts could come from Google Analytics, your CRM, sales figures or any other
kind of database that stores data numerically.

Example

The bar chart above represents the spread of customers per age group, but it also gives a quick, visual representation of which products each type of customer is most likely to buy, too.

Pie Charts

What is Pie Chart?

Pie charts show values as a “slice” of a whole circle (the whole pie). Numerical Values are translated into a percentage of 360 degrees, represented by the arc length, and each slice is color coded accordingly

What does it visualize?

Pie charts show what percentage of the whole is made up of each category. That means they deal with total numbers, and trends in overall responses, rather than changes over time.

That means it’s a good idea to use a pie chart when displaying proportional data and/or percentages. Remember that the point is to represents the size relationship between the parts and the entire entity, so these parts need to add up to a meaningful whole

What does it measure?

It makes sense to use a pie chart when you want to get a rapid, overall idea of the spread of data – for example, market share or responses to a survey – rather than when you’re concerned about the precise figures they represent.

What Sources of Data Does It Use?

Survey and questionnaire responses, data from social media sources or Google analytics, total sales
figures and so on will all work. Keep it fairly simple though – if you have more than 6 categories, your
pie chart won’t give you much information at a glance, especially if there’s no clear “winning” answer.

Example

In the example above, you can tell in a millisecond which marketing channels bring in the most leads, thanks to the pie chart structure.

Area Chart

What is Area Chart?

An area chart is similar to a line chart in that it plots figures graphically using lines to join each point – but it’s more dynamic and visual, giving an idea of comparative mass.

The area under the jagged points formed by the line is filled in with color, so that it looks kind of like a mountain range.

What does it visualize?

Area charts are used to demonstrate a time-series relationship. Unlike line charts, though, because they also represent volume in a highly visual way.

The information is shown along two axes and each “area” is depicted using different color or shade to make it easier to interpret.

What does it measure?

Area charts are great for showing absolute or relative (“stacked”) values – as in, showing trends as you do in a line chart, but comparing a few different trends at once.

They’re particularly effective if there’s a broad disparity between some of these trends, as it makes the comparison starker, too.

What Sources of Data Does It Use?

Any data that works for line charts should work for area charts, too: SQL data tables, sales figures from
your CRM, financial data and so on – but you must be able to organize the information by day / month /
year, etc. to demonstrate change over time.

Example

Using an area chart, you can easily compare sales figures for different products by quarter, and track trends in total sales volume over time.

Pivot Table

What is Pivot Table?

A pivot table brings together, simplifies and summarizes information stored in other tables and spreadsheets, stripping this down to the most pertinent insights.

They are also used to create unweighted cross tabulations fast.

What does it visualize?

Pivot tables are one of the most simple and useful ways to visualize data. That’s because they allow you to quickly summarize and analyze large amounts of data, and to use additional features such as color formatting and data bars to enhance the visual aspects

What does it measure?

Pivot tables are more about simplifying tables than changing it into a graphical representation. That means they are helpful for displaying data with several subcategories in easily digestible ways.

What Sources of Data Does It Use?

Existing databases, tables and spreadsheets, including Excel. A good example is a company’s
asset management.

Scatter Plot

What is Scatter Plot?

Scatter charts are a more unusual way to visualize data than the examples above. These are mathematical diagrams or plots that rely on Cartesian co-ordinates.

If you’re using one color in the graph, this means you can display two values for two variables relating to a data set, but you can also use two colors to incorporate an additional variable.

What does it visualize?

In this type of graph, the circles on the chart represent the categories being compared (demonstrated by circle color), and the numeric volume of the data (indicated by the circle size).

What does it measure?

Scatter charts are great in scenarios where you want to display both distribution and the relationship between two variables.

What Sources of Data Does It Use?

CRM, sales and lead data that comes with granular information on buyers – age, gender, location and
so on – are particularly useful for this kind of graph.

Scatter Map / Area Map

What is Scatter map?

A scatter map allows viewers to visualize geographical data across a region by displaying this as data points on a map.

What does it visualize?

Scatter maps / area maps work a little like scatter graphs, in that the size and color of the circle illustrates quantities and types of data.

However, it goes a step further by also showing where this activity is concentrated, geographically speaking.

What does it measure?

You can incorporate up to two sets of numeric data, using circle color and size to represent the value of your data on the map.

What Sources of Data Does It Use?

The more precise information you can enter about geographic location, the better. For example, entering
the country and city, or latitude and longitude information, alongside the data you want to map will help
you create a very accurate scatter or area map.

Example

Above is an example scatter map that gives a breakdown of the number of website visitors a company has by location. The larger the circle, the higher the number of visitors from that city on the map.

Tree-map

What is Treemap?

A treemap is a multi-dimensional widget that displays hierarchical data in the format of clustered rectangles, which are all nested inside each other.

What does it visualize?

Data that comes under the same broad heading is grouped by color, and within each section, the size of the rectangles relate to the data volume or share.

What does it measure?

These types of chart can be used in all kinds of different scenarios where you want to incorporate more granular insights than other visualizations will allow.

For example, you might want to use it instead of a column chart, to give a sense of trends in the popularity of a certain product, but also include and compare many categories and sub-categories.

What Sources of Data Does It Use?

You can bring in data from CRMs, Google Analytics and AdWords, social media, spreadsheets, etc. Bear
in mind, though, that like a pie chart, you’re looking at the percentage make-up of each category more than changes over time.

Example

In the example above, you gain an overview of how different marketing campaigns breakdown by region.

So this were the 10 important visualizations you should be knowing. From the next articles we will study each of them in detail.

Happy Learning ! 🙌🚀🚀

Understanding Measures of Dispersion in an easy manner !

Introduction

In the field of statistics for both sample and population data, when you have a whole population you are 100% sure of the measures you are calculating. When you use sample data and compute statistic then a sample statistic is the approximation of population parameter. When you have 10 different samples which give you 10 different measures.

Measures of dispersion

The mean, median and mode are usually not by sufficient measure to reveal the shape of distribution of a data set. We also need a measure that can provide some information about the variation among data set values.

The measures that helps us to know the spread of data set is called are called as “Measures of dispersion”.  The Measures of Central Tendency and Measures of dispersion taken together gives a better picture about the dataset.

Measures of dispersion are called Measures of variability. Variability also called as dispersion or spread refers how spread data is. It helps to compare data set with other data sets. It helps to determine the consistency. Once we get to know the variation of data, we can control the causes behind that particular variation.

Some measures of dispersion are :

  1. Range
  2. Variance
  3. Standard deviation
  4. Interquartile Range (IQR)

Note: In this blog we won’t be discussing IQR, as it has some other application which we will cover in detail

Range

The difference between the smallest and largest observation in sample is called as “Range”. In easy words, range is the difference between the two extreme values in the dataset.

Let say, if X(max) and X(min) are two extreme values then range will be,

Range = X(max) – X(min)

Example: The minimum and maximum BP are 113 and 170. Find range.

Range = X(max) – X(min)

= 170 – 113

= 57

So, range is 57.

Variance

Now let’s consider two different distributions A and B which has data sets as following

A = {2, 2, 4, 4} and B = {1, 1, 5, 5}

If we compute mean for both the distributions,

                   

We can see that we have got the mean as 3 for both the distribution, but if we observe both the distributions there is difference in the data points. When observing distribution A we can say data points are close to each other there is not a large difference. On the other side when we observer distribution B we can observe that data points are far then each other there is a large difference. We can say that the distance is more that means there is more spread and this spread is called “Variance”.

Variance measures the dispersion of set of data points around their mean. Variance in statistics is a measure of how far each value in the data set from the mean.

The formula for variance is different for both Population and Sample
Why squaring?

Dispersion cannot be negative. Dispersion is nothing but the distance hence it cannot be negative. If we don’t square we will get both negative and positive value which won’t cancel out. Instead, squaring amplifies the effect of large distances.

Let us consider first variance for population, it is given by formula

When we computed the mean we saw it was same but when we compute the variance we observed that both the variance are different. The variance of distribution A is 4 and that of distribution B is 1.

The reason behind the large and small value in variance is because of the distance between the data points.

When the distance between the data points is more which means dispersion or spread is more hence we get higher variance. When the distance between the data points is less which means dispersion or spread is less hence we get lower variance.

For sample variance, there is little change in the formula.

Why n-1 ?

As we now we take sample from population data. So sample data should surely make some inference about the population data. There are different inferences using sample data for population data.

Now let us consider that we have a population data of ages and we are plotting it on the graph and it increasing across the x-axis. Also we have the mean at the middle.

So if we randomly select sample in the population data, the sample mean and population mean is almost equal.

If we take a random sample then the distance between the mean of random sample and actual sample is huge. So sample mean <<<<< population mean and sample variance <<<< population variance. Here we are underestimating the true population variance.

Hence we take the n-1 during the calculation of variance using sample data. n-1 makes the distance shorter then that of using n. Therefore to reduce the distance we use ‘n – 1’ instead of ‘n’ while computing sample variance. This ‘n-1’ is called as Bessel’s correction.

Also while discussing further topics we will come across a term Degree of freedom = n – 1.

Importance of Variance

  1. Variance can determine what a typical member of a data set looks like and how similar the points are.
  2. If the variance is high it implies that there are very large dissimilarities among data points in data set.
  3. If the variance is zero it implies that every member of data set is the same.

Standard deviation

As variance is measure of dispersion but sometime the figure obtained while computing variance is pretty large and hard to compare as unit of measurement is square.

Standard deviation (SD) is a very common measure of dispersion. SD also measures how spread out the values in data ste are around the mean.

More accurately it is a measure of average distance between the values of data and mean.

  1. If data values are similar, then the SD will be low (close to zero).
  2. If data values are of high variable, then the SD will be high (far from zero).

  • If SD is small, data has little spread (i.e. majority of points fall near the mean).
  • If SD = 0, there is no spread. This only happens when all data items are of same value.
  • The SD is significantly affected by outliers and skewed distributions.

Coefficient of variation

Standard deviation is the most common measure of variablity for a single data set Whereas the coefficient of variation is used to compare the SD of two or more dataset.

Example

     

  • If we observe, variance gives answer in square units and so in original units and hence SD is preferred and interpretable.
  • Correlation coefficient does not have unit of measurement. It is universal across data sets and perfect for comparisons.
  • If Correlation coefficient is same we can say that two data sets has same variability.

Python Implementation 

Python code for finding range

import numpy as np
import statistics as st

data = np.array([4,6,9,3,7])
print(f"The range of the dataset is {max(data)-min(data)}")

The Output will give us the value of range i.e. 6

Python code for finding variance

import numpy as np
import statistics as st

data = np.array([3,8,6,10,12,9,11,10,12,7])
var = st.variance(data)

print(f"The variance of the data is {var}")

The Output will give us the value of variance i.e. 8.

Python code for finding Standard deviation

import numpy as np
import statistics as st

data = np.array([3,8,6,10,12,9,11,10,12,7])
sd= st.stdev(data)

print(f"The standard deviation of data points is {sd}")

The Output will give us the value of SD i.e. 2.8284271247461903

Conclusion

So here we have understood about Measures of variability. Measures of Central Tendency and Measures of Variability together are called Univariate Measures of analysis.

Measures which deals with only one variable is called as univariate measures.

In the next section, we are going to discuss about more interesting topic such as 5 number summary statistics and skewness.

Happy Learning !! 

 

 

Is Statistics important for Data Science?

Introduction

Statistics is the science of conducting studies to collect, organize, summarize, analyze and draw a conclusion out of the data. It is nothing but learning from data.

The field of math Statistics mainly deals with collective information, interpreting those information from data set and drawing conclusion from the it. It can be used in various fields.

For example, when we observe any cricket matches there are various terms used like batting average, bowling economy, strike rate, etc. Also we can observe many graphs and data visualizations. This things are the part of statistics. Here information is analyzed and various results are shown accordingly.

We can talk about statistics all the time but do we know the science behind it?

Here by using various methods various large cricket organizations compare players, teams and rank them accordingly. So if we learn the science behind it we can create our ranking, compare different thing and debate with hard facts.

Stats is very important in the field of analytics, Data Science, artificial intelligence ai, machine learning models, deep neural networks (deep learning). It is a used to process complex problems in the real world so that data professionals like data analyst and data scientist can analyze data and retrieve meaningful insights from data.

In simple words, stats can be used to derive meaningful insights from data by performing mathematical computations on it.

The field of statistics is divided into two parts Descriptive statistics and Inferential statistics. And data has two types quantitative data and qualitative data and it can be either labelled data or unlabeled data.

Some important terms used

Population: In statistics, a population is the entire pool from which statistical sample is drawn.  For example: Consider all students in a college. All students in the college are considered as population. Population can be contrasted with samples.

Samples: Sample is subset of the population. Sample is derived from population. It is representative of population. It refers to set of observation drawn from population.

It is necessary to use samples for research because it is impractical to study the whole population. For example, we want to know the average heights of boys in college.

So we can’t consider population as there can lots of boys and measuring height and calculating height is not reliable. So for such cases samples are taken. As sample is representative of population. Certain amount of boys are selected as a sample and average is computed.

Variable: A characteristic of each element of population or a sample is called as variable.

Also read: Essential Mathematics to master Data Science

Some of the important topics which we will be discussing in further articles are:

Basics statistics:

  • Terms related to statistics.
  • Random variables
  • Population and sample concept.
  • Measures of central tendency
  • Measures of variability
  • Sampling Techniques
  • Measures of Dispersion
  • Gaussian / Normal Distribution

Intermediate Statistics

  • Standard Normal Distribution
  • z-score
  • Probability Density function (pdf)
  • Cumulative distribution function (cdf)
  • Hypothesis testing
  • Plotting graphs
  • Kernel Density Estimation
  • Central limit theorem
  • Skewness of data
  • Covariance
  • Pearson correlation coefficient
  • Spearman Rank Correlation

Advanced Statistics

  • Q-Q Plot
  • Chebyshev’s inequality
  • Discrete and continuous distribution
  • Bernoulli and Binomial distribution
  • Log Normal Distribution
  • Power Law distribution
  • Box – cox transform
  • Poisson Distribution
  • z-stats
  • t-stats
  • Type 1 and Type 2 error
  • chi-square test
  • Annova testing
  • F-stats
  • A/B testing

Looking at the topics we can interpret that topics are tough but it depends on level of understanding and determination to learn. It’s not any rocket science and can be easily done.

It’s pretty much important that you know statistics because it’s going to be the pre-requisite for you further Data Science journey. So let’s kickstart our journey of statistics here.

The best way to learn anything is to understand it properly and interpret it by implementing it. As we learn from our mistakes so it’s better to keep learning unless you don’t understand it properly.

Before jumping into deep data science I will like to repeat that learning “Statistics” is must.

Let’s go 🚀🚀