8TH GRADE MATH • STATISTICS AND PROBABILITY

Construct and Interpret Two-Way Tables

Learn how to organize and compare categorical data to discover hidden patterns between two groups.

Where Did Two-Way Tables Come From?

People have always wanted to understand how things are connected. For example, does eating breakfast help students do better on tests? Do people who exercise also sleep more? To answer questions like these, we need a way to organize data about two different categories at the same time.

For hundreds of years, mathematicians and scientists have been building tools to sort and display information. The two-way table (also called a contingency table) is one of the most useful tools they invented. It lets you look at two categories side by side and spot patterns you might miss otherwise.

1700s
Early Data Tables
Governments began collecting census data and organizing it into tables to understand their populations. Simple tables sorted people into categories like age and occupation.
1900
Karl Pearson's Contribution
Statistician Karl Pearson developed the chi-squared test, a math tool for checking whether two categories in a table are truly connected or just appear that way by chance.
1950s
Two-Way Tables in Schools
Educators realized that two-way tables are a powerful way to teach students about data and relationships. They became a standard part of math and science classes.
Today
Data Everywhere
Two-way tables are used in medicine, sports, marketing, and everyday life. Any time you compare two yes/no (or multi-category) questions about the same group, a two-way table helps you see the big picture.

The big question a two-way table helps you answer is: Is there a connection (association) between two categorical variables? For instance, do students who have a curfew also tend to have chores? Let's find out how to build and read these tables!

Core Ideas and Definitions

Before we build a two-way table, you need to know a few key vocabulary words. Don't worry — they're simpler than they sound!

1

Categorical Variable

A categorical variable is a variable that puts data into groups (categories), not numbers. Examples: favorite color, yes/no answers, type of pet.
2

Two-Way Table

A two-way table displays data about two categorical variables at once. One variable labels the rows; the other labels the columns.
3

Frequency

A frequency is simply a count — how many data points fall into a certain group. For example, 12 students have both a curfew and chores.
4

Relative Frequency

A relative frequency is a frequency written as a fraction, decimal, or percent of a total. It helps you compare groups of different sizes fairly.
5

Association

An association means the two variables seem connected. If knowing one category helps you predict the other, there may be an association.
KEY TAKEAWAY
Think of a two-way table like a seating chart for a school dance. One side of the chart might sort students by grade (7th or 8th). The other side sorts them by whether they prefer pizza or tacos. Each box in the chart counts how many students fit both descriptions. When you look at the whole chart, you can quickly see if 8th graders tend to pick tacos more than 7th graders do — that would be an association!

Seeing a Two-Way Table in Action

Let's look at a real example. Imagine you surveyed 80 students and asked two yes-or-no questions: "Do you have a curfew on school nights?" and "Do you have assigned chores at home?" The diagram below shows how this data fits into a two-way table.

This two-way table organizes 80 students by two categorical variables: curfew status (rows) and chores status (columns). The inner numbers are joint frequencies. The row and column totals are called marginal frequencies.

Notice how the table has rows for one variable (curfew) and columns for the other variable (chores). The numbers inside the table — 30, 10, 15, and 25 — are called joint frequencies. They tell you how many students fall into both categories at the same time. The totals along the edges are called marginal frequencies because they sit on the margins (edges) of the table.

The Math Behind Relative Frequencies

Raw counts are helpful, but they can be tricky to compare when groups have different sizes. That's where relative frequencies come in. A relative frequency turns a count into a fraction or percent of some total.

RELATIVE FREQUENCY (OVERALL)
Relative Frequency = Joint Frequency ÷ Grand Total
Joint Frequency = the count in one cell of the table. Grand Total = the total number of subjects (all students). Example: 30 ÷ 80 = 0.375 = 37.5%.
ROW RELATIVE FREQUENCY
Row Relative Frequency = Joint Frequency ÷ Row Total
This tells you what fraction of one row falls into a certain column. Example: Of the 40 students with a curfew, 30 have chores → 30 ÷ 40 = 0.75 = 75%.
COLUMN RELATIVE FREQUENCY
Column Relative Frequency = Joint Frequency ÷ Column Total
This tells you what fraction of one column falls into a certain row. Example: Of the 45 students who have chores, 30 also have a curfew → 30 ÷ 45 ≈ 0.667 ≈ 66.7%.
💡 Which Total Do I Use?
It depends on your question! If you want to know "Of students with a curfew, what percent have chores?" — divide by the row total. If you want to know "Of students with chores, what percent have a curfew?" — divide by the column total. If you want to know "What percent of ALL students have both?" — divide by the grand total.

Spotting an Association Between Variables

The whole point of a two-way table is to look for an association — a pattern that connects the two variables. The best way to check is by comparing row relative frequencies (or column relative frequencies) across the rows. If the percentages are very different, that's evidence of an association. If they're similar, the variables might not be connected.

The stacked bars compare the chores percentages for students with a curfew versus without. Since 75% is much higher than 37.5%, there is evidence of an association between having a curfew and having chores.

Here's the key idea: if having a curfew had nothing to do with having chores, then the percentage of students with chores should be about the same in both rows. In our data, 75% of curfew students have chores, but only 37.5% of no-curfew students do. That's a big gap!

🔎 HOW TO SPOT AN ASSOCIATION
Compare row (or column) relative frequencies across the table. If they are very different, there is likely an association. If they are about the same, the two variables probably aren't connected. Think of it like comparing batting averages for two baseball teams — if the averages are close, the teams are similar; if one is way higher, something is different about that team.

