Math Core

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 100100 eighth graders with those two questions. Every student falls into exactly one of four groups.

Plays a sportNo sportTotal
Plays an instrument182240
No instrument421860
Total6040100
  • Each inside cell counts students in both categories. For example, 1818 students play an instrument and a sport.
  • The Total column adds across each row: 18+22=4018 + 22 = 40 students play an instrument.
  • The Total row adds down each column: 18+42=6018 + 42 = 60 students play a sport.
  • The bottom-right corner is the grand total: 100100 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 8080 students.

Has a petNo petTotal
Walks to school12?30
Rides to school???
Total44?80

Fill in the table.

Solution. Work one row or column at a time.

  • Walks, no pet: 30−12=1830 - 12 = 18.
  • Rides, has a pet: 44−12=3244 - 12 = 32.
  • Total with no pet: 80−44=3680 - 44 = 36.
  • Rides, no pet: 36−18=1836 - 18 = 18.
  • Total who ride: 32+18=5032 + 18 = 50. Check: 30+50=8030 + 50 = 80. ✓
Has a petNo petTotal
Walks to school121830
Rides to school321850
Total443680

Relative frequencies

Raw counts can be misleading when the groups are different sizes. In the survey, 1818 instrument players play a sport and 4242 non-players do. But there are more non-players to begin with, so comparing 1818 with 4242 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.

relative frequency=count in the cellrow total\text{relative frequency} = \frac{\text{count in the cell}}{\text{row total}}

Each row of relative frequencies adds to 11, or 100%100\%.

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 sportNo sportTotal
Plays an instrument1840=45%\dfrac{18}{40} = 45\%2240=55%\dfrac{22}{40} = 55\%100%100\%
No instrument4260=70%\dfrac{42}{60} = 70\%1860=30%\dfrac{18}{60} = 30\%100%100\%

Only 45%45\% of instrument players also play a sport, but 70%70\% 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 6060:

1860=0.3=30%\frac{18}{60} = 0.3 = 30\%

So 30%30\% 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: 1840=45%\dfrac{18}{40} = 45\%. "Of the athletes, what percent play an instrument?" uses the column total: 1860=30%\dfrac{18}{60} = 30\%. 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 150150 students.

Likes rapLikes countryTotal
7th grade452570
8th grade602080
Total10545150
Practice 1

How many 8th graders prefer country music?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

What percent of the 8th graders prefer rap?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

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.

Practice 4

Based on your answers to the last two problems, which statement is best supported?

Practice 5

A club of 4040 students includes 2222 girls. Of all 4040 members, 2525 prefer meeting after school and the rest prefer lunchtime. 1111 of the boys prefer after school. How many girls prefer after school?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

In a survey of 200200 adults, 120120 drink coffee. Of the coffee drinkers, 4848 also drink tea. What percent of the coffee drinkers drink tea?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

A survey asks 9090 students whether they eat breakfast and whether they feel tired in first period.

TiredNot tiredTotal
Eats breakfast124860
Skips breakfast62430
Total187290

Is there an association between eating breakfast and feeling tired?