UNIT – II: DESCRIPTIVE ANALYTICS
Introduction
Descriptive analytics is a statistical interpretation used to analyze historical data to identify
patterns and relationships. Descriptive analytics seeks to describe an event, phenomenon, or
outcome. It helps understand what has happened in the past and provides businesses the perfect
base to track trends.
Descriptive analytics is about finding meaning within data. Data needs context: analytics provide
the where and when turning figures into measurable patterns.
As a form of data analysis, descriptive analytics is one of the four key types of data analytics.
The others are diagnostic analysis, predictive analysis, and prescriptive analytics.
Descriptive analytics can be applied to a wide variety of everyday operational activities of a
business. Reports on inventory, various workflows, sales figures, and revenue statistics are all
based on descriptive analytics. Together, these reports offer a company a historical overview of
its operations. The data within such statements can be collected to serve as a base to create
specific snapshots of various business-related functions.
Overview of Description Statistics
Descriptive statistics refers to a branch of statistics that involves summarizing, organizing, and
presenting data meaningfully and concisely. It focuses on describing and analyzing a dataset's
main features and characteristics without making any generalizations or inferences to a larger
population.
The primary goal of descriptive statistics is to provide a clear and concise summary of the data,
enabling researchers or analysts to gain insights and understand patterns, trends, and distributions
within the dataset. This summary typically includes measures such as central tendency (e.g.,
mean, median, mode), dispersion (e.g., range, variance, standard deviation), and shape of the
distribution (e.g., skewness, kurtosis).
Descriptive statistics also involves a graphical representation of data through charts, graphs, and
tables, which can further aid in visualizing and interpreting the information. Common graphical
techniques include histograms, bar charts, pie charts, scatter plots, and box plots.
By employing descriptive statistics, researchers can effectively summarize and communicate the
key characteristics of a dataset, facilitating a better understanding of the data and providing a
foundation for further statistical analysis or decision-making processes.
Descriptive Statistics Examples
Example 1:
Exam Scores Suppose you have the following scores of 20 students on an exam:
85, 90, 75, 92, 88, 79, 83, 95, 87, 91, 78, 86, 89, 94, 82, 80, 84, 93, 88, 81
To calculate descriptive statistics:
Mean: Add up all the scores and divide by the number of scores. Mean = (85 + 90 + 75 +
92 + 88 + 79 + 83 + 95 + 87 + 91 + 78 + 86 + 89 + 94 + 82 + 80 + 84 + 93 + 88 + 81) /
20 = 1770 / 20 = 88.5
Median: Arrange the scores in ascending order and find the middle value. Median = 86
(middle value)
Mode: Identify the score(s) that appear(s) most frequently. Mode = 88
Range: Calculate the difference between the highest and lowest scores. Range = 95 - 75 =
20
Variance: Calculate the average of the squared differences from the mean. Variance =
[(85-88.5)^2 + (90-88.5)^2 + ... + (81-88.5)^2] / 20 = 33.25
Standard Deviation: Take the square root of the variance. Standard Deviation = √33.25 =
5.77
Example 2:
Monthly Income Consider a sample of 50 individuals and their monthly incomes:
$2,500, $3,000, $3,200, $4,000, $2,800, $3,500, $4,500, $3,200, $3,800, $3,500, $2,800, $4,200,
$3,900, $3,600, $3,000, $2,700, $2,900, $3,700, $3,500, $3,200, $3,600, $4,300, $4,100, $3,800,
$3,600, $2,500, $4,200, $4,200, $3,400, $3,300, $3,800, $3,900, $3,500, $2,800, $4,100, $3,200,
$3,600, $4,000, $3,700, $3,000, $3,100, $2,900, $3,400, $3,800, $4,000, $3,300, $3,100, $3,200,
$4,200, $3,400.
To calculate descriptive statistics:
Mean: Add up all the incomes and divide by the number of incomes. Mean = ($2,500 +
$3,000 + ... + $3,400) / 50 = $166,200 / 50 = $3,324
Median: Arrange the incomes in ascending order and find the middle value. Median =
$3,400 (middle value)
Range: Calculate the difference between the highest and lowest incomes. Range = $4,500
- $2,500 = $2,000
Variance: Calculate the average of the squared differences from the mean. Variance =
[($2,500-$3,324)^2 + ($3,000-$3,324)^2 + ... + ($3,400-$3,324)^2] / 50 = $221,684,000 /
50 = $4,433,680
Standard Deviation: Take the square root of the variance. Standard Deviation =
√$4,433,680 = $2,105.18
These calculations provide descriptive statistics that summarize the central tendency, dispersion,
and shape of the data in these examples.
Measures of Central Tendency
Measures of central tendency estimate a dataset's average or center, finding the result using three
methods: mean, mode, and median.
Mean: The mean is also known as “M” and is the most common method for finding averages.
You get the mean by adding all the response values together, and dividing the sum by the
number of responses, or “N.” For instance, say someone is trying to figure out how many hours a
day they sleep in a week. So, the data set would be the hour entries (e.g., 6,8,7,10,8,4,9), and the
sum of those values is 52. There are seven responses, so N=7. You divide the value sum of 52 by
N, or 7, to find M, which in this instance is 7.3.
Mode: The mode is just the most frequent response value. Datasets may have any number of
modes, including “zero.” You can find the mode by arranging your dataset's order from the
lowest to highest value and then looking for the most common response. So, in using our sleep
study from the last part: 4,6,7,8,8,9,10. As you can see, the mode is eight.
Median: Finally, we have the median, defined as the value in the precise center of the dataset.
Arrange the values in ascending order (like we did for the mode) and look for the number in the
set’s middle. In this case, the median is eight.
Variability (Also Called Dispersion)
The measure of variability gives the statistician an idea of how spread out the responses are. The
spread has three aspects — range, standard deviation, and variance.
Range: Use range to determine how far apart the most extreme values are. Start by subtracting
the dataset’s lowest value from its highest value. Once again, we turn to our sleep study:
4,6,7,8,8,9,10. We subtract four (the lowest) from ten (the highest) and get six. There’s your
range.
Standard Deviation: This aspect takes a little more work. The standard deviation (s) is your
dataset’s average amount of variability, showing you how far each score lies from the mean. The
larger your standard deviation, the greater your dataset’s variable. Follow these six steps:
1. List the scores and their means.
2. Find the deviation by subtracting the mean from each score.
3. Square each deviation.
4. Total up all the squared deviations.
5. Divide the sum of the squared deviations by N-1.
6. Find the result’s square root.
Data Visualization
Introduction and Definition
Data visualization is the practice of translating information into a visual context, such as a map
or graph, to make data easier for the human brain to understand and pull insights from. The main
goal of data visualization is to make it easier to identify patterns, trends and outliers in large data
sets. The term is often used interchangeably with information graphics, information visualization
and statistical graphics.
Data visualization is one of the steps of the data science process, which states that after data has
been collected, processed and modeled, it must be visualized for conclusions to be made. Data
visualization is also an element of the broader data presentation architecture discipline, which
aims to identify, locate, manipulate, format and deliver data in the most efficient way possible.
Data visualization is important for almost every professional discipline. Teachers use it to
display student test results, computer scientists to explore advancements in artificial intelligence
(AI) and executives to share information with stakeholders. It also plays an important role in big
data projects. As businesses accumulated massive collections of data, they needed a way to get
an overview of their data quickly and easily. Visualization tools were a natural fit to provide
useful information.
Visualization is central to advanced analytics for similar reasons. When a data scientist is writing
advanced predictive analytics or machine learning algorithms, it's important to be able to
visualize the outputs to monitor results and ensure that the models are performing as intended.
Visualizations of complex algorithms are generally easier to interpret than numerical outputs.
Why is data visualization important?
Data visualization provides a quick and effective way to communicate information in a universal
manner using visual information. Business professionals have different areas and levels of
expertise, but visualizations are meant to be understandable by anyone. Visualizations make it
easier for employees in an organization to make decisions and act based on insights derived from
them.
Visualizations help businesses in many ways. Some examples include the following:
They help isolate factors that affect customer behavior.
They identify products or services that need to be improved.
They make data more memorable for stakeholders.
They help organizations understand when and where to place specific products.
They can predict sales or revenue volumes.
Examples of data visualization
When computers were first applied to data visualization, one of the most common visualization
techniques was using a Microsoft Excel spreadsheet to transform the information into a table, bar
chart or pie chart. While these visualization methods are still used, more intricate techniques are
available, including infographics, bubble clouds, bullet graphs, heat maps, fever charts and time
series charts.
Other popular types of visualizations include the following:
Line charts. These charts are among the most basic and common techniques used. Line
charts display how variables can change over time.
Area charts. This visualization method is a variation of a line chart. It displays multiple
values in a time series -- or a sequence of data collected at consecutive, equally spaced
points in time.
Treemaps. This method shows hierarchical data in a nested format. The size of the
rectangles used for each category is proportional to the percentage of the whole each
represents. Treemaps are best used when multiple categories are present, and the goal is
to compare different parts of a whole.
Population pyramids. This technique uses a stacked bar graph to display the complex
social narrative of a population. It's best used when trying to display the distribution of a
population.
Scatter plots. This technique displays the relationship between two variables. A scatter
plot takes the form of an x- and y-axis with dots to represent data points.
Data visualization techniques
Depending on these factors, you can choose different data visualization techniques and
configure their features. Here are the common types of data visualization techniques:
Charts
The easiest way to show the development of one or several data sets is a chart. Charts
vary from bar and line charts that show the relationship between elements over time to
pie charts that demonstrate the components or proportions between the elements of one
whole.
Plots
Plots allow to distribute two or more data sets over a 2D or 3D space to show the
relationship between these sets and the parameters on the plot. Plots also vary. Scatter
and bubble plots are some of the most widely used visualizations. When it comes to big
data, analysts often use more complex box plots to visualize the relationships between
large volumes of data.
Maps
Maps are popular techniques used for data visualization in different industries. They
allow locating elements on relevant objects and areas — geographical maps, building
plans, website layouts, etc. Among the most popular map visualizations are heatmaps, dot
distribution maps, and cartograms.
Diagrams and matrices
Diagrams are usually used to demonstrate complex data relationships and links and
include various types of data in one visual representation. They can be hierarchical,
multidimensional, or tree-like.
Matrix is one of the advanced data visualization techniques that help determine the
correlation between multiple constantly updating (steaming) data sets.
Data visualization tools for everyone
Tableau is one of the leaders in this field. Startups and global conglomerates like Verizon and
Henkel rely on this platform to derive meaning from data and use insights for effective decision
making.
Apart from a user-friendly interface and a rich library of interactive visualizations and data
representation techniques, Tableau stands out for its powerful capabilities. The platform provides
diverse integration options with various data storage, management, and infrastructure solutions,
including Microsoft SQL Server, Databricks, Google BigQuery, Teradata, Hadoop, and Amazon
Web Services.
This is a great tool for both occasional data visualizations and professional data analytics. The
system can easily handle any type of data, including streaming performance data, and allows to
combine visualizations into functional dashboards. Tableau, as part of Salesforce since 2019,
invests in AI and augmented analytics and equips customers with tools for advanced analytics
and forecasting.
Power BI is exceptional for its highly intuitive drag-and-drop interface, short learning curve, and
large integration capabilities, including Salesforce and MailChimp. Not to mention moderate
pricing ($10 per month for a Pro version).
Thanks to Azure services, Power BI became one of the most robust data visualization and
analytics tools that can handle nearly any amount and any type of data.
First of all, the platform allows you to create customized reports from different data sources and
get insights in a couple of clicks. Secondly, Power BI is powerful and can easily work with
streaming real-time data. Finally, it’s not only fully compatible with Azure and other Microsoft
services but also can directly connect to existing apps and drive analytics to custom systems.
Cross Tables
Cross-tabulation is a statistical tool for categorizing data and making sense of it. It involves data
values that are mutually exclusive from each other. This data is collected in numbers but has no
value unless it means something. Like 1, 2, and 3 are mere numbers, but 1 trousers, 2 books, and
3 pencils are meaningful data points.
Cross-tabulation, or Cross-tabulation analysis, helps you make informed decisions from raw data
by identifying patterns, trends, and a correlation between parameters.
During a study, raw data can be overwhelming and almost always lead to confusing, scattered
outcomes. In such situations, Cross-tab analysis helps you arrive at a single theory by drawing
trends, comparisons, and correlations between two or more factors.
Benefits of Cross-Tabulation
Cross-tabulation is a fundamental tool in data analysis, particularly when working with
categorical variables. Understanding its benefits is key to effectively leveraging it in research.
Let’s dive into these advantages.
1. Data Simplification: It gives a clear snapshot of how variables relate, making it easier to
spot patterns without sifting through raw data.
2. Visualization: Cross-tabs quickly display relationships in a table, and when paired with
graphics, like bar graphs, the data becomes even clearer.
3. Testing Ideas: If you have a guess, like “more women prefer this product,” cross-tabs can
quickly confirm or refute it.
4. Spotting Errors: By showing unexpected data combinations, it’s easier to identify
mistakes. For instance, a 5-year-old shouldn’t have a full-time job in your data!
5. Targeting Audiences: Cross-tabs help identify specific customer behaviors for businesses,
making marketing more precise.
6. Informed Decisions: It offers a straightforward view of data relationships, aiding business
leaders in making decisions.
7. Prep for Advanced Analysis: Cross-tabs set the stage before deep dives, ensuring that
detailed analyses are based on solid ground.
8. Speed: Cross-tab results are fast, offering insights without a long wait
Data visualization using MS Excel
Format the cells as needed (e.g., adjust column width, apply bold formatting to headers, etc.).
Creating Basic Charts in Excel
Excel has multiple options for choosing a particular chart type. For example, if you want to
create a column or bar chart, you are often presented with various visualization options. For
example, there are 2D and 3D versions and normal, stacked, and 100% stacked options.
Depending on your requirements, you can choose the visualization type that best suits your
needs.
Excel bar charts
Bar charts are one of the easiest charts to interpret, enabling the person viewing the chart an easy
way to compare categorical data quickly. On a bar chart, the categorical data is on the y-axis, and
the values are on the x-axis.
To create a bar chart:
Select the data range A1:D13
Click the "Insert" tab in the Excel ribbon
Click on the columns icon button dropdown, and under the “2-D Bar” category, choose
“Clustered Bar”
Excel column charts
A column chart, also known as a vertical bar chart, helps visualize data where categories are
placed on the x-axis and the values on the y-axis. Similar to bar charts, they help visualize data
across categories.
To create a column chart in Excel:
Select the data range A1:D13
Click the "Insert" tab in the Excel ribbon
Click on the columns icon dropdown, and under the “2-D Column” category, choose
“Clustered Column”
You can now see a column chart that displays the number of units sold for each product category
by the month.
Excel line charts
A line chart is the most useful way to capture how a numerical variable changes over time. This
is helpful to identify trends in numeric values.
To create a line chart in Excel:
Select the data range A1:D13
Click the "Insert" tab in the Excel ribbon
Click on the line chart dropdown, and under the “2-D Line” category, choose “Line with
Markers"
You can now see a line chart displaying units sold each month split by product category. This
enables you to compare each product category's performance over time easily.
Excel pie charts
A pie chart is most commonly used to show the proportions of a whole. It’s like visualizing
fractions when you were in high school. With this pie chart, we want to compare the total sales
between the three categories.
To create a pie chart in Excel:
First, select the data range B1:D1
Second, using the command (for Mac) or ctrl (for Windows), select the second date
range: B14:D14
Click the "Insert" tab in the Excel ribbon
Click on the pie chart dropdown, and under the “2-D Pie” category, choose “Pie”
Advanced Excel Visualization Techniques
Excel scatter plots
A scatter plot is commonly used to visualize the relationship between two variables. It can be
useful for quickly surfacing potential correlations between data points. We’ll create a scatter plot
to compare the number of TVs and laptops sold.
To create a scatter plot in Excel:
Select the data range A1:C13
Click the "Insert" tab in the Excel ribbon
Click on the scatter plot dropdown, and under the “Scatter” category, choose
“Histogram”
Click "Scatter or Bubble Chart" and choose "Scatter with Smooth Lines and Markers"
Excel waterfall chart
A waterfall chart is a special chart that helps illustrate how positive and negative values can
contribute to a total. They can be great for visualizing changes over time. In our example, we’ll
compare the total sales for each month regardless of the categories.
To create a waterfall chart in Excel:
First, select the data range A2:A13
Second, using the command (for Mac) or ctrl (for Windows), select the second data range
E2:E13
Click on the waterfall chart dropdown, and under the “Waterfall” category, choose
“Waterfall”
We’ll only see positive values in our example because the Total column only contains positive
values, but this chart can be great for comparing financial data and changes over time.