Chapter 2-Organizing and Visualizing Variables
Chapter 2-Organizing and Visualizing Variables
Chapter 2
Objectives
In this chapter you learn:
⚫ How to organize and visualize categorical variables.
⚫ How to organize and visualize numerical variables.
⚫ How to summarize a mix of variables.
⚫ How to avoid making common errors when organizing
and visualizing variables.
Tallying Data
One Two
Categorical Categorical
Variable Variables
Summary Contingency
Table Table
Source: Data extracted and adapted from A. Sharma, “Big Media Needs to Embrace
Digital Shift Not Fight It,” Wall Street Journal, June 22, 2016, p. 1-2.
No
Errors Errors Total 50.75% = 170 / 335
Small 170 20 190 30.77% = 20 / 65
Amount
Medium 100 40 140
Amount No
Large 65 5 70 Errors Errors Total
Amount Small 50.75% 30.77% 47.50%
Total 335 65 400 Amount
Medium 29.85% 61.54% 35.00%
Amount
There is a 61.54% chance
Large 19.40% 7.69% 17.50%
that invoices with errors are Amount
of medium size. Total 100.0% 100.0% 100.0%
Numerical Data
▪ The number of classes depends on the number of values in the data. With
a larger number of values, typically there are more classes. In general, a
frequency distribution should have at least 5 but no more than 15 classes.
▪ To determine the width of a class interval, you divide the range (Highest
value–Lowest value) of the data by the number of class groupings desired.
Applied Statistics for Business
ĐẠI HỌC FPT CẦN THƠ
24, 35, 17, 21, 24, 37, 26, 46, 58, 30, 32, 13, 12, 38, 41, 43, 44, 27, 53, 27
Frequency Distributions:
Some Tips
⚫ Different class boundaries may provide different pictures for the
same data (especially for smaller data sets).
⚫ As the size of the data set increases, the impact of alterations in the
selection of class boundaries is greatly reduced.
Categorical Data
Visualizing Data
Summary Contingency
Table For One Table For Two
Variable Variables
Pie or
Doughnut Chart
Applied Statistics for Business
ĐẠI HỌC FPT CẦN THƠ
Devices Percent
Used to
Watch
Television Set 49%
Tablet 9%
Smartphone 10%
Laptop / 32%
Desktop
Devices Percent
Used to
Watch
Television Set 49%
Tablet 9%
Smartphone 10%
Laptop / 32%
Desktop
Devices Percent
Used to
Watch
Television Set 49%
Tablet 9%
Smartphone 10%
Laptop / 32%
Desktop
The “Vital
Few”
Applied Statistics for Business
ĐẠI HỌC FPT CẦN THƠ
No
Errors Errors Total
Invoice Size Split Out By Errors
Small 50.75% 30.77% 47.50% & No Errors
Amount
Medium 29.85% 61.54% 35.00% Errors
Amount
Large 19.40% 7.69% 17.50% No Errors
Amount
0.0% 10.0% 20.0% 30.0% 40.0% 50.0% 60.0% 70.0%
Total 100.0% 100.0% 100.0% Large Medium Small
No
Invoice Size & Errors
Errors Errors Total Inner Ring With Errors, Outer Ring No Errors
Amount 7.7%
30.8%
30.8%
29.9%
Large 19.40% 7.69% 17.50%
Amount
Small Medium Large
Numerical Data
Frequency Distributions
Ordered Array and
Cumulative Distributions
Stem-and-Leaf
Histogram Polygon Ogive
Display
Stem-and-Leaf Display
Frequency
4
(In a percentage
histogram the vertical
axis would be defined to 2
show the percentage of
observations per class).
0
5 15 25 35 45 55 More
Two Numerical
Variables
Scatter Time-
Plot Series
Plot
Number of
Year Franchises
2009 43 Number of Franchises, 1996-2004
2010 54
120
Number of Franchises
2011 60 100
80
2012 73
60
2013 82 40
20
2014 95 0
2008 2010 2012 2014 2016 2018
2015 107
Year
2016 99
2017 95
JMP Colored
Scatter Plot
Movie
revenues
by week
per month
⚫ Selective summarization:
– Presenting only part of the data collected.
⚫ Improperly constructed charts:
– Potential pie chart issues.
– Improperly scaled axes.
– A Y axis that does not begin at the origin or is a broken
axis missing intermediate values.
⚫ Chartjunk.
Change
from Prior
Company Year Company Year 1 Year 2 Year 3
A +7.2% A -22.6% -33.2% +7.2%
B +24.4% B -4.5% -41.9% +24.4%
C +24.9% C -18.5% -31.5% +24.9%
D +24.8% D -29.4% -48.1% +24.8%
E +12.5% E -1.9% -25.3% +12.5%
F +35.1% F -1.6% -37.8% +35.1%
G +29.7% G +7.4% -13.6% +29.7%
Applied Statistics for Business
ĐẠI HỌC FPT CẦN THƠ
Graphical Errors:
No Relative Basis
200 20%
100 10%
0 0%
FR SO JR SR FR SO JR SR
Graphical Errors:
Compressing the Vertical Axis
100 25
0 0
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
Bad Presentation
✓ Good Presentations
Left illustration adapted from S. Watterson, “Liquid Gold—Australians Are Changing the World of Wine. Even the French Seem Grateful.” Time,
November 22, 1999, p. 68-69
Chapter Summary
In this chapter we covered:
⚫ Organizing and visualizing categorical variables.
⚫ Organizing and visualizing numerical variables.
⚫ Summarizing a mix of variables.
⚫ Avoiding common errors when organizing and
visualizing variables.