Notes on Lesson 2: Median and quartiles of grouped data (Maths 11 Chan troi sang tao, Chapter V)
Lesson summary
The median of grouped data is the value that divides the data sample, arranged in non-decreasing order, into two halves with the same number of data values in each half.
The quartiles of grouped data consist of three marks , , that divide the arranged sample into four parts, each with about data values.
The median is the place that splits the team in half.
This content is not yet available in English. It is shown below in the original Vietnamese.
- Tính được trung vị, tứ phân vị của mẫu số liệu ghép nhóm và giải thích ý nghĩa
You have seen a statistical table of the heights of a football team, where people only write groups like , together with the number of players in each group, and do not write each player's height. So how can we know how tall the player in the middle of the team is, or below what level half the team is? This lesson helps you compute the median and the quartiles of grouped data, that is, the marks that split the whole team in half and in quarters in ascending order, and then understand what each of these numbers says about the data sample.
Key ideas: what do you need to know?
Median of grouped data
- The median of grouped data is the value that divides the data sample, arranged in non-decreasing order, into two halves with the same number of data values in each half.
- Let be the sample size, that is, the sum of the frequencies. Suppose the group containing the median is group number : , with frequency , and is the sum of the frequencies of the groups before it. Then
- The group containing the median is the first group whose cumulative frequency is greater than or equal to .
- For example: with we have ; if the cumulative frequencies of the groups are , then the third group is the group containing the median, because while the second group only reaches .
- Meaning: from grouped data in general we cannot determine exactly the median of the original data sample. The median of grouped data is an approximation for the median of the original data sample and can be taken as a representative value for the data sample.
In plain words: The median is the place that splits the team in half. Picture the whole class lining up in ascending order of height: the student standing exactly in the middle of the line is the median. With a grouped table, you do not know where each student stands, so you have to find which group the middle position falls into: keep adding up the frequencies from the lowest group, and the group that passes half the sample size contains the median. Why does the formula have a part multiplied by the class width? Because within that group, the data values are considered spread evenly over the whole interval, so however many parts of the group you need, you add that many parts of the length. Note one subtle point: if the middle position falls exactly at the boundary between two consecutive groups, that is, the median is the average of two data values belonging to those two groups, then we simply take that common endpoint as the median.
Phrase by phrase
- median
- The value that divides the arranged sample into two halves with an equal number of data values, denoted .Example: With , the median is the level at which students are shorter than or equal to it and students are taller than or equal to it.
- group containing the median
- The first group whose cumulative frequency is greater than or equal to .Example: , cumulative frequency , then the third group contains the median.
- cumulative frequency
- The sum of the frequencies from the first group to the group being considered.Example: With frequencies , the cumulative frequency of the third group is .
- approximation for the median of the original data sample
- Because the whole group has been replaced by an interval, the median computed is only an approximation to the true median of the individual original data values.Example: We can compute minutes, while the true median of the original data values might be or minutes.
First quartile and third quartile
- The quartiles of grouped data consist of three marks , , that divide the arranged sample into four parts, each with about data values.
- To compute the first quartile : suppose the group containing is group , with frequency , and . Then
- To compute the third quartile : suppose the group containing is group , with frequency , and . Then
- The group containing is the first group whose cumulative frequency is greater than or equal to ; the group containing is the first group whose cumulative frequency is greater than or equal to .
- The second quartile is exactly the median .
- If the quartile is , where and belong to two consecutive groups, then we take , with the common endpoint of those two groups.
- For example: then and ; with cumulative frequencies , the second group contains and the fourth group contains .
In plain words: The median splits it in two, the quartiles split it in four. Just picture the line of classmates ordered by height: is the classmate standing at the one-quarter mark, is the one in the middle, is the one at the three-quarters mark. Finding them works exactly like finding the median, only the mark you aim for changes: for , for , for . Why count cumulative frequency instead of comparing each frequency? Because the mark is the position in the whole line, and to know which group that position falls in you have to know how many classmates you have already counted past. As for taking when the mark lands exactly on a boundary: there the two data values sit right on either side of the shared endpoint, their average is approximately that endpoint itself, so taking the endpoint keeps it simple.
Phrase by phrase
- quartile
- The three marks , , divide the sorted sample into four equal parts.Example: then is at mark , at mark , at mark .
- first quartile
- The one-quarter mark of the sample, computed with a formula of the same shape as the median but with replaced by .Example: Groups , , , : .
- third quartile
- The three-quarters mark of the sample, computed with mark .Example: Groups , , , : .
- The second quartile is exactly the median
- The halfway mark is both the second quartile and the median, no need to compute it again.Example: : .
Common mistakesWhen finding the median, mistakenly taking the sum of the frequencies of the groups before the group containing the median as the cumulative frequency of that group itself. For example, with cumulative frequency , the third group contains the median, so , not .
Common mistakesWhen the mark falls exactly on the boundary between two consecutive groups (the cumulative frequency exactly equals the mark), thinking you must take the average of the two endpoints or handle it separately. No need: choosing the earlier group gives exactly the right endpoint of that group, choosing the later group gives exactly the left endpoint, the two ways coincide and match the convention .
What the median and quartiles mean
- The three quartile points divide the sorted data sample into four equal parts. As with the median, in general you cannot determine the quartile points of grouped data exactly.
- The set of three quartiles of grouped data is an approximate value for the quartiles of the original data sample and is used as a measure of the centre trend of the data sample.
- The first and third quartiles measure the centre trend of the lower half (the data less than ) and the upper half (the data greater than ) of the data sample.
- The median is little affected by a few outliers, so when the sample has strongly differing values, the median is more reliable than the mean for knowing the general level.
- The range from to contains the middle half of the data; the narrower this range, the more concentrated the middle half of the sample, the wider it is, the more spread out the data.
- Example: a median Internet browsing time of minutes means half of you use it for no more than about minutes; and tell us that the middle half of the class uses it from about to minutes each evening.
In plain words: Each number tells a story in its own way. The median says "the classmate in the middle of the whole group is at this level", so a few classmates with very large values cannot make it jump, unlike the mean. The quartiles tell about the two halves: tells you around what level the lower half of the group lies, tells you around what level the upper half lies. When to use which? If you want to describe the "typical level" of a sample with a few strongly differing values, use the median. If you want to know whether the group is even, look at the range from to : a narrow range means the whole group is approximately alike, a wide range means some classmates are very low and some are very high.
Phrase by phrase
- measure of centre trend
- The number in the middle, representing the whole data sample.Example: The median height of the class is a measure of centre trend.
- lower half
- The part of the data less than , that is, less than the median.Example: With , the lower half is the classmates who use less than about minutes.
- upper half
- The part of the data greater than .Example: With , the upper half is the classmates who use more than about minutes.
- little affected by a few outliers
- A few values that are too large or too small hardly change the median, because the median only cares about the middle position.Example: Adding one classmate who uses minutes to the sample leaves the median almost unchanged, while the mean rises clearly.
How to present a median and quartile calculation
- Step 1: Compute the sample size as the sum of the frequencies, then compute the marks you need: for , for , for .
- Step 2: Make a cumulative frequency table by adding up the frequencies from the first group to the last.
- Step 3: Compare the mark with the cumulative frequency column to pick the right group: the first group whose cumulative frequency is greater than or equal to the mark.
- Step 4: Write down clearly the left endpoint , the frequency of that group, the total frequency of the previous groups and the class width , then substitute into the formula.
- Step 5: Check that the result lies within the range of the group you just used; if it falls outside that range, you substituted the wrong numbers.
- Example: with , cumulative frequency and groups of width , the group containing is the second group , so , which indeed lies in .
In plain words: This type of exercise is not hard because of the arithmetic, it is hard because you have to pick the right group and substitute the right numbers. Follow the exact order: find the marker first, add up the frequencies next, and only then substitute into the formula. When you substitute, read it aloud in your head: "left endpoint plus, marker minus cumulative frequency before the group, divide by the group frequency, multiply by the class width" so you do not mix things up. The final check is well worth it: the result must fall inside the very interval of the group you just used, because the median and quartiles lie in the group that contains them. If it comes out outside, you almost certainly took the wrong or the wrong class width.
Phrase by phrase
- add up the frequencies
- Take the frequency of the previous group plus the frequency of the group being considered to get the cumulative frequency.Example: Frequency gives cumulative frequency .
- left endpoint
- The number comes first in the group notation .Example: The group has left endpoint .
- class width
- The difference between the two endpoints of the group.Example: The group has class width .
- check that the result lies in the interval of the group
- The median and quartiles must fall in the group that contains them, use this to spot a wrong substitution.Example: must lie in , that is right.
Common mistakesForgetting to check whether the result lies within the interval of the group just used. The median and quartiles must fall in the group that contains them; if the result is outside that interval, the wrong numbers were substituted.
TipThree marks to remember: for , for the median , for . Just keep adding up the frequencies until you pass the mark, and you get the group that contains it.
TipThe formula for the median and the quartiles follows the same pattern: left endpoint plus (mark minus the sum of the frequencies of the previous groups) divided by the group frequency, times the class width. Only the mark and the chosen group differ.
TipAfter calculating, check that the result lies within the range of the group just used and ; if it does not, the formula or the numbers were wrong.
A complete example
- Given the time spent on the Internet each evening (minutes) of students: has students; has students; has students; has students; has students.
- Sample size , so , , . Cumulative frequencies: .
- Median: the first group to reach is the third group , with , , class width , so minutes.
- First quartile: the first group to reach is the second group , with , , so minutes.
- Third quartile: the first group to reach is the fourth group , with , , so minutes.
- Conclusion: half of the students use no more than about minutes each evening; the middle half of the class use from about to minutes.
In plain words: Notice that the three calculations share one pattern, only the marker and the group differ. For the median, the marker falls in the third group, so take the third group. For , the marker falls in the second group, so take the second group, and is only , not . For , the marker goes past the third group (only ), so you must move to the fourth group. The easiest place to go wrong is taking the wrong : is always the sum of the frequencies of the groups before the chosen group, not the cumulative frequency of the chosen group. The results are in the right order, which is also a sign that your work is reasonable.
Phrase by phrase
- marker
- The values , , are used to compare with the cumulative frequency when choosing the group.Example: For , the markers are , , .
- third group
- The group containing the median in the example, because the cumulative frequency is the first to pass the marker .Example: .
- sum of the frequencies of the groups before the chosen group
- This is exactly in the formula, not the cumulative frequency of the chosen group.Example: Choosing the fourth group gives .
Common mistakesChoosing the group containing the median by comparing with the individual frequency of each group instead of with the cumulative frequency, so the wrong group is chosen. You must compare with the cumulative frequency.
Worked examples
Example 1
The time (minutes) spent on the Internet each evening by 56 students is grouped as follows:
Group : 3; group : 12; group : 15; group : 24; group : 2.
Calculate the median of this grouped data.
Show the solution to example 1
Step 1: Calculate the sample size , giving .
Why: The median splits the sample into two halves of 28 values each, so the marker to find is 28.
Step 2: Make the cumulative frequency table: .
Why: Add up the frequencies to see at which group at least 28 values have been counted.
Step 3: The first group with cumulative frequency greater than or equal to 28 is the third group , because while the second group only reaches .
Step 4: For the third group: left endpoint , frequency , sum of the frequencies of the previous groups , class width .
Step 5: Substitute into the formula:
Why: The marker 28 goes past the first 15 values, 13 more values are still needed; in the third group each value takes up minutes, so add minutes.
Result: minutes. Check: lies in , which is reasonable.
Example 2
Using the data table from the previous example (56 students, groups 3 minutes wide), calculate the first quartile and the third quartile .
Show the solution to example 2
Step 1: Sample size , so and .
Why: is the one-quarter mark, is the three-quarter mark of the 56 quantitative data values.
Step 2: Cumulative frequency: .
Step 3: The first group to reach 14 is the second group , because while the first group only reaches .
Step 4: For the second group: , , , length .
Why: The mark 14 goes past the first 3 quantitative data values, still 11 quantitative data values short; each quantitative data value in the second group takes up minutes, so add minutes.
Step 5: The first group to reach 42 is the fourth group , because while the third group only reaches .
Step 6: For the fourth group: , , , length .
Why: The mark 42 goes past the first 30 quantitative data values, still 12 quantitative data values short; each quantitative data value in the fourth group takes up minutes, so add minutes.
Result: minutes; minutes. Check: lies in , lies in , and , which is reasonable.
Common mistakesMixing up the quartile marks: using for or for . The correct marks are for , for , for .
Example 3
The height (cm) of 50 students in class 11A is grouped:
: 6; : 14; : 10; : 12; : 8.
a) Calculate the median .
b) Calculate and .
c) From the results, give a simple comment about the height of the class.
Show the solution to example 3
Step 1: Sample size , so , , .
Step 2: Cumulative frequency: .
Step 3: a) The first group to reach 25 is the third group , because while the second group only reaches .
For the third group: , , , length .
Why: The mark 25 goes past the first 20 quantitative data values, still 5 quantitative data values short; each quantitative data value in the third group takes up cm, so add cm.
Step 4: b) The first group to reach 12.5 is the second group , because while the first group only reaches .
For the second group: , , , length .
Why: The mark 12.5 goes past the first 6 quantitative data values, still 6.5 quantitative data values short; each quantitative data value in the second group takes up cm, so add cm.
Step 5: The first group to reach 37.5 is the fourth group , because while the third group only reaches .
For the fourth group: , , , length .
Why: The mark 37.5 goes past the first 30 quantitative data values, still 7.5 quantitative data values short; each quantitative data value in the fourth group takes up cm, so add cm.
Step 6: c) An approximate median of cm means that half of the students are no taller than about cm. The range from cm to cm contains the middle half of the class, about cm wide, which shows that heights in the class vary quite a lot.
Result: a) cm; b) cm, cm; c) the middle half of the class is about cm to cm tall, so heights are quite spread out.
Example 4
The number of students in 100 classes is grouped, with cumulative frequency:
: 9 (cumulative 9); : 20 (29); : 20 (49); : 30 (79); : 21 (100).
a) Calculate the median .
b) A parent says "every class in this school has about 43 students". Is that comment reasonable?
Show the solution to example 4
Step 1: a) The sample size is , so .
Step 2: Cumulative frequency: . The first group to reach 50 is the fourth group , because while the third group only reaches .
Step 3: For the fourth group: , , , class width .
Why: The mark 50 passes the first 49 data values by exactly 1 unit, still 1 data value short; in the fourth group each data value accounts for students, so add students, and the result is very close to the left endpoint 42.
Step 4: b) A grouped median of means that half the classes have no more than about students, and the other half have more.
Step 5: Looking at the data table: 49 classes have fewer than 42 students (nearly half), only 30 classes fall in the group , that is around 43, and 21 classes have 44 students or more.
Step 6: So saying "every class has about 43 students" is not reasonable: fewer than one-third of the classes are around 43, while nearly half the classes have fewer than 42 students.
Result: a) students; b) the parent's remark is not reasonable.
Example 5
A shoe shop recorded the shoe sizes sold in one month, with groups 1 size wide:
: 8; : 25; : 40; : 22; : 5.
a) Find the median and the first and third quartiles.
b) Which sizes should the shop stock more of? If next month there are 10 more pairs of size 45 (group ), how does the median change, and should it be used to decide what to stock?
Show the solution to example 5
Step 1: a) The sample size is , so , , .
Step 2: Cumulative frequency: .
Step 3: Median: the first group to reach 50 is the third group , because while the second group only reaches .
For the third group: , , , class width .
Step 4: : the first group to reach 25 is the second group , because while the first group only reaches .
For the second group: , , , class width .
Step 5: : the first group to reach 75 is the fourth group , because while the third group only reaches .
For the fourth group: , , , class width .
Step 6: b) The largest group is with 40 pairs, so the shop should stock more of size 38. The median also points to around size 38.
Step 7: If 10 more pairs of size 45 are added (group ), the new sample size is , the median mark is . New cumulative frequency: . The first group to reach 55 is still the third group , because .
Why: Adding 10 pairs of size 45 raises the median mark from 50 to 55, but it still lies in the third group, so the median only moves up a little.
Step 8: The median changes very little (from to ), while the mean would be pulled up noticeably. So use the median (or the mode) to decide what to stock, and do not use the mean when there is an outlier.
Result: a) , , ; b) stock more of size 38; the new median is , still more reliable than the mean.
Terms
- Grouped data
- A table that divides the data into groups of the form together with the frequency of each group.Example: Group has students.
- Sample size
- The total number of data values, equal to the sum of the frequencies, denoted .Example: .
- Frequency
- The number of data values falling into one group, denoted for the th group.Example: Group has frequency .
- Cumulative frequency
- The sum of the frequencies from the first group up to the group being considered, used to choose the group containing the median and quartile.Example: Frequency gives cumulative frequency .
- Median
- The value that divides the ordered data sample into two equal halves, denoted .Example: minutes.
- Quartile
- The three marks , , divide the sorted sample into four equal parts.Example: , , .
- Second quartile
- The mark that splits the sample in half, which is the median .Example: .
- Approximate value
- A value calculated from the grouped table, only an approximation of the corresponding values of the original data sample.Example: The median minutes is an approximation for the true median of the original data values.
- Measuring central tendency
- Use a single number in the middle to represent the whole data sample.Example: The quartile of the grouped data is used as a value measuring central tendency.
Practise similar problems
Practice questions from the Ket noi tri thuc series on the same ideas as this lesson. Answer each one and get it marked straight away.