Grouped data
🖨 Print a self-study sheet Why print?
Suppose a teacher asks students in grade 11 how many minutes it takes them to get from home to school. The result is numbers, each a whole number of minutes. We would like to say things like "most students take about to minutes" or "so many students take less than minutes".
It is hard to draw such conclusions from separate numbers. How can we summarise them in a compact table that still keeps the main information?
Grouping data
Explore: counting in intervals
Here are the journey times (in minutes) of the students (imagined data): The smallest value is and the largest is . We split the range from to minutes into equal intervals, each minutes long, and count how many values fall in each interval. Convention: the interval contains the numbers with , that is it includes but not . This way every value belongs to exactly one interval; for example belongs to , not to .
| Time (minutes) | [30, 40) | [40, 50) | |||
|---|---|---|---|---|---|
| Students | 6 | 14 | 12 | 6 | 2 |
The numbers in the table add up to 6+14+12+6+2=40, the number of students asked, so nobody was missed. Now we see at once that the class [10, 20) has the most students.
For a grouped table to be correct and useful, we usually follow these rules:
- The classes are consecutive intervals that do not overlap (every value belongs to exactly one class) and leave no gaps (every value belongs to some class).
- The classes usually have the same width, to make comparison and drawing graphs easier.
- The number of classes is moderate: too few lose a lot of information, too many give a long table with small, untidy frequencies.
In a histogram, each class is drawn as a bar whose width is the class width and whose height is proportional to the frequency; the bars touch because the classes are consecutive. The frequency is written above each bar in the picture.
Relative frequency and cumulative frequency
The frequency tells us "how many students", but when we compare two samples of different sizes we need to know "what fraction".
For the journey-time data we get the complete table:
| Class (minutes) | Frequency | Relative frequency | Cumulative frequency |
|---|---|---|---|
| [0, 10) | 6 | 15\% | 6 |
| [10, 20) | 14 | 35\% | 20 |
| [20, 30) | 12 | 30\% | 32 |
| [30, 40) | 6 | 15\% | 38 |
| [40, 50) | 2 | 5\% | 40 |
For example \dfrac{14}{40}\cdot100\%=35\% and 6+14=20. The number 20 tells us that exactly 20 students take less than 20 minutes, which is half the class. The last number in the cumulative column is always the sample size n.
Representative values
After grouping we no longer know the exact value of each data point, only which class it lies in. When we need one number to "represent" a whole class, we take its midpoint.
For example the representative value of the class [10, 20) is 15 and of the class [20, 30) is 25. In the next lesson we use representative values to estimate the mean, median, quartiles and mode of grouped data.
When the original data are available, we build the table ourselves.
Now we find the relative and cumulative frequencies for a given table.
Next, we see what information grouping loses.
Finally, relative frequencies help us compare two samples of different sizes.
Connections. In grade 10 we found the mean, median, quartiles and mode from raw data. When we have only a grouped table we do not have the raw data, so in the next lesson we use representative values and cumulative frequencies to estimate these numbers. For example, with the representative values 5, 15, 25, 35, 45 we estimate the mean journey time as \dfrac{5\cdot6+15\cdot14+25\cdot12+35\cdot6+45\cdot2}{40}=21 minutes, close to the 20.575 minutes found from the 40 raw values.
Key terms
Summary
- Grouping data means dividing them into consecutive classes [a_i, a_{i+1}) that do not overlap and cover all the data, usually of equal width.
- The frequency m_i is the number of data values in a class; the frequencies add up to the sample size n.
- Relative frequency: f_i=\dfrac{m_i}{n}\cdot100\%; they add up to 100\%.
- The cumulative frequency of a class is the sum of the frequencies from the first class up to it; it gives the number of values less than the upper boundary of the class.
- The representative value of the class [a_i, a_{i+1}) is \dfrac{a_i+a_{i+1}}{2}.
- Grouping loses information: we only know which class each value lies in, so many quantities can only be estimated.
Practice
Each exercise comes with what you need and hints. Try it yourself first, then open the solution.
The heights (in cm) of 20 students are 152, 158, 161, 165, 149, 170, 155, 162, 168, 157, 160, 173, 154, 163, 166, 159, 151, 164, 169, 156. Build a grouped frequency table with the classes [145, 150), [150, 155), [155, 160), [160, 165), [165, 170), [170, 175).
What you need: every value belongs to exactly one class of the form [a, b); check that the frequencies add up to 20.
Steps:
- For each number, decide which class contains it (note that 150 belongs to [150, 155)).
- Count the frequencies and add them up as a check.
Show solution
To build a grouped frequency table, we place each value into the class that contains it. Each class has the form [a, b), so it includes a but not b (for example 165 belongs to the class [165, 170), not to [160, 165)).
Arrange the 20 values in increasing order: 149, 151, 152, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 168, 169, 170, 173.
Count the values in each class:
- Class [145, 150): 149, which is 1 value.
- Class [150, 155): 151, 152, 154, which is 3 values.
- Class [155, 160): 155, 156, 157, 158, 159, which is 5 values.
- Class [160, 165): 160, 161, 162, 163, 164, which is 5 values.
- Class [165, 170): 165, 166, 168, 169, which is 4 values.
- Class [170, 175): 170, 173, which is 2 values.
Check: 1+3+5+5+4+2=20, which equals the number of students.
So the grouped frequency table is
| Height (cm) | [145, 150) | [150, 155) | [155, 160) | [160, 165) | [165, 170) | [170, 175) |
|---|---|---|---|---|---|---|
| Frequency | 1 | 3 | 5 | 5 | 4 | 2 |
Answer. The frequencies are 1, 3, 5, 5, 4, 2.
Grouped heights (in cm) of a sample of size 50: [140, 150) has 5, [150, 160) has 12, [160, 170) has 18, [170, 180) has 10, [180, 190) has 5 people. Find the relative frequency and cumulative frequency of each class.
What you need: f_i=\dfrac{m_i}{n}\cdot100\%; the cumulative frequency is a running total.
Steps:
- Divide each frequency by 50 and multiply by 100\%.
- Add up the frequencies as a running total.
Show solution
The sample size is n=50. The relative frequency of a class with frequency m is \dfrac{m}{n}\cdot100\%; the cumulative frequency of a class is the sum of the frequency of that class and of all classes before it.
Relative frequency of each class: \frac{5}{50}=10\%,\quad\frac{12}{50}=24\%,\quad\frac{18}{50}=36\%,\quad\frac{10}{50}=20\%,\quad\frac{5}{50}=10\%.
Check: 10\%+24\%+36\%+20\%+10\%=100\%.
Cumulative frequency of each class: 5,\quad5+12=17,\quad17+18=35,\quad35+10=45,\quad45+5=50.
Check: the cumulative frequency of the last class equals the sample size 50.
So we get the table
| Class | [140, 150) | [150, 160) | [160, 170) | [170, 180) | [180, 190) |
|---|---|---|---|---|---|
| Relative frequency | 10\% | 24\% | 36\% | 20\% | 10\% |
| Cumulative frequency | 5 | 17 | 35 | 45 | 50 |
Answer. Relative frequencies: 10\%, 24\%, 36\%, 20\%, 10\%; cumulative frequencies: 5, 17, 35, 45, 50.
Each of the following grouped tables of weights (in kg) has an error. Point out the error and correct it.
a) [40, 45), [45, 50], [50, 55), [55, 60).
b) [40, 45), [45, 50), [55, 60), [60, 65).
What you need: the classes must be consecutive, non-overlapping and without gaps.
Steps:
- Check whether the upper boundary of each class equals the lower boundary of the next.
- Look for any interval that is not covered.
Show solution
A correct grouped table has consecutive classes: every class has the form [a, b) and the right endpoint of one class is the left endpoint of the next, so each value belongs to exactly one class.
a) The class [45, 50] contains the value 50. The value 50 also belongs to [50, 55), so it is counted twice, that is, the two classes overlap at 50. We correct this class to [45, 50), so that 50 belongs only to [50, 55).
b) After the class [45, 50) comes the class [55, 60), so values from 50 up to but not including 55 belong to no class. We correct this by adding the class [50, 55), which gives the classes [40, 45), [45, 50), [50, 55), [55, 60), [60, 65).
So in table a) the error is an overlap at 50, corrected to [45, 50); in table b) the error is the missing class [50, 55), corrected by adding this class.
Answer. a) Overlap at 50; correct to [45, 50). b) [50, 55) is missing; add this class.
Suppose the monthly household water use (in \text{m}^3) of 50 households is grouped as: [0, 5) has 4 households, [5, 10) has 16, [10, 15) has 18, [15, 20) has 9, [20, 25) has 3. What percentage of the households use less than 15\ \text{m}^3 a month?
What you need: the cumulative frequency of the class [10, 15) gives the number of households using less than 15\ \text{m}^3.
Steps:
- Add the frequencies of the first three classes.
- Divide by 50 and multiply by 100\%.
Show solution
The classes [0, 5), [5, 10), [10, 15) consist of the households using less than 15\ \text{m}^3 a month; the other two classes use 15\ \text{m}^3 or more.
The number of households using less than 15\ \text{m}^3 is 4+16+18=38\ (\text{households}).
The sample size is 50 households, so the required percentage is \frac{38}{50}\cdot100\%=76\%.
So 76\% of the households use less than 15\ \text{m}^3 a month.
Answer. 76\%.
The heights of 40 students are grouped: [150, 155) has 4, [155, 160) has 10, [160, 165) has 14, [165, 170) has 9, [170, 175) has 3 students.
a) Write the representative value of each class.
b) Assuming that the heights in each class are spread evenly, estimate the number of students shorter than 162.5 cm.
What you need: the representative value is the midpoint of the class; 162.5 is the midpoint of the class [160, 165).
Steps:
- Find the midpoint of each class.
- Add the classes that lie entirely below 162.5 and half of the class [160, 165).
Show solution
a) The representative value of a class [a, b) is its midpoint \dfrac{a+b}{2}. We have \frac{150+155}{2}=152.5,\quad\frac{155+160}{2}=157.5,\quad\frac{160+165}{2}=162.5,\quad\frac{165+170}{2}=167.5,\quad\frac{170+175}{2}=172.5.
b) The classes [150, 155) and [155, 160) lie entirely below 162.5 cm and contain 4+10=14\ (\text{students}).
The point 162.5 is the midpoint of the class [160, 165). Since the heights in this class are spread evenly, the lower half of the class, that is the part [160, 162.5), contains about \frac{14}{2}=7\ (\text{students}).
Hence the number of students shorter than 162.5 cm is about 14+7=21.
So the representative values are 152.5; 157.5; 162.5; 167.5; 172.5 and about 21 students are shorter than 162.5 cm.
Answer. a) 152.5; 157.5; 162.5; 167.5; 172.5; b) about 21 students.
Take the journey-time table from the lesson ([0, 10): 6; [10, 20): 14; [20, 30): 12; [30, 40): 6; [40, 50): 2). Decide whether each statement is true or false.
a) The class [10, 20) has the greatest frequency.
b) The relative frequency of the class [20, 30) is 12\%.
c) Exactly 20 students take less than 20 minutes.
d) The cumulative frequency of the class [30, 40) is 38.
What you need: relative frequency is \dfrac{m_i}{n}\cdot100\% with n=40; cumulative frequency is a running total.
Steps:
- a) Compare the frequencies.
- b) Find \dfrac{12}{40}.
- c), d) Add up the frequencies as a running total.
Show solution
The sample size is 6+14+12+6+2=40.
a) True. The frequencies are 6, 14, 12, 6, 2; the greatest is 14, which belongs to the class [10, 20).
b) False. The relative frequency of the class [20, 30) is \dfrac{12}{40}\cdot100\%=30\%. The number 12 is the frequency, not the relative frequency.
c) True. The students who take less than 20 minutes belong to the two classes [0, 10) and [10, 20), which contain 6+14=20 students.
d) True. The cumulative frequency of the class [30, 40) is 6+14+12+6=38.
So statements a), c), d) are true; statement b) is false.
Answer. a) True; b) False; c) True; d) True.
A grouped data set of size 50 has cumulative frequencies 5, 17, 38, 46, 50 for five consecutive classes. Find the frequency of the third class.
What you need: the frequency of a class is the difference of two consecutive cumulative frequencies.
Steps:
- The frequency of the third class is the third cumulative frequency minus the second.
Show solution
The cumulative frequency of a class is the sum of the frequency of that class and of the classes before it. Let m_3 be the frequency of the third class; then the cumulative frequency of the third class equals the cumulative frequency of the second class plus m_3.
By the data, the cumulative frequency of the second class is 17 and that of the third class is 38, so m_3=38-17=21.
So the frequency of the third class is 21.
Answer. 21.
Prove that if the classes of a grouped data set all have the same width h, then their representative values form an arithmetic progression with common difference h.
What you need: class i is [a_i, a_i+h) and the next class starts at a_{i+1}=a_i+h; from the lesson on arithmetic progressions, a sequence with constant consecutive differences is an arithmetic progression.
Steps:
- Write the representative values c_i and c_{i+1}.
- Find c_{i+1}-c_i.
Show solution
Suppose all classes have width h and the i-th class is [a_i, a_i+h). The representative value of this class is its midpoint: c_i=\frac{a_i+(a_i+h)}{2}=a_i+\frac h2.
The classes are consecutive, so the next class starts at a_i+h, that is a_{i+1}=a_i+h. Therefore c_{i+1}=a_{i+1}+\frac h2=a_i+h+\frac h2.
It follows that c_{i+1}-c_i=\left(a_i+h+\frac h2\right)-\left(a_i+\frac h2\right)=h.
The difference c_{i+1}-c_i=h is the same for every i.
So the sequence of representative values (c_i) is an arithmetic progression with common difference h.
Answer. The representative values form an arithmetic progression with common difference h.
A grouped frequency table has five classes [0, 10), [10, 20), [20, 30), [30, 40), [40, 50) and some cells are smudged. We know that the class [0, 10) has frequency 4, the class [20, 30) has frequency 18 and relative frequency 36\%, the class [40, 50) has frequency 3, and the cumulative frequency of the class [10, 20) is 14. Find the sample size and the frequencies of the classes [10, 20) and [30, 40).
What you need: f_i=\dfrac{m_i}{n}\cdot100\% lets us find n; the cumulative frequency, and the fact that the frequencies add up to n.
Steps:
- From \dfrac{18}{n}=36\% find n.
- Find the frequency of [10, 20) from the cumulative frequency 14.
- Find the frequency of [30, 40) from the total n.
Show solution
Let n be the sample size and m_1, m_2, m_3, m_4, m_5 the frequencies of the five classes in order. By the data, m_1=4, m_3=18, m_5=3.
The class [20, 30) has frequency 18 and relative frequency 36\%, so \frac{18}{n}=0.36\iff n=\frac{18}{0.36}=50.
The cumulative frequency of the class [10, 20) is the sum of the frequencies of the first two classes, so m_1+m_2=14\iff4+m_2=14\iff m_2=10.
The frequencies add up to the sample size, so m_1+m_2+m_3+m_4+m_5=50. Therefore m_4=50-(4+10+18+3)=50-35=15.
So the sample size is 50, the class [10, 20) has frequency 10 and the class [30, 40) has frequency 15.
Answer. n=50; the class [10, 20) has 10; the class [30, 40) has 15.
Mini test
Marked like the Vietnamese graduation exam: Part I 0.25 points per question; Part II up to 1 point per question (1, 2, 3, 4 correct statements give 0.1, 0.25, 0.5, 1 point); Part III 0.5 points per question.
Part I. Multiple choice
\dfrac{12}{50}\cdot100\%=24\%. Option A treats the frequency as a percentage, and option C is \dfrac{50}{12}.
\dfrac{160+170}{2}=165. Option C is the class width, and option D is the sum of the boundaries without dividing by 2.
4+9+12=25. Option A is the frequency of the third class alone, option C is 4+9, and option D is 9+12.
The classes [0, 10), [10, 20), [20, 30) are consecutive, do not overlap, and cover every value from 3 to 28. Option B overlaps at 10 and 20, option A leaves [10, 15) uncovered, and option D does not contain the values 3 and 28.
Part II. True or false
| a) The relative frequency of the class [0, 5) is 7\%. | ||
| b) 15 passengers wait less than 10 minutes. | ||
| c) The cumulative frequency of the class [10, 15) is 23. | ||
| d) 5 passengers wait at least 15 minutes. |
a) False: \dfrac{7}{25}\cdot100\%=28\%. b) False: 7+10=17 passengers. c) True: 7+10+6=23. d) False: the class [15, 20) has only 2 passengers.
Part III. Short answer
\dfrac{28}{80}\cdot100\%=35\%.
\dfrac{12.5+17.5}{2}=15.
Show answers and explanations
- Part I, question 1: D. \dfrac{12}{50}\cdot100\%=24\%. Option A treats the frequency as a percentage, and option C is \dfrac{50}{12}.
- Part I, question 2: A. \dfrac{160+170}{2}=165. Option C is the class width, and option D is the sum of the boundaries without dividing by 2.
- Part I, question 3: B. 4+9+12=25. Option A is the frequency of the third class alone, option C is 4+9, and option D is 9+12.
- Part I, question 4: C. The classes [0, 10), [10, 20), [20, 30) are consecutive, do not overlap, and cover every value from 3 to 28. Option B overlaps at 10 and 20, option A leaves [10, 15) uncovered, and option D does not contain the values 3 and 28.
- Part II, question 1: a) False; b) False; c) True; d) False. a) False: \dfrac{7}{25}\cdot100\%=28\%. b) False: 7+10=17 passengers. c) True: 7+10+6=23. d) False: the class [15, 20) has only 2 passengers.
- Part III, question 1: 35. \dfrac{28}{80}\cdot100\%=35\%.
- Part III, question 2: 15. \dfrac{12.5+17.5}{2}=15.