Chapter 14 · Statistics and data analysis
Relative Frequencies, Word Problems and Association
Turn the counts in a two-way table into row, column and grand-total shares, solve word problems, and use shares to tell whether two categorical variables are associated.
You already know how to build a two-way frequency table. In this lesson you will turn its counts into shares, use those shares in word problems, and use them to decide whether two variables are connected.
Here are the words you will need. A categorical variable sorts each subject (each person or thing counted) into one category, such as a grade or a way of getting to school. A two-way frequency table sorts the subjects by two categorical variables at once. A joint cell counts the subjects in one row category and one column category, so it belongs to two categories. A margin, which is a row total or a column total, belongs to one category. The grand total counts every subject.
A relative frequency is a share: a count divided by the total it is part of. That total is the reference total, and it must be greater than , because division by is undefined. One joint cell can give three different shares, depending on the reference total:
- A row relative frequency divides by the cell's row total. It is the cell's share of that row.
- A column relative frequency divides by the cell's column total. It is the cell's share of that column.
- A relative frequency of the grand total divides by the grand total. It is the cell's share of all the subjects.
Read the question to find the whole: “of the Grade 8 students” points to the Grade 8 row total. You can write a share as a fraction, a decimal or a percent. Multiplying by , which equals , changes the form but not the value.
| Grade | Bus | Car | Walk or bike | Total |
|---|---|---|---|---|
Grade 7 | ||||
Grade 8 | ||||
Total |
Worked example
Example 1: One cell, three shares
In the travel table, students are in Grade 8 and walk or bike. Find the share these students make up (a) of the Grade 8 students, (b) of the students who walk or bike, and (c) of all the students surveyed.
Find the reference totals. The cell sits in the Grade 8 row and the walk-or-bike column, so its row total is 80, its column total is 32, and the grand total is 140. All three are greater than 0, so each division is defined.
(a) Row relative frequency: divide the cell by the Grade 8 row total. Dividing the top and bottom by the same nonzero number, 2, keeps the value, and multiplying by 100%, which equals 1, turns the decimal into a percent. This share is exact.
(b) Column relative frequency: divide the same cell by the walk-or-bike column total. This share is also exact.
(c) Relative frequency of the grand total: divide by 140, then divide the top and bottom by 2. The decimal repeats forever, so round to the nearest tenth of a percent and write the approximately-equal sign.
Answer
The students are exactly of the Grade 8 students, exactly of the students who walk or bike, and (rounded) of all students.
In a word problem, the facts arrive as sentences, so build or complete the table before you compute any share. Sort each fact first. A count that names two categories, such as “have a card and read weekly,” is a joint cell. A count that names one category, such as “have a card,” is a margin.
Every subject is counted in exactly one joint cell. So the joint cells in a row add to that row's total, the joint cells in a column add to that column's total, and the row totals, like the column totals, add to the grand total. That is why, when only one cell in a row or column is missing, subtracting the known cells from the total gives it.
The table has only one possible completion when the text gives enough independent facts: facts that cannot be worked out from one another. A table with 2 row categories and 2 column categories has 4 joint cells, so it needs four independent facts.
Worked example
Example 2: Build the table first
A club surveyed students on two yes-or-no variables: whether they have a library card, and whether they read for fun at least once a week. Of them, have a library card, read for fun weekly, and have a card and also read weekly. What share of the students without a library card read for fun weekly?
Set up rows for card (yes, no) and columns for reads weekly (yes, no). Sort the facts: 120 is the grand total; 75 names one category, so it is the card-yes row total; 66 is the reads-yes column total; 48 names two categories, so it is a joint cell. None of these four facts can be worked out from the others, so they fix all 4 joint cells.
Finish the card-yes row. Each student is in exactly one joint cell, so the row's two joint cells add to its total, 75. Subtracting the known cell shows that 27 students have a card but do not read weekly.
Finish the reads-yes column the same way. Its two joint cells add to 66, so 18 students read weekly without a card.
The row totals add to the grand total, which gives the card-no row total; subtract to find that row's last joint cell. Then check the reads-no column: its two cells should add to 120 minus 66.
Now compute the share. “Of the students without a library card” names the card-no row total, 45, as the reference total, and it is greater than 0. Dividing the top and bottom by 9 keeps the value.
Answer
Exactly of the students without a library card ( of ) read for fun at least once a week.
Shares also let you compare groups of different sizes fairly. In the travel table, Grade 8 has more bus riders than Grade 7 ( versus ), but it also has more students in all ( versus ), so the counts alone cannot tell you which grade has the larger share of bus riders. Dividing each count by its own group's total, which is greater than , puts the groups on equal footing.
Comparing shares shows whether two variables are connected in a set of data: they are connected when knowing which group a subject is in tells you something about its category for the other variable. To measure how much a share changes from one group to another, subtract one percent from the other. The result is in percentage points. For example, and differ by percentage points.
Key concept
When two categorical variables are associated
Two categorical variables are associated in a set of data when the shares (relative frequencies) of one variable's categories differ from one group of the other variable to another, even if only some shares differ. Each group's shares use that group's total as the reference total, which must be greater than .
To conclude no association, compare the share of every category across the groups: all must match. Only when the variable whose shares you compare has exactly two categories does one matching category guarantee that the other matches too.
Describe how large the gaps are in the context of the data; a very small gap is only weak evidence of an association. An association describes the data; it does not show that one variable causes the other.
Worked example
Example 3: Grade and travel mode
Use the travel table. In these data, are grade and usual travel mode associated? Describe how large any differences in shares are.
You are comparing the two grades, so use row relative frequencies: divide each cell by its own grade's row total. Both totals are greater than 0.
Find Grade 7's shares. Each Grade 7 student is in exactly one joint cell of the row, so these exact shares add to 100%.
Find Grade 8's shares the same way. They also add to 100%.
Travel mode has three categories, so compare all three shares; with more than two categories, one share alone cannot settle the question. Subtract to find each gap in percentage points.
Describe the gaps in context. The bus shares are fairly close, but the car and walk-or-bike shares are far apart. If Grade 8 matched Grade 7's 10%, only 8 of its 80 students would walk or bike; in fact 26 do. So the data show a clear association. They describe these students only; they do not show that being in Grade 8 causes walking or biking.
Answer
Yes. Comparing all three travel shares, grade and travel mode are associated in these data. Of the Grade 8 students, walk or bike and ride in a car; of the Grade 7 students, walk or bike and ride in a car, giving gaps of and percentage points.
| Grade | Packs lunch | Buys lunch | Total |
|---|---|---|---|
Grade 7 | ? | ||
Grade 8 | ? | ? | ? |
Total | ? |
Worked example
Example 4: Mixed review
The partly filled table above sorts students by grade (Grade 7 or Grade 8) and lunch choice (packs or buys); each student made exactly one choice. Complete the table, find each grade's shares, and decide whether grade and lunch choice are associated in these data.
The four given numbers, 42, 70, 88 and 150, cannot be worked out from one another, so the table has exactly one completion. Grade 7's joint cells add to its row total, 70.
The row totals add to 150, the packs column adds to 88, and Grade 8's joint cells add to its row total. Check the buys column: 28 + 34 = 62, and 150 - 88 = 62.
Grade 7's shares use its row total, 70, which is greater than 0, as the reference total.
Grade 8's shares use its row total, 80, which is greater than 0.
Lunch choice has exactly two categories, so each grade's two shares add to 100%, and the gap in packing equals the gap in buying. Here the shares do not match.
Judge the size in context. If Grade 8 matched Grade 7's 60%, 48 of its 80 students would pack lunch; 46 do, just 2 fewer. The shares differ, so you cannot conclude no association, but a gap this small is only weak evidence of one. The data describe these students and say nothing about causes.
Answer
Grade 7: pack, buy; Grade 8: pack, buy. With exactly two lunch categories, the packing shares differ by only percentage points, and so do the buying shares. The data give only weak evidence of an association between grade and lunch choice.
The big idea: a share means something only when you know its whole. A relative frequency divides a count by a named reference total (a row total, a column total or the grand total) that is greater than . Compare groups by their shares, not their counts. Two categorical variables are associated in the data when at least one category's share differs from group to group. To conclude no association, the share of every category must match; one matching share is enough only when the variable has exactly two categories. Say how big the gaps are in context, and remember that an association does not show that one variable causes the other.