Current time:0:00Total duration:8:43

0 energy points

# Interquartile range (IQR)

Video transcript

- [Voiceover] Let's get some practice calculating interquartile ranges. And I've taken some exercises from the Khan Academy exercises here, and I'm just gonna solve it on my scratch pad. The following data points represent the number of animal crackers in each kid's lunch box. Sort the data from least to greatest, and then find the interquartile range of the data set. And I encourage you to do this before I take a shot at it. Alright, so let's first sort it. And if we were actually doing this on the Khan Academy exercise, you could just click and drag these numbers around to sort them, but I'll just do it by hand. So, let's see. The lowest number here looks like it's a four. So, I've had that four, then I have another four. And then I have another four. And let's see, are there any fives? No fives, but there is a six. So then there's a six, and then there's a seven. There doesn't seem to be an eight, or a nine, but then we get to a 10. And then we get to 11, 12, no 13, but then we got 14, and then finally, we have a 15. So the first thing we wanna do is figure out the median here. So the median is the middle number. I have one, two, three, four, five, six, seven, eight, nine numbers, so there's going to be just one middle number. I have an odd number of numbers here. It's going to be the number that has four to the left, and four to the right. And that middle number, the median, is going to be 10. Notice I have four to the left, and four to the right. And the interquartile range is all about figuring out the difference between the middle of the first half, and the middle of the second half. It's a measure of spread, how far apart all of these data points are. And so, let's figure out the middle of the first half. So, we're gonna ignore the median here, and just look at these first four numbers. And so out of these first four numbers, I have, since I have an even number of numbers, I'm gonna calculate the median using the middle two numbers. So I'm gonna look at the middle two numbers here, and I'm gonna take their average. So the average of four and six, halfway between four and six is five. Or, you could say four plus six is equal to 10, but then I wanna divide that by two, so this is going to be equal to five. So the middle of the first half is five. You can imagine it right over there. And then the middle of the second half, I'm gonna do the same thing. I have four numbers, so I'm gonna look at the middle two numbers. The middle two numbers are 12 and 14. The average of 12 and 14 is going to be 13. If you took 12 plus 14, over two, that's going to be 26 over two, which is equal to 13. But an easier way for numbers like this, you say, hey, like 13 is right exactly halfway between 12 and 14. So there you have it. I have the middle of the first half, this five, I have the middle of the second half, 13. To calculate the interquartile range, I just have to find the difference between these two things. So the interquartile range for this first example is going to be 13 minus five. The middle of the second half, minus the middle of the first half, which is going to be equal to eight. Let's do some more of these. This is strangely fun. Find the interquartile range of the data in the dot plot below. Songs on each album in Shane's collection. And so, let's see what's going on here. And, like always, I encourage you to take a shot at it. So, this is just representing the data in a different way, but we could write this again as an ordered list. So, let's do that. We have one song, or we have one album with seven songs, I guess you could say. So, we have a seven. We have two albums with nine songs. So, we have two nines. Let me write those. We have two nines. Then we have three 10s. Cross those out. So, 10, 10, 10. Then we have an 11. We have two 12s. And then finally we have, so I used those already, and then we have an album with 14 songs. So, all I did here is I wrote this data like this, so we could see, okay, this album has seven songs, this album has nine, this album has nine. And the way I wrote it, it's already in order. So I can immediately start calculating the median. Let's see, I have one, two, three, four, five, six, seven, eight, nine, 10 numbers. I have an even number of numbers. So to calculate the median, I'm gonna have to look at the middle two numbers. So the middle two numbers, look like it's these two 10s here, because I have four to the left of them, and then four to the right of them. And so, since I'm calculating the median using two numbers, it's going to be halfway between them. It's going to be the average of these two numbers. Well, the average of 10 and 10 is just going to be 10. So, the median is going to be 10. And in a case like this, where I calculated the median using the middle two numbers, I can now include this left 10 in the first half, and I can include this right 10 in the second half. So, let's do that. So the first half is going to be those five numbers, and then the second half is going to be these five numbers. And it makes sense, because I'm literally just looking at, first half is gonna be five numbers, second half is gonna be five numbers. If I had a true middle number, like the previous example, then we ignore that, when we look at the first and second half. Or at least that's the way that we're doing it in these examples. But what's the median of this first half, if we look at these five numbers? Well, if you have five numbers, you have an odd number of numbers, you're gonna have one middle number. And it's going to be the one that has two on either side. This has two to the left, and it has two to the right. So the median of the first half, the middle of the first half, is nine, right over here. And the middle of the second half, I have one, two, three, four, five numbers, and this 12 is right in the middle. You have two to the left, and two to the right. So, the median of the second half is 12. Interquartile range is just gonna be the median of the second half, 12, minus the median of the first half, nine, which is going to be equal to three. So, if I was doing this on the actual exercise, I would fill out a three right over there. Now, let's do one more of this. And all of these just have data represented in different ways. The following frequency table shows the number of suspensions for each student in Lawrence Alternative Learning Program. Alright, Number of suspensions, and the Number of students. Find the interquartile range of the data set. So, the key here is to write all the data in an ordered list. So, we have one student with three suspensions, two students with four suspensions. So, once again, I'm trying to list all of the students-- I'm listing the number of suspensions for each student. So, two students with four suspensions. Three students with five suspensions. So five, five, five. I have one student with six suspensions, and one student with seven suspensions. Alright, there you have it. I have my list of the number of suspensions for each student, and it's already in order, so I can immediately start calculating the median. So I have one, two, three, four, five, six, seven, eight numbers here. So, to calculate the median, I'm gonna look at the middle two. The middle two is both fives. So, halfway between five and five, well that's just going to be five. So, the median here is going to be five. And so, to figure out the interquartile range, I need to figure out the median of the first half, of the first four numbers, and the median of the second half. And once again, since I had two middle numbers, I'm including the left one on the left half, and including the right one on the right half. If I had one middle number, like the first example that we said, I would ignore that, and then look at the first half and the second half. Let's see. The middle of three, four, four, and five, well, since I have an even number here, I have four numbers, I would have to use the middle two numbers to calculate it. And halfway between four and four, or the average of four and four, well, that's just going to be four. And then on this side, halfway between five and six, notice five and six are the middle two numbers, you have one to the left, one to the right. Well, the average of five and six is 5 1/2. Five plus six is 11, divided by two, is 5.5. So, the interquartile range is going to be the middle of the second half, minus the middle of the first half. So the interquartile range is going to be 5.5 minus four, which is equal to 1.5. And we're done.