PPTC2 Organizing and Visualizing Variables
PPTC2 Organizing and Visualizing Variables
Organizing and
Visualizing Variables
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.
Organizing Data Creates Both
Tabular And Visual Summaries
DCOVA
◼ Summaries both guide further exploration and
sometimes facilitate decision making.
Tallying Data
One Two
Categorical Categorical
Variable Variables
Summary Contingency
Table Table
Organizing Categorical Data:
Summary Table DCOVA
▪ A summary table tallies the frequencies or percentages of items in a set
of categories so that you can see differences between categories.
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.
A Contingency Table Helps Organize
Two or More Categorical Variables
DCOVA
◼ Used to study patterns that may exist between
the responses of two or more categorical
variables.
▪ 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.
Organizing Numerical Data:
Frequency Distribution Example
DCOVA
24, 35, 17, 21, 24, 37, 26, 46, 58, 30, 32, 13, 12, 38, 41, 43, 44, 27, 53, 27
Organizing Numerical Data:
Frequency Distribution Example
DCOVA
▪ Sort raw data in ascending order:
12, 13, 17, 21, 24, 24, 26, 27, 27, 30, 32, 35, 37, 38, 41, 43, 44, 46, 53, 58.
▪ Find range: 58 - 12 = 46.
▪ Select number of classes: 5 (usually between 5 and 15).
▪ Compute class interval (width): 10 (46/5 then round up).
▪ Determine class boundaries (limits):
▪ Class 1: 10 but less than 20.
▪ Class 2: 20 but less than 30.
▪ Class 3: 30 but less than 40.
▪ Class 4: 40 but less than 50.
▪ Class 5: 50 but less than 60.
▪ Compute class midpoints: 15, 25, 35, 45, 55.
▪ Count observations & assign to classes.
Organizing Numerical Data: Frequency
Distribution Example
DCOVA
Data in ordered array:
12, 13, 17, 21, 24, 24, 26, 27, 27, 30, 32, 35, 37, 38, 41, 43, 44, 46, 53, 58
Summary Contingency
Table For One Table For Two
Variable Variables
Pie or
Doughnut Chart
Visualizing Categorical Data:
The Bar Chart
DCOVA
▪ The bar chart visualizes a categorical variable as a series of bars. The
length of each bar represents either the frequency or percentage of
values for each category. Each bar is separated by a space called a gap.
Devices Percent
Used to
Watch
Television Set 49%
Tablet 9%
Smartphone 10%
Laptop / 32%
Desktop
Visualizing Categorical Data:
The Pie Chart
DCOVA
▪ The pie chart is a circle broken up into slices that represent categories.
The size of each slice of the pie varies according to the percentage in
each category.
Devices Percent
Used to
Watch
Television Set 49%
Tablet 9%
Smartphone 10%
Laptop / 32%
Desktop
Visualizing Categorical Data:
The Doughnut Chart DCOVA
▪ The doughnut chart is the outer part of a circle broken up into pieces
that represent categories. The size of each piece of the doughnut varies
according to the percentage in each category.
Devices Percent
Used to
Watch
Television Set 49%
Tablet 9%
Smartphone 10%
Laptop / 32%
Desktop
Visualizing Categorical Data:
The Pareto Chart
DCOVA
◼ Used to portray categorical data (nominal
scale).
◼ A vertical bar chart, where categories are
shown in descending order of frequency.
◼ A cumulative polygon is shown in the same
graph.
◼ Used to separate the “vital few” from the “trivial
many.”
Visualizing Categorical Data:
The Pareto Chart (con’t) DCOVA
Ordered Summary Table For Causes
Of Incomplete ATM Transactions
Cumulative
Cause Frequency Percent Percent
Warped card jammed 365 50.41% 50.41%
Card unreadable 234 32.32% 82.73%
ATM malfunctions 32 4.42% 87.15%
ATM out of cash 28 3.87% 91.02%
Invalid amount requested 23 3.18% 94.20%
Wrong keystroke 23 3.18% 97.38%
Lack of funds in account 19 2.62% 100.00%
Total 724 100.00%
Source: Data extracted from A. Bhalla, “Don’t Misuse the Pareto Principle,” Six Sigma Forum
Magazine, May 2009, pp. 15–18.
Visualizing Categorical Data:
The Pareto Chart (con’t) DCOVA
The “Vital
Few”
Visualizing Categorical Data:
Side By Side Bar Charts DCOVA
▪ The side by side bar chart represents the data from a contingency table.
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%
Frequency Distributions
Ordered Array and
Cumulative Distributions
Stem-and-Leaf
Histogram Polygon Ogive
Display
Stem-and-Leaf Display
DCOVA
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
Visualizing Numerical Data:
The Percentage Polygon
DCOVA
Two Numerical
Variables
Scatter Time-
Plot Series
Plot
Visualizing Two Numerical
Variables: The Scatter Plot
DCOVA
▪ Scatter plots are used for numerical data consisting of paired
observations taken from two numerical variables.
29 146
150
33 160
100
38 167
50
42 170
0
50 188
20 30 40 50 60 70
55 195
Volume per Day
60 200
Visualizing Two Numerical
Variables: The Time Series Plot
DCOVA
◼ A Time-Series Plot is used to study
patterns in the values of a numeric
variable over time.
JMP Colored
Scatter Plot
False Impressions Can Be
Created In Many Ways DCOVA
◼ Selective summarization:
◼ Presenting only part of the data collected.
◼ Chartjunk.
How Obvious Is It That Both Pie Charts
Summarize The Same Data? DCOVA
100 10%
0 0%
FR SO JR SR FR SO JR SR
100 25
0 0
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
Graphical Errors: No Zero Point
on the Vertical Axis
DCOVA
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
Best Practices for Constructing
Visualizations DCOVA