Chapter Two
Data visualization
2.1
Type of Data
- Interval data
- Ordinal data
- Nominal data
Copyright © 2009 Cengage Learning 2.2
Interval Data…
• Real numbers, i.e. heights, weights, prices, etc.
• Also referred to as quantitative or numerical.
Arithmetic operations can be performed on Interval Data,
Copyright © 2009 Cengage Learning 2.3
Nominal Data…
• The values of nominal data are categories.
E.g. responses to questions about marital status, coded
as:
Single = 1, Married = 2, Divorced = 3, Widowed = 4
Arithmetic operations don’t make any sense (e.g. does
Widowed ÷ 2 = Married?!)
Nominal data are also called qualitative or categorical.
Copyright © 2009 Cengage Learning 2.4
Ordinal Data…
Ordinal Data appear to be categorical in nature, but their
values have an order; a ranking to them:
E.g. College course rating system:
poor = 1, fair = 2, good = 3, very good = 4, excellent = 5
Still not meaningful to do arithmetic on this data
We can say:
excellent > poor or fair < very good
Order is maintained no matter what numeric values are
assigned to each category.
Copyright © 2009 Cengage Learning 2.5
Hierarchy of Data…
Interval
Values are real numbers.
All calculations are valid.
Data may be treated as ordinal or nominal.
Ordinal
Values must represent the ranked order of the data.
Data may be treated as nominal but not as interval.
Nominal
Values are the arbitrary numbers that represent categories.
Data may not be treated as ordinal or interval.
Copyright © 2009 Cengage Learning 2.6
Data-ink ratio
Data-ink ratio: Measures the proportion “data-ink” to the
total amount of ink used in a table or chart
– Edward R. Tufte first described the data-ink ratio
– Helpful for creating effective tables and charts for data
visualization
• Data-ink: Ink used in a table or chart that is necessary to convey the
meaning of the data to the audience
• Non-data-ink: Ink used in a table or chart that serves no useful purpose in
conveying the data to the audience
Copyright © 2009 Cengage Learning 7
Table: Example of a Low Data-Ink Ratio Table
Figure: Example of a Low Data-Ink Ratio Chart
Copyright © 2009 Cengage Learning 8
Table: Increasing the Data-Ink Ratio by Removing Unnecessary
Gridlines
Figure: Increasing the Data-Ink Ratio by Adding Labels to Axes and
Removing Unnecessary Lines and Labels
Copyright © 2009 Cengage Learning 9
SUMMARIZING UNIVARIATE DATA
Copyright © 2009 Cengage Learning 2.10
Graphical & Tabular Techniques for Nominal Data…
The only allowable calculation on nominal data is to count
the frequency of each value of the variable.
We can summarize the data in a table that presents the
categories and their counts called a frequency distribution.
A relative frequency distribution lists the categories and the
proportion with which each occurs.
Copyright © 2009 Cengage Learning 2.11
Light Beer Brand Frequency Relative Frequency
Budweiser Light 90 31.6%
Busch Light 19 6.7
Coors Light 62 21.8
Michelob Light 13 4.6
Miller Lite 59 20.7
Natural Light 25 8.8
Other brands 17 6.0
Copyright © 2009 Cengage Learning 2.12
Nominal Data (Frequency)
Light Beer Brand Frequency Relative Frequency
100 Budweiser Light 90 31.6%
90
90 Busch Light 19 6.7
Coors Light 62 21.8
80
Michelob Light 13 4.6
70 62
59 Miller Lite 59 20.7
60
Natural Light 25 8.8
50
Other brands 17 6.0
40 285
30 25
19 17
20 13
10
0
1 2 3 4 5 6 7
Bar Charts show frequencies…
Copyright © 2009 Cengage Learning 2.13
Nominal Data (Relative Frequency)
7
6%
6
9%
1
31%
5
21%
2
7%
4
4%
3
22%
Pie Charts show relative frequencies…
Copyright © 2009 Cengage Learning 2.14
Nominal Data
Light Beer Brand Frequency Relative Frequency
Budweiser Light 90 31.6%
Busch Light 19 6.7
It all the same information,
Coors Light
Michelob Light
62
13
21.8
4.6
(based on the same data).
Miller Lite 59 20.7
Just different presentation.
Natural Light 25 8.8
Other brands 17 6.0
100
90
90
80
7
6% 70 62
6 59
60
9%
1
50
31%
40
30 25
5 19 17
20 13
21%
10
0
2
1 2 3 4 5 6 7
7%
4
4%
3
22%
Copyright © 2009 Cengage Learning 2.15
Ordinal Data
Same as the nominal data but
• the bars in the bar chart are arranged in ascending or
descending order.
• The wedges in the pie chart are arranged clockwise in
ascending or descending order.
Copyright © 2009 Cengage Learning 2.16
Graphical Techniques for Interval Data
There are several graphical methods that are used when the
data are interval.
The most important of these graphical methods is the
histogram.
Copyright © 2009 Cengage Learning 2.17
Example
For nominal data we created a frequency distribution of the
categories.
For interval data, we create a frequency distribution by
counting the number of observations that fall into a series of
intervals, called classes.
Copyright © 2009 Cengage Learning 2.18
Example – phone bills
Histogram
File: Phone
80
bill
70
60
Frequency
50
40
30
20
10
0
15 30 45 60 75 90 105 120
Bills
Copyright © 2009 Cengage Learning 2.19
Building a Histogram…
a) Determine the number of classes
With 200 observations,
we should have
between 7 & 10
classes…
Alternative, we could use Sturges’ formula:
Number of class intervals = 1 + 3.3 log (n)
Copyright © 2009 Cengage Learning 2.20
Building a Histogram…
a) Determine the number of classes to use. [8]
b) Determine how large to make each class…
Look at the range of the data, that is,
Range = Largest Observation – Smallest Observation
Range = $119.63 – $0 = $119.63
Then each class width becomes:
Range ÷ (# classes) = 119.63 ÷ 8 ≈ 15
Copyright © 2009 Cengage Learning 2.21
Building a Histogram…
Copyright © 2009 Cengage Learning 2.22
Building a Histogram…
In Excel, use Data, Data Analysis, Histogram
Inputs: Input Range, Bin Range
Copyright © 2009 Cengage Learning 2.23
Stem & Leaf Display…
• Retains information about individual observations that
would normally be lost in the creation of a histogram.
• Split each observation into two parts, a stem and a leaf:
• e.g. Observation value: 42.19
• There are several ways to split it up…
Stem Leaf
42 19
• We could split it at the decimal point:
4 2
• Or split it at the “tens” position (while rounding to the
nearest integer in the “ones” position)
Copyright © 2009 Cengage Learning 2.24
Stem & Leaf Display…
• Use the “stems” for the classes
• Each leaf becomes part of the histogram
Stem Leaf
0 0000000000111112222223333345555556666666778888999999
1 000001111233333334455555667889999
2 0000111112344666778999
3 001335589
4 124445589
5 33566
6 3458
7 022224556789
8 334457889999 Thus, we still have access to our
9 00112222233344555999 original data point’s value!
10 001344446699
11 124557889
Copyright © 2009 Cengage Learning 2.25
Histogram and Stem & Leaf…
Compare the overall shapes of the figures…
Copyright © 2009 Cengage Learning 2.26
Ogive…
• (pronounced “Oh-jive”)
• a graph of a cumulative frequency distribution.
Copyright © 2009 Cengage Learning 2.27
Relative Frequencies…
Copyright © 2009 Cengage Learning 2.28
Cumulative Relative Frequencies…
Cumulative relative frequencies =
the current class’ relative frequency
+ the previous class’ cumulative relative frequency.
first class…
next class: .355+.185=.540
:
:
last class: .930+.070=1.00
Copyright © 2009 Cengage Learning 2.29
Ogive…
Graph the cumulative relative frequencies…
Copyright © 2009 Cengage Learning 2.30
Ogive…
The ogive can be used to
answer questions like:
What value is at the 50th
percentile?
“around $35”
(Refer also to Fig. 2.13 in your textbook)
Copyright © 2009 Cengage Learning 2.31
Describing Time Series Data
Observations measured at successive points in time are
called time-series data.
Line chart plots the value of the variable on the vertical axis
against time periods on the horizontal axis.
Copyright © 2009 Cengage Learning 2.32
the monthly average retail price of gasoline
3.5
2.5
1.5
0.5
0
1 25 49 73 97 121 145 169 193 217 241 265 289 313 337
Copyright © 2009 Cengage Learning 2.33
Price of Gasoline in 1982-84 Constant Dollars
1.800
1.600
1.400
1.200
1.000
0.800
0.600
0.400
0.200
0.000
1 25 49 73 97 121 145 169 193 217 241 265 289 313 337
Copyright © 2009 Cengage Learning 2.34
Part B
SUMMARIZING BIVARIATE DATA
nominal and ordinal data
❖ Cross – tabulation y
❖ Scatter Diagram
interval data
x
Crosstabulations and Scatter
Diagrams
◼ So far we have focused on methods that are used
to summarize the data for one variable at a time.
◼ Often a manager is interested in tabular and
graphical methods that will help understand the
relationship between two variables.
◼ Cross-tabulation and a scatter diagram are two
methods for summarizing the data for two (or more)
variables simultaneously.
Copyright © 2009 Cengage Learning
Crosstabulation
◼ A crosstabulation is a tabular summary of data for
two variables.
◼ The left and top margin labels define the classes for
the two variables.
Copyright © 2009 Cengage Learning
Crosstabulation
Example: Finger Lakes Homes
The number of Finger Lakes homes sold for each style
and price for the past two years is shown below.
ordinal
nominal
Price Home Style
Range Colonial Log Split A-Frame Total
< $99,000 18 6 19 12 55
> $99,000 12 14 16 3 45
Total 30 20 35 15 100
Copyright © 2009 Cengage Learning
Crosstabulation
• Insights Gained from Preceding Crosstabulation
• The greatest number of homes in the sample (19)
are a split-level style and priced at less than or
equal to $99,000.
• Only three homes in the sample are an A-Frame
style and priced at more than $99,000.
Copyright © 2009 Cengage Learning
Crosstabulation
Frequency distribution
for the price variable
Price Home Style
Range Colonial Log Split A-Frame Total
< $99,000 18 6 19 12 55
> $99,000 12 14 16 3 45
Total 30 20 35 15 100
Frequency distribution
for the home style variable
Copyright © 2009 Cengage Learning
Cross-tabulation: Row or Column Percentages
• Converting the entries in the table into row
percentages or column percentages can provide
additional insight about the relationship between
the two variables.
Copyright © 2009 Cengage Learning
Crosstabulation: Row Percentages
Price Home Style
Range Colonial Log Split A-Frame Total
< $99,000 32.73 10.91 34.55 21.82 100
> $99,000 26.67 31.11 35.56 6.67 100
Note: row totals are actually 100.01 due to rounding.
(Colonial and > $99K)/(All >$99K) x 100 = (12/45) x 100
Copyright © 2009 Cengage Learning
Crosstabulation: Column Percentages
Price Home Style
Range Colonial Log Split A-Frame
< $99,000 60.00 30.00 54.29 80.00
> $99,000 40.00 70.00 45.71 20.00
Total 100 100 100 100
(Colonial and > $99K)/(All Colonial) x 100 = (12/30) x 100
Copyright © 2009 Cengage Learning
Scatter Diagram and Trendline
◼ A scatter diagram is a graphical presentation of the
relationship between two quantitative variables.
◼ One variable is shown on the horizontal axis and the
other variable is shown on the vertical axis.
◼ The general pattern of the plotted points suggests the
overall relationship between the variables.
◼ A trendline is an approximation of the relationship.
Copyright © 2009 Cengage Learning
Scatter Diagram
• A Positive Relationship
y
Copyright © 2009 Cengage Learning
Scatter Diagram
• A Negative Relationship
y
Copyright © 2009 Cengage Learning
Scatter Diagram
• No Apparent Relationship
y
Copyright © 2009 Cengage Learning
BUILD CHARTS AND TABLES IN EXCEL
Copyright © 2009 Cengage Learning 2.48
Tables
Table Design Principles
– Avoid using vertical lines in a table unless they are
necessary for clarity
– Horizontal lines are generally necessary only for
separating column titles from data values or when
indicating that a calculation has taken place
Copyright © 2009 Cengage Learning 49
Figure 3.7: Comparing Different Table Designs
Copyright © 2009 Cengage Learning 50
Table: Larger Table Showing Revenues by Location for
12 Months of Data
Copyright © 2009 Cengage Learning 51
Crosstabulation and PivotTable
• Crosstabulation: A useful type of table for describing
data of two variables
• PivotTable: A crosstabulation in Microsoft Excel
Copyright © 2009 Cengage Learning 52
Table 3.6: Quality Rating and Meal
Price for 300 Los Angeles Restaurants
Copyright © 2009 Cengage Learning 53
Table: Crosstabulation of Quality Rating and Meal
Price for 300 Los Angeles Restaurants
• The greatest number of restaurants in the sample (64) have a
very good rating and a meal price in the $20–29 range
• Only two restaurants have an excellent rating and a meal
price in the $10–19 range
• The right and bottom margins of the crosstabulation give the
frequency of quality rating and meal price separately
Copyright © 2009 Cengage Learning 54
Excel Worksheet Containing Restaurant Data
Copyright © 2009 Cengage Learning 55
Initial PivotTable Field List and PivotTable Field Report
for the Restaurant Data
Copyright © 2009 Cengage Learning 56
Completed PivotTable Field List and A Portion of the PivotTable
Report for the Restaurant Data
Copyright © 2009 Cengage Learning 57
Final PivotTable Report for the Restaurant
Data
Copyright © 2009 Cengage Learning 58
Percent Frequency Distribution as a
PivotTable for the Restaurant Data
Copyright © 2009 Cengage Learning 59
PivotTable Report for the Restaurant
Data with Average Wait Times Added
Copyright © 2009 Cengage Learning 60
CHARTS
Scatter Charts Bubble Charts
Recommended Charts in Excel Heat Maps
Line Charts PivotCharts in Excel
Bar Charts and Column Charts
A Note on Pie Charts and Three
Dimensional Charts
Copyright © 2009 Cengage Learning
Charts
• Charts (or graphs): Visual methods of displaying data
• Scatter chart: Graphical presentation of the relationship
between two quantitative variables
• Trend line: A line that provides an approximation of the
relationship between the variables
• Line chart: A line connects the points in the chart
– Useful for time series data collected over a period of time
(minutes, hours, days, years, etc.)
Copyright © 2009 Cengage Learning 62
Sample Data for the San Francisco
Electronics Store
Copyright © 2009 Cengage Learning 63
Scatter Chart for the San Francisco
Electronics Store
Copyright © 2009 Cengage Learning 64
Monthly Sales Data of Air
Compressors at Kirkland Industries
Copyright © 2009 Cengage Learning 65
Scatter Chart and Line Chart for Monthly
Sales Data at Kirkland Industries
Copyright © 2009 Cengage Learning 66
Regional Sales Data by Month for Air
Compressors at Kirkland Industries
Copyright © 2009 Cengage Learning 67
Line Chart of Regional Sales Data at
Kirkland Industries
Copyright © 2009 Cengage Learning 68
Charts
Sparkline: Special type of line chart
– Minimalist type of line chart that can be placed
directly into a cell in Excel
– Contain no axes; they display only the line for the data
– Take up very little space and they can be effectively
used to provide information on overall trends for time
series data
Copyright © 2009 Cengage Learning 69
Sparklines for the Regional Sales Data at
Kirkland Industries
Copyright © 2009 Cengage Learning 70
Charts
• Bar Charts: Use horizontal bars to display the magnitude
of the quantitative variable
• Column Charts: Use vertical bars to display the
magnitude of the quantitative variable
• Bar and column charts are very helpful in making
comparisons between categorical variables
Copyright © 2009 Cengage Learning 71
Bar Charts for Accounts Managed
Data
Gentry manages
the greatest
number of
accounts and
Williams the fewest
Copyright © 2009 Cengage Learning 72
Sorted Bar Chart for Accounts
Managed Data
Copyright © 2009 Cengage Learning 73
Bar Chart with Data Labels for
Accounts Managed Data
Copyright © 2009 Cengage Learning 74
Charts
• Pie charts: Common form of chart used to compare
categorical data
• Bubble chart:
– Graphical means of visualizing three variables in a two-
dimensional graph
– Sometimes a preferred alternative to a 3-D graph
• Heat map: A two-dimensional graphical representation of
data that uses different shades of color to indicate
magnitude
Copyright © 2009 Cengage Learning 75
Pie Chart of Accounts Managed
Copyright © 2009 Cengage Learning 76
Sample Data on Billionaires per
Country
Copyright © 2009 Cengage Learning 77
Bubble Chart Comparing
Billionaires by Country
Copyright © 2009 Cengage Learning 78
Bubble Chart Comparing
Billionaires by Country
Copyright © 2009 Cengage Learning 79
Heat Map and Sparklines for Same-
Store Sales Data
Copyright © 2009 Cengage Learning 80
Charts
Additional Charts for Multiple Variables
– Stacked column chart: Allows the reader to compare
the relative values of quantitative variables for the
same category in a bar chart
– Clustered column (or bar) chart: An alternative
chart to stacked column chart for comparing
quantitative variables
Copyright © 2009 Cengage Learning 81
Stacked-Column Chart for Regional
Sales Data for Kirkland Industries
Copyright © 2009 Cengage Learning 82
Charts
PivotCharts in Excel
PivotChart: To summarize and analyze data with both a
crosstabulation and charting, Excel pairs PivotCharts with
PivotTables
Copyright © 2009 Cengage Learning 83
Figure 3.32: PivotTable and
PivotChart for the Restaurant Data
Copyright © 2009 Cengage Learning 84