Equency Tables and Diagrams
Equency Tables and Diagrams
1
Frequency Diagrams
Frequency Table & Histogram
2
Frequency Table
A frequency table is a table of counts. It shows the number of times
(frequency) each category occurs.
• When creating a frequency table for a
categorical variable, the counts for
each class of data is displayed.
3
Frequency Table
A frequency table is a table of counts. It shows the number of times
(frequency) each category occurs.
• When creating a frequency table for a
numerical variable, the variable is
usually binned (grouped) into
categories.
7
Frequency Table
• Relative frequency of a category is the fraction, or percentage, of
the data values that fall in that category.
• Cumulative frequency of a category is the number of data values in
that category and all preceding categories.
• Cumulative % of a category is the percentage of data values in that
category and all preceding categories.
Class Frequency Relative Cumulative Cumulative
Frequency Frequency %
Green 5 18% 5 18%
Red 9 32% 14 50%
Blue 11 39% 25 89%
Yellow 3 11% 28 100%
8
Exercise - FreqTab
• File: FrequencyTable
• Fill the Relative Frequency, Cumulative Frequency and Cumulative
% columns with appropriate formulas/functions.
10
Answer - FreqTab
11
Frequency Diagrams
• A frequency diagram is a graphical display of how often data values
occur.
• Histogram is one of the most common frequency diagrams.
12
Histogram
Histogram shows the distribution of a numerical variable.
13
Histogram
Histogram shows the distribution of a numerical variable.
• There should not be any gaps between
categories. (not like ‘2, 3, 4, 7, 9’, but like
‘2, 3, 4, 5, 6, 7, 8, 9’)
14
Histogram
Histogram shows the distribution of a numerical variable.
• There should not be any gaps between
categories. (not like ‘2, 3, 4, 7, 9’, but like ‘2,
3, 4, 5, 6, 7, 8, 9’)
• Data must be in the natural order, even when
binning. (not like ‘7, 3, 6, 4, 5’, but like ‘3, 4,
5, 6, 7’. No binning like ({7, 3, 1}; {6, 5, 4} ;
{2, 8, 9}), but like ({1, 2, 3}; {4, 5, 6}; {7, 8, 9}))
15
Histogram
Histogram shows the distribution of a numerical variable.
• There should not be any gaps between
categories. (not like ‘2, 3, 4, 7, 9’, but like
‘2, 3, 4, 5, 6, 7, 8, 9’)
• Data must be in the natural order, even
when binning. (not like ‘7, 3, 6, 4, 5’, but
like ‘3, 4, 5, 6, 7’. No binning like ({7, 3, 1};
{6, 5,4} ; {2, 8, 9}), but like ({1, 2, 3}; {4, 5,
6}; {7, 8, 9}))
• Does not show the data in time order.
16
Histogram
Histogram shows the distribution of a numerical variable.
• There should not be any gaps between
categories. (not like ‘2, 3, 4, 7, 9’, but like
‘2, 3, 4, 5, 6, 7, 8, 9’)
• Data must be in the natural order, even
when binning. (not like ‘7, 3, 6, 4, 5’, but
like ‘3, 4, 5, 6, 7’. No binning like ({7, 3, 1};
{6, 5,4} ; {2, 8, 9}), but like ({1, 2, 3}; {4, 5,
6}; {7, 8, 9}))
• Does not show the data in time order.
• It provides a picture of the shape, spread
(variability) and central tendency of the
data.
17
How to Create Histogram
• In order to create a histogram, data range is • Ex: In the histogram shown below, there
divided into intervals (bins) of equal width are 26 data points with the value ‘1’
(bins should be of equal width for easier (therefore Bin ‘1’ shows 26), etc.
interpretation and there should not be any
gaps).
• The number of bins depend on the number of
observations and the variability of the data
(usually between 5 and 20, but increases as the
number of observations increases).
• Suggested number of bins= 𝑛
18
How to Create Histogram
The file Histogram_grades.xlsx shows the grades of 100 students.
If you want to manually create a histogram of the grades, you create bins
and then you mark each grade in the corresponding bin as shown.
X
X X X
X X X X
X X X X X
X X X X X X X X
X X X X X X X X
X X X X X X X X X
X X X X X X X X X X
X X X X X X X X X X
X X X X X X X X X X
X X X X X X X X X X
X X X X X X X X X X
X X X X X X X X X X X
0-9 10-19 20-29 30-39 40-49 50-59 60-69 70-79 80-89 90-99 100 19
Exercise – Grades.A
bin range 0
0<bin range 10
10<bin range 20
20<bin range 30
…
21
As an exercise, sort the student grades and compare the frequencies with the histogram output.
Exercise – Grades.B
Draw another histogram of the grades next to the histogram you have
already drawn in Part A using Insert > Statistic Chart
• Bin width = 10
• Compare your histograms.
Answer – Grades.B
Frequency Diagrams in Real Life
Look for the popular times of a
restaurant on the web.
• How would the frequency diagram
help you to plan your visit?
24
Frequency Diagrams in Real Life
25
Exercise - SalaryLifetime
Match the following data with the appropriate histogram:
I. Salary (salaries of most employees are small, a few earn a lot)
II. Lifetime of light bulbs (a few fail very early, most fail late)
A B
30
Lifetime of light bulbs (a few fail very early, most fail late)
31