(smooth jazz music)
- Hello, I am Professor Rick Jerz and I welcome you
to this session titled Graphing Techniques.
I really like this topic.
Its basic theme is that before doing any calculations
on business data, we should first look at the data
visually to see what it might be suggesting.
Sometimes we will use the word graph.
Sometimes figure.
And sometimes the modern word visualization.
Although we encounter many visualizations
of information in our lives, our focus in this session
will be on producing visualizations that
are most appropriate to business analytics.
We will learn how to collect data,
to organize it, and then how to create frequency diagrams,
relative frequency diagrams and histograms
for both qualitative and quantitative data.
In our next session, we will learn how to apply this theory
of graphing by creating visualizations using Excel.
Throughout this course, I will continue using this concept
of reinforcing numeric data with visualizations.
If you have any questions or need my help just let me know.
Let's get started.
Our goals are as follows.
To organize qualitative data into a frequency table
and present this as a bar or a pie chart.
To organize quantitative data into a frequency distribution.
To present quantitative data as histograms,
frequency polygons and cumulative frequency polygons.
And to explore some other chart types,
a combination chart such as a Pareto chart.
Let me begin this session with a very important point.
In statistics, we tend to deal with very
precise data and calculations.
Two plus three is five, and only five, right?
These graphical methods however
are not necessarily that precise.
In producing a chart, there is both a scientific element,
which is making sure that your data is correct and accurate,
and an artistic element, which is making sure
that the chart looks good and communicates
what you want it to communicate.
However, this does not mean that you
can do anything that you want.
There are some highly recommended guidelines
that we will follow in producing the correct chart
for the type of data that we have.
So it might seem a little odd to some of you
that we start this very precise topic of statistics
with a topic that is imprecise, namely charting.
Here are some of the chart types that we will learn about.
A bar chart, or frequency diagram, a pie chart,
a histogram, a frequency polygon, sometimes referred to
as a line chart, and a cumulative frequency polygon.
In our next session, we will learn how to create
these charts using Microsoft Excel.
The type of chart that we will use does depend upon
the type of data that we are working with.
Remember that there are only four types of data types:
nominal, ordinal, interval and ratio data.
These four types spell out the word
noir, as in Pinot Noir wine.
For nominal data we can use a bar chart or a pie chart.
For ordinal data, a bar chart is preferred.
For interval or ratio data, we can use a bar chart,
a histogram, frequency polygon or a cumulative frequency
polygon, sometimes called an ogive.
Also remember from chapter one that qualitative data
tended to be nominal or ordinal and quantitative data,
which would be discreet or continuous,
tended to be interval or ratio data.
So already we are using some of the terminology
that we learned in chapter one to help us determine
the best chart type to use to represent our data.
Our first step is to collect data.
Let's assume we're trying to answer the question
what type of soda pop was preferred
by children, oh, at a birthday party?
What I have done in this table is to list the pops
that were available and then to just simply tally
with tick marks how many cans of pop
were consumed by the children.
Our next step is to organize the data
into a frequency distribution.
A frequency distribution is a grouping of data
into mutually exclusive categories showing the number
of observations in each category.
A frequency distribution is good for both
qualitative and quantitative information.
The resulting summary is sometimes
referred to as a frequency table.
I am showing you a frequency table
for this pop distribution.
Notice that the second column is titled frequency,
or we could have titled this count.
Another thing to notice about this frequency table
is that we typically will show a total
at the bottom of the frequency table.
In this example, 50 cans of pop.
Now that we have our data organized,
we are ready to create a bar chart.
A bar chart is a graph with categories on the horizontal
axis, and frequency on the vertical axis.
Category frequencies are proportional
to the heights of the bar.
This bar chart allows us to very quickly see
which pop was preferred the most and the least.
This data is nominal data.
Remember, nominal data has no particular order.
When we produce a bar chart for this data,
it doesn't really matter which pop type is shown first.
Since our example data is nominal data,
we can also choose to represent this data with a pie chart.
A pie chart shows the proportion, or percent, that each
category represents of the total number of frequencies.
Pie charts are always round.
Since many of us have grown up eating pies,
some of the shapes are very easy to recognize.
In this example, we can quickly see once again
that Coke Classic is most preferred.
We can also see that Pepsi represents about
a fourth, or 25% of the pop consumed.
A pie chart allows us to quickly
note certain common proportions.
For example, a half of a pie, we would know what that is.
A fourth, maybe even a third.
This advantage; however, is limited.
If I were to ask you to cut me 1/19th of the pie
it might be a bit challenging.
Another advantage of the pie chart is that
it mimics the concept of probability.
We will learn more about probabilities in chapter five.
For now, let's just say that the complete pie
is always equal to 100% or a probability of one.
We can convert the count of each type of pop
by dividing by the total of 50 and then represent this
as a percent on a pie chart as shown here on the right.
When we convert from counted data to percentages,
what we're really doing is transforming
the data into relative data.
Relative to the total, what does each category represent?
The pie chart somewhat naturally does this.
When you see a wedge of the pie being half of the data,
you know that this is 50% of the pie.
We can create relative class frequencies for bar charts too.
Class frequencies can be converted to relative
class frequencies to show the fraction of the total
number of observations in each category.
A relative frequency captures the relationship
between a class total and the total number of observations.
In the table to the right, we have added one column
to show this relative frequency.
In this PowerPoint, I show the four types of charts
that we might create using nominal data.
On the top I show two pie charts.
One based upon count, and one on relative frequencies.
I do the same thing for these two bar charts.
The left one shows the counted data,
and the right one shows the relative frequencies.
What is important to note is that for either of these charts
it doesn't matter whether we use counted data or relative
data, the shapes of these charts remain the same.
Bar and pie charts can be used to represent ordinal data.
In this example, I am showing you
the children's opinion about Coke.
With ordinal data, the order of the bars
on the chart is important.
You might notice that both the bar chart
and the pie chart seem to represent this data well;
however, I really prefer a bar chart for ordinal data
because the bar chart allows us to show these categories
from low to high, or high to low.
Yes, a pie chart does show the data maybe just as well,
but where is the beginning of the data on the pie chart?
Is it at the 12 o'clock position?
The three o'clock?
Six o'clock?
In other words, where do you start showing these categories?
Where is the logical beginning of a pie chart?
We could say always start at 12 o'clock, but is that
what the user always interprets to be the beginning?
Well, some statisticians may not care about this, but
I still think that I prefer a bar chart for ordinal data.
Let's now turn out attention to
graphing interval and ratio data.
The plotting of discreet interval and ratio data
is nearly identical to plotting nominal and ordinal data.
The bar chart is preferred.
Here is an example of discreet ratio data.
A group of students who were studying statistics
were asked how many hours each week do they study?
This is ratio data because zero could be a valid entry.
I wouldn't prefer that of course, and there is a natural
strength between the categories.
Somebody who claims to study six hours
would be studying two times more than somebody
who claimed to study three hours, and three times more
somebody who claimed to study only two hours.
When you plot this data showing hours on the x axis,
you would naturally either show these
from low to high or high to low.
Also, no category, such as four, should be skipped.
Here is an example of continuous interval data.
The prices of vehicles sold last month.
If you look at this data, you might notice
that there are 80 prices represented in this table.
I can't tell if we have a price that occurs more than once.
This is a common problem with continuous data.
No repeating values.
What do we do about this?
Are we going to create a bar chart with 80 categories?
No way.
A frequency diagram looks best when it has between
five and 15 bars, that's a good rule of thumb.
But 80 is way too many.
So what we typically have to do with continuous interval
and ratio data is to group it.
Let me first explain to you how we will be constructing
frequency tables for interval and ratio data
and then I will illustrate this approach with our data.
In step one, we decide on the number of categories.
A useful rule to determine the number of categories, K,
is the two to the K rule, such that two to the K
is greater than N where N represents our number of data.
In step two, we determine the category interval, or width.
We can use a formula for this where I is greater than
or equal to H minus L divided by K where I is that
category interval, H is the highest observed value,
L is the lowest observed value, and K is the number
of categories that we calculated from step one.
We can use some of our best judgment in making sure
that this category interval seems appropriate.
In step three, we set the individual category limits.
Step four, construct a frequency table.
Once we have the frequency table,
we can then create our charts.
With our data, in step one there were
80 vehicles sold so N is equal to 80.
If we thought we wanted to use six categories,
or K equals six, two to the sixth is equal to 64,
which is still smaller than 80.
Remember, two to the sixth means two times two times two,
times two times two times two.
Two to the seventh is equal to 128,
which means that we would use seven categories
since 128 is greater than 80.
In step two we calculate the category width.
The highest value is 35,925 and from it
we subtract the lowest value, 15,546.
We divide this by seven, which is the number of categories
from step one, and we get a category width
of 2,911 dollars per category.
Now this 2,911, even though it's the exact calculation,
it's a figure that a lot of people would not relate to.
We tend to relate to tens or hundreds or something like that
so in this case we want to round this up
to some convenient number such as a multiple of 10 or 100.
Why don't we use the category width of 3,000 dollars?
That feels a lot better.
We could have used a category
width of 5,000, or maybe 2,000.
As your category width increases,
the number of categories decreases.
Also, when your category width decreases,
the number of categories increases.
There is no exact rule to follow.
This is where you, the creator of the chart,
must use your best judgment.
Moving on to step three, we want to set
the individual category limits.
We have to decide where to begin.
For the first category and the first value,
this number is typically equal to
or less than your lowest value.
It should be something that humans can relate to.
In our case, let's make it be 15,000 dollars.
With a category width of 3,000, we then know
that this first category should go from 15,000 up to 18,000.
The next category from 18,000 to 21,000 and so forth.
By using this approach, you might
observe an interesting problem.
How about if we have a value
equal to exactly 18,000 dollars?
In which category should this go?
The first or the second?
It is customary that the first category,
which is represented as 15,000 up to 18,000
is really 15,000 up to 17,999.
So if we did have a value of 18,000
it would go into the second category.
This is exactly what I do for grades.
In this example, a B plus category
is 87 to 93 and an A category is 93 to 100.
Well what happens if you get exactly 93 points?
Well, following the customary approach,
the B plus category is actually 87 up to 92.9999999.
So if you happen to get a 93, you end up
in the next highest category of the A,
which starts at 93 and runs up to 100 points.
Okay, in step four, now that we have our categories
we can construct a frequency table.
We tally up our data relative to these categories
and then create a frequency table.
We can also create a relative frequency distribution.
We do this by dividing each category frequency
by the total number of observations.
Our next step is to create the chart.
With interval and ratio data, we can choose between
creating a histogram or a frequency diagram.
Examples of each are shown on this PowerPoint.
If you look at the histogram, you might notice
that it does not have any gaps between the bars.
This is the more typical way to represent
interval or ratio data because most
of this data tends to be continuous.
If; however, your interval or ratio data
happened to be discreet data, for example,
the waist size on pants being oh I don't know,
28, 30, 32 inches, 34 inches and so forth, it would be okay
to use a frequency diagram with gaps showing.
So the histogram is actually a special form
of the bar chart, it does not contain gaps.
Remember, we will see how to do this in Microsoft Excel.
Another chart that we might construct
from our interval or ratio data is a frequency polygon.
Sometimes this is referred to as a line chart.
Instead of using bars where the height of the bar
represents the count, we use a single dot instead.
This dot is typically placed in the middle of the category.
So we have to worry about calculating
the midpoint of a category.
Frequency polygons are best used when you think
that there might be some kind of trend in the data.
The line often times gives us a better visual
representation of this up and down trend.
Whenever your categories happen to be time,
for example years or months, a frequency polygon
is actually preferred over a bar chart.
Another form of this line chart
is the cumulative frequency polygon.
This chart plots the accumulation of the count of something
from group to group, in this case the number of cars.
The last category, or point, on this cumulative
frequency polygon is for the total number of cars.
These five charts that I have just shown you
do represent the most common types of charts
for representing data, but I do want to share
with you a few other specialty charts.
This first one is called a combination chart.
Look at it and notice that it has both
a bar chart and a line chart all on the same chart.
If you look closely at this chart, you might notice
that the number of cars is represented
by the left vertical axis, and the percent of cars sold
is represented by the right vertical axis.
So we have two vertical axis on the same chart
and two different types of charts,
both a line and a bar chart.
This combination chart is one
of the tools used in quality control.
It is referred to as a Pareto chart.
It shows some form of quality problem, sorted from high
to low and the cumulative total is shown with a line.
In this example of a Pareto chart,
we're showing the late arrivals by reported cause.
The causes are traffic, childcare, public transportation,
weather, overslept and emergency.
A Pareto chart helps management decide
what to focus their attention on.
In this case, traffic problems.
Before we leave this topic, let me
point out some rules for charting.
Make sure to always consider keeping your charts simple.
Simple charts are easier to interpret than complex.
Avoid fancy 3D charts.
Sometimes these 3D charts actually
can distort the data instead of clarifying it.
Consider reproduction and avoid color
if the chart is likely to be reproduced
on a black and white printer or copier.
And the last rule is to be careful of the vertical scale.
It can affect visual interpretation.
Look at this chart.
It is exactly the same data that we saw
being presented earlier, except that it gives us
the visual illusion that very few
soft drinks are being purchased.
This visual illusion is created by using
a vertical scale that is inappropriate.
Notice, zero to 200.
Well, we are now done with this chapter
about describing data graphically.
I hope that you find that this material
is not all the difficult to understand.
Let's spend just a few more moments
on the concept of relative frequency charts,
and in particular, I'd like to share with you
the power behind these types of charts.
Let's revisit this data of soft drink purchases
represented as a relative frequency diagram.
Remember that a relative frequency diagram
shows the percentages for each category.
If we were a business, oh let's say a grocery store,
and we wanted to maximize our profits,
wouldn't this relative frequency diagram be important to us?
With this kind of chart, we can assess
that the probability of selling Classic Coke
is much higher than the probability of selling Dr. Pepper,
so we would probably want to stock more
Classic Coke in our store than Dr. Pepper.
Well, this is what we're going
to be studying this whole semester.
Basically, how to collect data and get it represented
as relative frequency data so that we can explore
what the probability of a certain event will be.
This probability can be represented
as the area under the curve.
For example, the area under the Coke curve is 37%.
This concept is very easy to see
on this relative frequency chart.
As we progress through this course,
you will see that different kinds of datas
produce different kinds of curves.
Some curves will be a little bit more complex than others.
And sometimes it will be easier to resort
to a numeric calculation of the probability
instead of this simple visual interpretation.
Especially when we want to be more accurate.
Well, I told you that this course would involve
probabilities and that it would be hard,
but at this point in time it really
doesn't seem all that hard, probability is the area
under a relative frequency curve of interest.
This simple chapter on charting forms the basis
of what we will be doing throughout the whole semester.
The specific techniques that we will use,
we will learn, will depend upon
the kind of data that we're collecting.
We will also learn that sometimes we can calculate
these probabilities even without producing a chart.
But this is what probability and statistics is all about.
Wow, maybe this course is going to be fun.
I am eager to share more knowledge with you.
Remember in our next session, I'm going to show
how to create these charts using Microsoft Excel.
(smooth jazz music)
Thanks for taking time to spend some moments with me.
I hope that you have enjoyed what I have shared with you.
If you ever have any questions
or need my help, please let me know.
(smooth jazz music)