Worked Example: Pet Owners and Sports Players

A teacher surveyed 60 students and asked: "Do you own a pet?" and "Do you play a sport?" Here are the results: 20 students own a pet and play a sport, 10 own a pet but don't play a sport, 15 don't own a pet but play a sport, and 15 don't own a pet and don't play a sport. Let's construct a two-way table, find relative frequencies, and check for an association.

Building and Interpreting a Two-Way Table
1
Step 1 — Organize the Data into a TableSet up the table with rows for pet ownership (Owns Pet / No Pet) and columns for sport participation (Plays Sport / No Sport). Fill in the four joint frequencies: 20, 10, 15, and 15.
Owns Pet & Plays Sport = 20, Owns Pet & No Sport = 10, No Pet & Plays Sport = 15, No Pet & No Sport = 15
2
Step 2 — Calculate Row Totals and Column TotalsAdd across each row: Owns Pet total = 20 + 10 = 30. No Pet total = 15 + 15 = 30. Add down each column: Plays Sport total = 20 + 15 = 35. No Sport total = 10 + 15 = 25. Grand total = 60.
Row totals: 30, 30. Column totals: 35, 25. Grand total: 60.
3
Step 3 — Find Row Relative FrequenciesFor the Owns Pet row: 20 ÷ 30 ≈ 0.667 (about 66.7% play a sport) and 10 ÷ 30 ≈ 0.333 (about 33.3% don't). For the No Pet row: 15 ÷ 30 = 0.500 (50% play a sport) and 15 ÷ 30 = 0.500 (50% don't).
Owns Pet → 66.7% play a sport. No Pet → 50% play a sport.
4
Step 4 — Compare and InterpretAbout 66.7% of pet owners play a sport, compared to 50% of non-pet-owners. There is a moderate difference (16.7 percentage points). This suggests there may be a mild association between owning a pet and playing a sport, but the gap is not huge.
There is some evidence of association — pet owners play sports at a somewhat higher rate than non-pet-owners.
⚠️ Remember
An association does NOT mean one thing causes the other. Owning a pet doesn't cause someone to play a sport. It just means there's a pattern in the data.

Frequency vs. Relative Frequency: When to Use Each

You might wonder: why not just compare the raw counts? The table below shows why relative frequencies are so important — especially when groups have different sizes.

Comparing frequency and relative frequency approaches
FeatureFrequency (Counts)Relative Frequency (Percents)
What it showsHow many data points fall in each cellWhat fraction or percent of a group falls in each cell
Best forSeeing the overall size of groups and totalsComparing groups fairly, especially when row or column totals differ
LimitationHard to compare when groups are different sizesLoses information about how many total people are in each group
Example30 curfew students have chores75% of curfew students have chores
KEY TAKEAWAY
Think of it like comparing test scores between two classes. If Class A has 25 students and Class B has 10 students, saying "Class A had 15 students pass" doesn't tell you much. But saying "60% of Class A passed vs. 80% of Class B" — now you can compare fairly! Relative frequencies level the playing field.

From Two-Way Tables to Advanced Statistics

Two-way tables are your first step into a much bigger world of statistics. As you move into high school and beyond, you'll learn more powerful ways to test whether an association is real or just a coincidence.

How two-way tables connect to future statistics topics
What You Know NowWhat Comes Next
Build two-way tables with countsUse larger data sets with more than two categories per variable
Calculate row/column relative frequenciesCompute expected frequencies to compare against observed data
Eyeball differences in percentages to judge associationUse the chi-squared test to mathematically determine if an association is statistically significant
Work with categorical (yes/no) dataAnalyze both categorical and numerical data using scatter plots, correlation, and regression

For now, the skills you're building — organizing data, calculating percents, and comparing groups — are the foundation for all of that future work. Every professional statistician started right where you are!

Practice Problems

Try these five problems. They start easy and get harder. Use the methods you've learned in this lesson!

PROBLEM 1CONCEPTUAL
What is the difference between a frequency and a relative frequency in a two-way table? Give a simple example.
PROBLEM 2BASIC CALCULATION
In a two-way table, 18 out of 50 students who ride the bus also pack a lunch. What is the row relative frequency for "rides the bus and packs a lunch"?
PROBLEM 3INTERMEDIATE
A survey of 100 students gives this data: 28 have a phone and eat school lunch, 12 have a phone and bring lunch, 24 don't have a phone and eat school lunch, and 36 don't have a phone and bring lunch. Build the two-way table with all totals. Then find the row relative frequencies for the "Has Phone" row.
PROBLEM 4APPLIED
Using the data from Problem 3, is there evidence of an association between having a phone and lunch choice? Compare the row relative frequencies for both rows and explain your reasoning.
PROBLEM 5CRITICAL THINKING
A two-way table shows that 60% of students who play video games also read for fun, and 58% of students who don't play video games also read for fun. A classmate says, "There's no association between video games and reading." Do you agree? Explain what the relative frequencies tell you and what might change your conclusion.

Lesson Summary

A two-way table organizes data about two categorical variables collected from the same group of people. One variable labels the rows; the other labels the columns. The numbers inside the table are joint frequencies (counts for both categories at once), and the totals along the edges are marginal frequencies.

To look for an association between the two variables, calculate row relative frequencies (or column relative frequencies) by dividing each joint frequency by its row total (or column total). Then compare the percentages across rows. If the percentages are very different, there is evidence of an association. If they are about the same, the variables are probably not connected. Always remember: association does not mean causation!

Varsity Tutors • 8th Grade Math • Construct and Interpret Two-Way Tables