SECTION 1
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
1900 • Karl Pearson's Contribution
1950s • Two-Way Tables in Schools
Today • Data Everywhere
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!
SECTION 2
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!
Categorical Variable
Two-Way Table
Frequency
Relative Frequency
Association
KEY TAKEAWAY
SECTION 3
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.
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.
SECTION 4
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)
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
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
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?
SECTION 5
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.
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
SECTION 6
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 Table
Set 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 Totals
Add 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 Frequencies
For 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 Interpret
About 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
SECTION 7
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.
| Feature | Frequency (Counts) | Relative Frequency (Percents) |
|---|---|---|
| What it shows | How many data points fall in each cell | What fraction or percent of a group falls in each cell |
| Best for | Seeing the overall size of groups and totals | Comparing groups fairly, especially when row or column totals differ |
| Limitation | Hard to compare when groups are different sizes | Loses information about how many total people are in each group |
| Example | 30 curfew students have chores | 75% of curfew students have chores |
Comparing frequency and relative frequency approaches
KEY TAKEAWAY
SECTION 8
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.
| What You Know Now | What Comes Next |
|---|---|
| Build two-way tables with counts | Use larger data sets with more than two categories per variable |
| Calculate row/column relative frequencies | Compute expected frequencies to compare against observed data |
| Eyeball differences in percentages to judge association | Use the chi-squared test to mathematically determine if an association is statistically significant |
| Work with categorical (yes/no) data | Analyze both categorical and numerical data using scatter plots, correlation, and regression |
How two-way tables connect to future statistics topics
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!
SECTION 9
Practice Problems
Try these five problems. They start easy and get harder. Use the methods you've learned in this lesson!
Question 1: CONCEPTUAL
Show answer
Question 2: BASIC CALCULATION
Show answer
Question 3: INTERMEDIATE
Show answer
Question 4: APPLIED
Show answer
Question 5: CRITICAL THINKING
Show answer
SUMMARY
Lesson Summary
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!