One of the most common things we want to do with the data set is to get a measure of its center.
And there are many ways to think about this idea of center, the first of which is the idea of mean.
And this is the most common measure of center that we use.
We usually think about mean as average.
But when we're being a little more technical, we call it the mean or the arithmetic mean.
And this here is the formula that we use to calculate mean.
But really all this formula says is that we are to add up all of the data points in our data set, all
the values in our data set, and then divide by the number of data points or the number of values that
we have in the data set.
So the way that we read this formula here is to say that this sigma notation here, this big E is called
sigma.
It means to sum up.
And so we are adding up here all of the values of X and we use this little indicator I here to mean
the first value of x, second value of x, third value of x, etc. So this I equals one notation below.
The sigma notation means start with the first value and keep adding until you get to the nth value.
So if there are ten values in the data set, this says start with the first value in the data set,
the I equals one value and add that to the second value, the third value, the fourth value, etc.
All the way up to the end equals 10th value.
We're adding all the values together in the data set and then dividing by N equals ten the number of
data points in the set.
So this is just a fancy formula.
To summarize what we're doing here, sum all the data points, divide by the number of data points in
the set.
So for instance, if we have a data set like this one, a very simple data set, we can see we have
five points in the set one, two, four, six and seven.
There are five values in this data set to use our formula here to find the mean.
We would simply add all of these values together and then divide by five because there are five values
in the data set.
The result then, of course, the sum of all of the values in the numerator is 20, 20 divided by five
is four.
And so we can say here that the mean is 20 divided by five, which is equal to four.
Now, the way that we indicate mean depends on what we're talking about.
We mentioned earlier the idea of population versus sample.
Well, if we're taking the mean of the population, let's say that this data set here accounts for the
entire population, then we usually use the Greek letter MU, which looks like this U here.
And we say that the mean is given by MU and so we would say mu is equal to for the mean of the population
is equal to four.
If on the other hand we're taking the mean of a sample, we usually indicate that with this notation,
which we read as x bar, it's just x with a bar over the top of it.
And so if you see x bar, it usually means the mean of a sample of the population.
Whereas this notation here mu usually means the mean of the entire population.
The formula is the same in both cases, right?
This could be x bar or it could be mu.
We would still use this same formula to sum all the data points and divide by the number of data points.
But we would use x bar to indicate that value.
If we are finding the mean of the sample we use.
Mu.
If we are finding the mean of the population, we really want to think about the mean either way, whether
it's the mean of the sample or the mean of a population we really want to think about.
The mean is the balancing point of the data.
And we also want to realize that there are some different things we can do with mean that are interesting,
including for instance, take a weighted mean.
So let's say we work at a company and we've asked every department manager to survey all of the employees
in their department and get from them an employee satisfaction score.
On a scale of 1 to 10, ten being perfectly satisfied, one being extremely unsatisfied.
So with this first data point here, we have a department that includes 20 employees and the department
manager.
The department head has reported to us that the mean employee satisfaction score in their department
is 8.4.
Another department manager has told us that of their seven employees, the mean employee satisfaction
score is 6.1 in that department.
So what you see here is that we have all different department sizes across our company and we're getting
a different employee satisfaction score from each department head, each department head.
Each department manager has already taken a mean for their own department.
When we have a situation like this, we have to take a weighted mean if we want to get a mean employee
satisfaction score for the entire company.
Because obviously here we can get kind of an intuitive sense that this 8.4 value for satisfaction counts
a little heavier or should count a little heavier than this employee satisfaction score here of 6.1,
because there are 20 employees in this department, only seven employees in this department.
So intuitively, we should wait this 8.4 a little heavier than we weight this 6.1.
So how do we do that?
Well, the formula is virtually the same as what we did up here, except that we're accounting for this
different weighting.
So what we do is we sum up all of the products of the actual score and the weighting, and then we divide
that by the sum of all of the weights.
So if we do that with this data set here, here's what that looks like.
We take the product of 20 and 8.4, we add that to the product of seven and 6.1.
Then we add to that 13 times 9.1 plus 25 times 7.8.
So we're taking all these products in the numerator, adding them together, and then we're dividing
by the total weight.
This denominator should make intuitive sense to us because if we go back to our original formula for
the mean, we're dividing by the number of data points down here, we know that if we add up all of
these department sizes, we get 20 plus seven, plus 13 is 40, plus 25 is 65.
We have 65 total employees across four departments.
So this denominator here is really just like the denominator up here.
We have 65 total employees, so we kind of have this same idea of total number of data points in the
denominator of each formula.
The only thing that's different is this numerator.
And in the numerator here, that's where we account for the different weights based on these different
department sizes.
And if we were to actually do this math, what we'd see here is that we get an approximate employee
satisfaction score of 8.1, and that is a weighted mean based on the data that was turned in by our
department managers.
So we can calculate a mean, we can calculate a weighted mean.
It's also important to realize that we can calculate what's called a truncated mean.
This comes into play when we have data where maybe we've introduced some outliers.
For instance, if we have this data set here, notice that 16, 18, 21, etc. all the way to 33 this
part of the data set seems to be fairly consistent and then all of a sudden we have this enormous 91
value in the data set, which looks to be an outlier.
It looks to be outside of the normal range of the rest of the data set.
So it's possible, based on the context of how we collected this data, that this 91 value is an extreme
value, it's an outlier.
It doesn't really fit with the rest of the data.
Depending on why we think this value occurred, we may choose to calculate a truncated mean.
And what we would do in that case is say this 91 value looks like an outlier.
So what we're going to do is we're going to ignore it, so we're going to ignore this 91.
But because we're taking a value off of the high end of the data set, we're also going to take a value
off of the low end of the data set to kind of balance it out, leaving us with just these six values
in the data set between 18 and 33.
From there, then we would just calculate the mean of this six point data set.
We would add 18, 21, 27, 32, 32 and 33.
We'd add those together and divide by six because we have six values here and we would calculate a mean,
but it would be very important if we did that to indicate that we eliminated 25% of our data because
there were eight values in the original dataset, we took away two of them.
That means we took away 25% of our data set in order to calculate a truncated mean.
If we're ever going to do something like this, we need to be really, really careful when we do it,
because if we're taking out an outlier, doing so may give us a more accurate picture of what's going
on.
But it may also give us a less accurate picture of what's going on.
Maybe this 91 value that we got in our survey or that's sitting out here in our sample or our population.
Maybe this value is totally accurate and extremely important to include in the data set.
Or maybe something just went wrong with this 91 value and it is more appropriate to eliminate it to
get a more accurate mean.
We may feel fairly confident about eliminating this 91 value or we may not.
Either way, if we take away a value from our dataset, it's very important to indicate and to communicate
to anybody looking at this data, looking at the mean that we calculated that we did remove some outlier
data, that we removed 25% of the data set and that we're actually calculating here a truncated mean
as opposed to a.
FRUMIN With the original data set.
We always want to be really, really, really careful whenever we are manipulating the original data
set that we collected.
But this is something that we can do if we have really good reason to believe that we'll get a more
accurate picture of what's happening with the data.
And then we just want to make sure to communicate that that's in fact what we have done.
So this is kind of the general idea of mean.
Let's look at a second measure of central tendency, which is the mode.
Now, the mode of a data set is an even simpler concept than the idea of the mean of the set.
It is simply the value that occurs most often in the set.
So for instance, if we're looking at this data set, we can see that every value in the set occurs
once except this value here of 32, which occurs twice.
So because the value 32 occurs more than any other value in the set.
We say that 32 is the mode of the data set.
That would be the mode.
We don't say that.
Two is the mode of the data set.
Sometimes people think that the count of that highest value will be the mode.
The mode here is not.
Two the number of times the 32 occurs, the mode is actually 32.
So we could say that the mode of the data set is 32.
Now, a couple of things to think about with mode, we can also have a bimodal data set.
So this is the same set except that we have inserted an extra data point, an extra value of 18 here.
So 18 occurs twice and 32 occurs twice.
So we might say that this data set is bimodal, that it has two modes a mode of 18 and a mode of 32.
So 18 and 32 and indicate that this is a bimodal data set.
Or we can have the scenario where the data set has no mode.
In this case, every data point occurs only one time.
We have 16, 18, 21, 27, 32, 33, 91.
There's no value in the set that occurs more than any other value in this set.
There's no standout value.
And so we would say that this data set has no mode.
Now we'll talk a little bit more about mode when we talk about when to use different types of central
tendency.
But this is the idea for now and then the last measure of central tendency that we want to talk about
is the idea of the median.
Now, the median of a data set is the center of the data set that we find simply by ordering the entire
data set and looking for the value in the center.
So given this data set here, we've ordered the set from smallest to largest data point.
And so all we want to do is work our way in toward the center, will eliminate here or ignore the smallest
and the largest value.
We keep working our way in until we get to the center and we see here then that the value left in the
center is 27.
So for this set, the median is 27.
If we do the same thing for this set, working our way from the outside toward the inside, the data
set is already ordered from smallest to largest.
That's important when it comes to the median.
We have to have the data in order.
So if we start working our way in this way, we're left with now two values in the center, 27 and 32.
Now, for the median in particular, we can't just pick the value of 27 or pick the value of 32 because
neither one of them is exactly the center.
So what we say is when we have an even number of data points in our set, we'll always be left with
two data points that are at this center point position and then in order to calculate median will actually
go ahead and take the arithmetic mean take the mean of these last two centralized data points.
So with 27 and 32, we say 27 plus 32 and we have two data points here.
So we divide by two.
We end up with 59 over two.
And the result then is 29.5.
And so the median of this data set is 29.5, which is really just the mean of 27 and 32, the two most
centralized data points when we order the data set from smallest to largest.
So at the most basic level, that's how we calculate mean, median and mode.
But what's even more interesting is thinking about when to use each of these measures of central tendency
based on the kind of data we have and the context around our data.
So earlier we talked about all different kinds of data, including continuous versus discrete data,
nominal versus ordinal data, numeric versus non numeric data.
And now we've just introduced these ideas of mean median and mode, these three different ways of measuring
central tendency of measuring how the data collects itself around some center point, identifying the
center point of a data set.
What's far more interesting is thinking about when it's appropriate to use mean, when it's appropriate
to use median, when it's appropriate to use mode.
It might even be helpful to list more than one of these measures of center, depending on the data we're
looking at.
And not all of these measures are always going to make sense.
For instance, remember we said earlier that nominal data was data that couldn't be ordered at.
As an example, we said species of animals.
So if we think about household pets like dogs, cats, birds, etc., that's nominal data.
It's data that doesn't really have an order to it.
If that's the case, if we can't put data in a specific logical order, then there's really no way to
calculate a median for that data.
It really just doesn't make sense.
If you remember when we learned to calculate median, we said that we had to line up the data in order
from some sort of smallest to largest or one end to the other spectrum and then find the center point.
And that's just really not applicable at all if the data is not nominal.
Similarly, when we calculated a mean, we add it up all the data points and then divide it by the number
of data points, that's not going to make sense.
If we have non numeric data, we obviously can't find a sum for a data set that is non numeric that
isn't numbers.
We can't add letters, we can't add animal species, we can't add colors in a mathematical numeric sense.
So calculating a mean for non numeric data just doesn't really make sense.
But in all these other cases we should be able to calculate some kind of mean median mode for the data.
For instance, we could think about continuous data like a measurement of height for a group of people.
And we could imagine, of course, that we could calculate a mean height for that group of people.
We could also think about a set of discrete data, maybe the number of children per family in a data
set of families.
Of course, that's going to be a discrete number.
Every family is going to have zero children, one child, two children, three children, etc. No single
family is going to have 2.43 children.
So that would be an example of discrete data.
But of course, we could find a mean for that data simply by adding up the total number of children
and then dividing by the total number of families.
We would get a mean.
But keep in mind that in that example we might come up with a mean of, let's say 3.17 children per
one family, and we have to think about and interpret the context of that data.
We understand that no individual family is going to have 3.17 children while at the same time understanding
that the mean of the data set could be 3.17 children skipping around here.
We can think about, for instance, the mode of numeric versus non numeric data.
We've already looked at the mode of numeric data.
We had that data set earlier where the data point 32 occurred twice in the data set, and we said that
the mode of that data set was 32, but we could have non numeric data and indicate a mode.
For instance, maybe our family has two dogs.
And one cat.
And one bird.
As pets.
We would say that the mode of this data set is dogs.
This is non numeric data in terms of dogs, cat and bird, in the sense that our data set would be dog,
dog, cat bird.
That's non numeric data, but we could clearly see there that in the set dog, dog, cat bird, the
mode is dog.
And then maybe one last example.
Let's look at the mean of nominal versus ordinal data here.
Remember that nominal data is data that does not have some kind of specific order.
It can't be ordered versus ordinal data can be ordered.
We can put an ordinal data set in a logical specific order.
And the question then of whether we can calculate a mean for a data set that can't be ordered or calculate
the mean for a data set that can be ordered is dependent.
It depends on whether or not the data is numeric or non numeric.
For instance, you could imagine an ordinal data set of grades, letter grades in a class.
So if a professor is handing out grades A through F, that's data that can clearly be ordered, but
we wouldn't be able to calculate a mean of that data set because this is non numeric data.
And so we can't add up these grades and then divide by the total number of grades if instead of letter
grades were being given percentage grades, for instance, students have grades like 92% in the class
or 73% in the class.
Now we have numeric data and we could calculate a mean, but if all we have is letter grades A, through
F, B plus and C minus, etc., we can order that, but it's not numeric, so we can't calculate a mean.
So maybe we'll be able to calculate a mean for ordinal data if it's numeric data.
Same thing with nominal data.
Nominal data cannot be ordered, but we may still be able to calculate a mean if it's numeric data.
Now, if it's numeric, presumably we should be able to order it.
But the idea here is really just that we have to have numeric data if we're going to be able to calculate
a mean.
So this gives you a general idea of when we may be able to use mean median and mode depending on the
kind of data we have.
And of course these different types of data are not all exclusive.
We can have continuous data that is ordinal and numeric, or we can have discrete data that is nominal
and non numeric.
So these are overlapping categories.
We just have to think about which measures of central tendency are appropriate based on the kind of
data we're looking at.
And then the last thing is really where the art form of all of this gets introduced, which is this
idea of when it's most appropriate to use each of these particular measures of central tendency.
For example, in economics, in politics, we very often talk about annual household income for the
population of a country.
And when we talk about that statistic, we usually refer to median annual household income, not mean
annual household income.
And the reason is because there are very often a very small number of extremely, extremely, extremely
high income earners.
You think about the very wealthiest people in a country, the very wealthiest people in the world whose
incomes are so, so, so large that including them in the dataset would drastically skew the mean of
the dataset to the point we're talking about mean annual household income would really not give us a
good representation of typical annual household income, whereas median is a much better representation
of annual household income because when we look at the median, we eliminate all of those high income
earners, we eliminate all of those extreme outlier high income earners.
We just look at the center point, the median point for household income.
That tends to give us a much, much more typical look at annual household income for the population
of a country.
So when we talk about this statistic, we almost always refer to the median instead of the mean.
You can even think about a different example.
Imagine we have a race, maybe it's an Ironman triathlon and the race has a time limit.
Let's say there's a segment of the race that must be completed within 90 minutes.
So we say that the maximum time allowed is 90 minutes for this segment of a race.
And for any participants who don't complete that segment in 90 minutes, they're disqualified from the
rest of the race.
Their times don't count.
If we have a scenario like that, we have a bunch of people who are going to finish under this 90 minute
time cap, and then we're going to have a bunch of people who are disqualified who hit this 90 minute
time cap and then they are disqualified from the race.
If we want to take data of those participants and calculate some sort of a center for how long it.
Took the participants to finish this particular leg.
This particular segment of the race.
In this scenario, median would be a much better tool to use to calculate that measure of center than
mean, because, I mean, it doesn't really give us a way to handle all of the people who were disqualified
when they hit this 90 minute time cap.
But for median, you could imagine that we would line up all of the participants data points in order.
So you can think about lining up our data set like this.
And then we have a bunch of people at the top who were disqualified indicating those people here in
red.
Well, assuming we have enough participants, these people who were disqualified won't skew our measure
of center if we use median because we simply cross them out as we move to the center here and we end
up then with just these people in the center to calculate the median for the data set and get an actual
idea of center.
So in a scenario like that one, we may be forced to use median instead of mean.
The same would be true here with our letter grades A, B, C, D, and F.
We couldn't calculate a mean there, but we could find a median of letter grades.
And the whole idea here, the whole takeaway is just that when we're thinking about how to look at the
central tendency of the data, we need to first think about whether or not it's even possible to calculate
a mean and or a median and or a mode.
It may not even be possible to find all three of these measures for the data set.
So our first step is to think about what we actually can calculate.
And then once we know what we can calculate, to think about which measurement makes more sense.
So going back to the annual household income example, in that case, it would be possible to calculate
a mean, a median and a mode.
We would be able to find all three measures of central tendency for that data.
So that's our first step.
We have all three of these possibilities available to us.
But then our second step is to think about which of these three is most appropriate to represent the
data set.
And that's where we realize that median is going to give us a truer picture of what's going on with
this data set.
Then the mean will the mode may give us somewhat of an accurate picture, but the race here is probably
going to be between median and mode in this example with the race with the time limit.
Going back to our first step, which values can we calculate?
We may not even be able to calculate a mean if some of our participants didn't finish in this 90 minute
time cap.
So then the only options available to us are median and mode.
And based on the data set, we could decide which measure is more appropriate.
Which measure gives a better picture of the typical finishing time of our participants.
So as you're thinking through these measures of central tendency and getting comfortable working with
them, always come back to your two step process of number one.
Which of these measures can I calculate?
Number two of the measures I can calculate which is the most appropriate measure to use to best represent
the center of the data set.