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.
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!
Categorical Variable
Two-Way Table
Frequency
Relative Frequency
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.
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.
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!
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.
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 |
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 |
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!
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!