In this video, we talk briefly about what standard deviation is, a measure of the variability of a set of data. And then we move on to see how to calculate the standard deviation from a list of data values. Here, we’ve got three sets of test results, scores out of ten for three different groups of nine students. How can we describe the differences in the results between the groups? Which group did best? Which did worst? What are the differences? Well first, we could work out the mean score for each group; add up the scores and divide by how many there are. Well, if we say 𝑥 is the value of a score of an individual, this 𝛴, this funny sign here in front of the 𝑥, means add up all the 𝑥-values: add up all the scores for a particular group. And then 𝑛 is simply the number of people in each group, and that’s nine students in each case. Now it turns out with this particular set of data, whether I go for group 𝐴 or 𝐵 or 𝐶, if I add up all their scores, I get the same answer, forty-five. So in all three cases, my mean score is gonna be forty-five divided by nine, which is five. So my mean score in all three groups is five. So on average, they all did the same.
Okay, let’s work out the median score for each group. And to do that, we need to organize them in order from smallest to largest in each group and look at the middle score. The middle person in each case has got four students to the left and four students to the right. And again in all three cases the median score here is five. So again we’re saying, on average, all three groups did the same. Right, well now we can start to look at the variability of the data. Well in group 𝐵, everybody scored exactly five. That’s a very consistent performance across the group. There was zero variability in their scores. But in groups 𝐴 and 𝐶, there was some variation between individuals.
So which group’s scores vary the most? Well, we could calculate the range of scores in each group, and that’s the difference between the highest and the lowest scores. So in groups 𝐴 and 𝐶, that would again be the same, nine take away one. That’s eight in each case. So that very simple measure of variability, range, says that’s the same amount of variability in groups 𝐴 and 𝐶. But it looks like there’s more variability in group 𝐴 where every single person got a different score, cause in group 𝐶 all but two people got the same score of five out of ten. How can we capture that difference between the two groups? Well, one way would be to calculate how much each individual’s score varied from the mean score for that group, and then work out the mean of those. But the problem with that approach is that some people scored more than the mean and some people scored less than the mean. So some of the variations are going to be positive and some are gonna be negative. And then when you add them all up to calculate the mean variation from the mean, some or all of them could cancel each other out. For example, in group 𝐴 these are the scores they got. And we said that the mean score was five, so we can work out the difference between each person’s score and the mean. For example, the person who only scored one; that’s four below the mean. The person who scored five; that’s a difference of zero from the mean. And the person who scored nine was four above the mean. Now, if I want to work out that mean difference from the mean, I’ve got to add up all those differences and then divide by the number of scores there were, nine. So when I try to calculate the mean deviation from the mean, I need to add up all those differences and then divide by how many scores there were; that’s nine. But when I do that, the sum of the differences from the mean is equal to zero. Negative four add four, negative three add three, negative two add two, negative one add one plus zero is equal to zero. So this method falls down. It’s saying that the total variability of the mean variability for this set of data is zero. But in fact, every single person got a different score, so there was lots of variation in the scores. So to stop that sort of thing happening and all those variations cancelling each other out, cause it doesn’t really matter whether it’s a positive or a negative variation from the mean so long as it’s a variation from the mean, we in fact square all of those differences. So we’re now going to add up all of these 𝑥 minus 𝑥 bar squares and then divide by the number of people we’ve got, so 𝑛 is equal to nine. And when I add all those scores together, sixteen plus nine plus four plus one plus zero plus one plus four plus nine plus sixteen, I get sixty. So this measure of variability gives us an answer of sixty divided by nine, which is six and two-thirds. Now, we call this number the variance of the data set. But it’s the variance of the squares of the deviations from the mean, and their result is in square units. So we usually take the square root of that result and call it the standard deviation. So for group 𝐴, the variance was six and two-thirds. And the standard deviation is the square root of that, which is about two point five eight to two decimal places. Our interpretation of this is that in group 𝐴, on average, people’s scores vary from the mean score by about two point five eight.
So let’s just summarise that. The variance is a measure of the variability, of the square variability in fact. To calculate it, first we need to find the mean score in that set of data. And then for every individual, we work out how different their score was from that mean, so 𝑥 minus 𝑥 bar, and then we square that difference. Then we add up all of those squares of differences and divide by how many pieces of data we’ve got. And there’s a special symbol for that; it’s this small 𝜎 squared. And because those units are in square units, if we take the square root of that number, we get something called the standard deviation. And we just use the little 𝜎 notation to represent that. And a way to describe the standard deviation is it’s the root mean square deviation from the mean. Now, we can rearrange that formula a little bit with a little bit of magic, and it actually turns it into a slightly more usable friendly version of the formula. And this rearrangement gives you exactly the same answer at the end of the day. But as we said, when you’ve got lots of data, it turns out to be easier to do this calculation than the previous one. And that first term there, 𝛴 𝑥 squared over 𝑛 is the mean of the squares of the data. So we have to take each individual piece of data and square it and then divide by how many bits of data there are. And when we’ve got that result, we then subtract the square of the mean of the data. So 𝛴 𝑥, adding up all of the 𝑥 scores divided by 𝑛, taking that result, and squaring it. Now of course if we take the square root of that answer, we’ve got the standard deviation. Okay, let’s see that in action then. Let’s use it to calculate the standard deviation for the scores in group 𝐶. So first we’re gonna list all the scores: one and then all the fives and then the nine. Then we’re going to square all of those individual scores, so one and then lots of twenty-fives and then eighty-one. Now if we add up all the 𝑥 scores, remember we’ve got forty-five, and if we add up all these 𝑥 squared values, it gives us two hundred and fifty-seven. Now remember, our formula for standard deviation is the sum of the 𝑥 squares divided by 𝑛 take away the sum of 𝑥 divided by 𝑛 all squared and then take the square root of that whole answer. So let’s plug the numbers in. So that’s two hundred and fifty-seven divided by nine minus forty-five divided by nine all squared and then the square root of that whole thing. And that simplifies down to the square root of thirty-two over nine, which is one point eight nine to two decimal places. So comparing these then for group 𝐴 and group 𝐶, remember that mean was exactly the same, the range was exactly the same, the median was exactly the same, but the standard deviation for group 𝐴 was two point five eight to two decimal places while for group 𝐶 was one point eight nine to two decimal places. So that’s nicely captured for us the fact that there’s more variability in the group 𝐴 scores. Everybody’s got something different, whereas in group 𝐶 most people scored the same and only a couple of people scored something different.
Alright then, just before we go, let’s do one final example. Calculate the standard deviation of the values twelve, nineteen, twenty-three, twenty-five, thirty-seven, and forty-two. Give your answer to two decimal places. So first, we’re gonna write out all of our 𝑥 values; that’s just the list of data. Then we notice we’ve got six pieces of data, so 𝑛 is equal to six. Next, we need to square the values of each individual piece of data. Twelve squared is a hundred and forty-four, nineteen squared is three hundred and sixty-one, twenty-three squared is five hundred and twenty-nine, twenty-five squared is six hundred and twenty-five, thirty-seven squared is one thousand three hundred and sixty-nine, and forty-two squared is one thousand seven hundred and sixty-four. Now, if we add up all the 𝑥 values, it gives us a total of one hundred and fifty-eight. And if we add up all the 𝑥 squared values, it gives us a total of four thousand seven hundred and ninety-two. And remember the formula for standard deviation, 𝜎 is equal to the square root of the sum of 𝑥 squared over 𝑛 minus the sum of 𝑥 over 𝑛 all squared. Well, the sum of 𝑥 squared was four thousand seven hundred and ninety-two and 𝑛 was six, and that first bit is that. The sum of 𝑥s was a hundred and fifty-eight and 𝑛 was six, so we’ve got to square a hundred and fifty-eight over six. And then we’ve got to take the square root of the whole thing. Well, my calculator tells me that simplifies down to nine hundred and forty-seven over nine, which is ten point two five seven seven eight eight three seven and so on, but we want to give our answer to two decimal places. So the answer is the standard deviation is equal to ten point two six to two decimal places.
So we’ve learned two different formulae then for the standard deviation. We use this symbol here, little 𝜎, to represent standard deviation. And the first formula is it’s the square root of the sum of the 𝑥 minus the means all squared divided by 𝑛. Although sometimes in practice we use this method: we square each of the scores and add those up and divide by how many there are, and then we take away the mean all squared. And an easy way to remember that formula is it’s the mean of the squares minus the square of the mean, all square rooted. And finally, remember if you don’t take that square root at the end, you’ll have 𝜎 squared, and we call that the variance.