Lesson 9.3 · Bivariate Data
Two-way tables
Not all paired data is made of numbers. You might ask each student two yes-or-no questions, like "Do you play an instrument?" and "Do you play a sport?" You can't make a scatter plot of yes and no answers, but a two-way table organizes them so you can look for an association.
Reading a two-way table
A school surveyed eighth graders with those two questions. Every student falls into exactly one of four groups.
| Plays a sport | No sport | Total | |
|---|---|---|---|
| Plays an instrument | 18 | 22 | 40 |
| No instrument | 42 | 18 | 60 |
| Total | 60 | 40 | 100 |
- Each inside cell counts students in both categories. For example, students play an instrument and a sport.
- The Total column adds across each row: students play an instrument.
- The Total row adds down each column: students play a sport.
- The bottom-right corner is the grand total: students.
Definition
Two-way table
A table that shows data about two categorical variables at once. One variable's categories label the rows and the other's label the columns. Each cell shows a frequency: how many individuals fall into that row and that column.
Filling in missing values
Because the rows and columns must add up, you can often find missing numbers.
Worked example: Completing a table
Some entries are missing from this table about students.
| Has a pet | No pet | Total | |
|---|---|---|---|
| Walks to school | 12 | ? | 30 |
| Rides to school | ? | ? | ? |
| Total | 44 | ? | 80 |
Fill in the table.
Solution. Work one row or column at a time.
- Walks, no pet: .
- Rides, has a pet: .
- Total with no pet: .
- Rides, no pet: .
- Total who ride: . Check: . ✓
| Has a pet | No pet | Total | |
|---|---|---|---|
| Walks to school | 12 | 18 | 30 |
| Rides to school | 32 | 18 | 50 |
| Total | 44 | 36 | 80 |
Relative frequencies
Raw counts can be misleading when the groups are different sizes. In the survey, instrument players play a sport and non-players do. But there are more non-players to begin with, so comparing with isn't fair.
Instead, compare relative frequencies: each count divided by its row total (or column total). This turns counts into fractions or percents of the group.
Row relative frequency
To compare the rows, divide each cell by its row's total.
Each row of relative frequencies adds to , or .
Worked example: Looking for an association
Use the instrument-and-sport survey. Is there an association between playing an instrument and playing a sport?
Solution. Divide each cell by its row total.
| Plays a sport | No sport | Total | |
|---|---|---|---|
| Plays an instrument | |||
| No instrument |
Only of instrument players also play a sport, but of the other students do. The percents are quite different, so there is an association: in this school, students who don't play an instrument are more likely to play a sport.
If the percents in the two rows were about the same, there would be no association. Knowing whether a student plays an instrument wouldn't help you guess whether they play a sport.
Worked example: Column relative frequencies
You can also divide by column totals. Of the students who play a sport, what percent play an instrument?
Solution. Use the "Plays a sport" column, whose total is :
So of the athletes play an instrument.
Common mistake
Read the question carefully to know which total to divide by. "Of the instrument players, what percent play a sport?" uses the row total: . "Of the athletes, what percent play an instrument?" uses the column total: . Same cell, different answer. The group named after "of the" gives the denominator.
Tip
Before answering, check your table: every row should add to its row total, every column to its column total, and both the Total row and the Total column should add to the grand total.
Practice
Problems 1 to 4 use this table from a survey of students.
| Likes rap | Likes country | Total | |
|---|---|---|---|
| 7th grade | 45 | 25 | 70 |
| 8th grade | 60 | 20 | 80 |
| Total | 105 | 45 | 150 |
How many 8th graders prefer country music?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
What percent of the 8th graders prefer rap?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
What percent of the 7th graders prefer rap? Round to the nearest tenth of a percent.
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Based on your answers to the last two problems, which statement is best supported?
A club of students includes girls. Of all members, prefer meeting after school and the rest prefer lunchtime. of the boys prefer after school. How many girls prefer after school?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
In a survey of adults, drink coffee. Of the coffee drinkers, also drink tea. What percent of the coffee drinkers drink tea?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A survey asks students whether they eat breakfast and whether they feel tired in first period.
| Tired | Not tired | Total | |
|---|---|---|---|
| Eats breakfast | 12 | 48 | 60 |
| Skips breakfast | 6 | 24 | 30 |
| Total | 18 | 72 | 90 |
Is there an association between eating breakfast and feeling tired?