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.

20 min read

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 00, because division by 00 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 100%100\%, which equals 11, changes the form but not the value.

relative frequency=countreference total,reference total>0\text{relative frequency} = \dfrac{\text{count}}{\text{reference total}}, \qquad \text{reference total} > 0
The travel table: 140 students by grade (2 categories) and usual way to school (3 categories)
GradeBusCarWalk or bikeTotal
Grade 7
3030
2424
66
6060
Grade 8
3636
1818
2626
8080
Total
6666
4242
3232
140140

Worked example

Example 1: One cell, three shares

In the travel table, 2626 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.

  1. 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.

    row total=80,column total=32,grand total=140\text{row total} = 80, \quad \text{column total} = 32, \quad \text{grand total} = 140
  2. (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.

    2680=1340=0.325=32.5%\frac{26}{80} = \frac{13}{40} = 0.325 = 32.5\%
  3. (b) Column relative frequency: divide the same cell by the walk-or-bike column total. This share is also exact.

    2632=1316=0.8125=81.25%\frac{26}{32} = \frac{13}{16} = 0.8125 = 81.25\%
  4. (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.

    26140=1370=0.185714…≈18.6%\frac{26}{140} = \frac{13}{70} = 0.185714\ldots \approx 18.6\%

Answer

The 2626 students are exactly 32.5%32.5\% of the Grade 8 students, exactly 81.25%81.25\% of the students who walk or bike, and ≈18.6%\approx 18.6\% (rounded) of all 140140 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 120120 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, 7575 have a library card, 6666 read for fun weekly, and 4848 have a card and also read weekly. What share of the students without a library card read for fun weekly?

  1. 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.

  2. 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.

    75−48=2775 - 48 = 27
  3. Finish the reads-yes column the same way. Its two joint cells add to 66, so 18 students read weekly without a card.

    66−48=1866 - 48 = 18
  4. 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.

    120−75=45,45−18=27,27+27=54=120−66120 - 75 = 45, \quad 45 - 18 = 27, \quad 27 + 27 = 54 = 120 - 66
  5. 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.

    1845=25=0.4=40%\frac{18}{45} = \frac{2}{5} = 0.4 = 40\%

Answer

Exactly 40%40\% of the students without a library card (1818 of 4545) 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 (3636 versus 3030), but it also has more students in all (8080 versus 6060), 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 00, 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, 60%60\% and 45%45\% differ by 1515 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 00.

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.

  1. 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.

    Grade 7 total=60,Grade 8 total=80\text{Grade 7 total} = 60, \quad \text{Grade 8 total} = 80
  2. 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%.

    3060=0.5=50%,2460=0.4=40%,660=0.1=10%\frac{30}{60} = 0.5 = 50\%, \quad \frac{24}{60} = 0.4 = 40\%, \quad \frac{6}{60} = 0.1 = 10\%
  3. Find Grade 8's shares the same way. They also add to 100%.

    3680=0.45=45%,1880=0.225=22.5%,2680=0.325=32.5%\frac{36}{80} = 0.45 = 45\%, \quad \frac{18}{80} = 0.225 = 22.5\%, \quad \frac{26}{80} = 0.325 = 32.5\%
  4. 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.

    50−45=5,40−22.5=17.5,32.5−10=22.550 - 45 = 5, \quad 40 - 22.5 = 17.5, \quad 32.5 - 10 = 22.5
  5. 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.

    0.1×80=8versus260.1 \times 80 = 8 \quad \text{versus} \quad 26

Answer

Yes. Comparing all three travel shares, grade and travel mode are associated in these data. Of the Grade 8 students, 32.5%32.5\% walk or bike and 22.5%22.5\% ride in a car; of the Grade 7 students, 10%10\% walk or bike and 40%40\% ride in a car, giving gaps of 22.522.5 and 17.517.5 percentage points.

Partly filled table for Example 4: 150 students by grade and lunch choice
GradePacks lunchBuys lunchTotal
Grade 7
4242
?
7070
Grade 8
?
?
?
Total
8888
?
150150

Worked example

Example 4: Mixed review

The partly filled table above sorts 150150 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.

  1. 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.

    70−42=2870 - 42 = 28
  2. 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.

    150−70=80,88−42=46,80−46=34150 - 70 = 80, \quad 88 - 42 = 46, \quad 80 - 46 = 34
  3. Grade 7's shares use its row total, 70, which is greater than 0, as the reference total.

    4270=0.6=60%,2870=0.4=40%\frac{42}{70} = 0.6 = 60\%, \quad \frac{28}{70} = 0.4 = 40\%
  4. Grade 8's shares use its row total, 80, which is greater than 0.

    4680=0.575=57.5%,3480=0.425=42.5%\frac{46}{80} = 0.575 = 57.5\%, \quad \frac{34}{80} = 0.425 = 42.5\%
  5. 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.

    60−57.5=2.5,42.5−40=2.560 - 57.5 = 2.5, \quad 42.5 - 40 = 2.5
  6. 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.

    0.6×80=48,48−46=20.6 \times 80 = 48, \quad 48 - 46 = 2

Answer

Grade 7: 4242 pack, 2828 buy; Grade 8: 4646 pack, 3434 buy. With exactly two lunch categories, the packing shares differ by only 2.52.5 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 00. 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.