Two-Way Tables — How to Organize and Interpret Data
Grade: 7-8 | Topic: Statistics
What You Will Learn
A two-way table lets you see how two categorical variables interact — for example, sport preference broken down by gender. In this guide you will learn to read existing tables, complete missing cells, convert counts to relative frequencies, and answer probability questions from table data.
Theory
Structure of a two-way table
A two-way frequency table has:
- Rows for one categorical variable (e.g., Gender: Boy / Girl)
- Columns for another categorical variable (e.g., Sport: Soccer / Basketball / Tennis)
- Cells showing how many people fall into each combination
- Marginal totals in the last row and last column
Example structure:
| Soccer | Basketball | Tennis | Total | |
|---|---|---|---|---|
| Boy | 30 | 18 | 12 | 60 |
| Girl | 20 | 25 | 15 | 60 |
| Total | 50 | 43 | 27 | 120 |
Types of frequency
Joint frequency: the count in one cell — how many people fit both categories. E.g., 30 boys prefer soccer.
Marginal frequency: the total for a row or column. E.g., 60 boys total, 50 students prefer soccer.
Relative frequency: a count expressed as a fraction or percentage of the grand total.
Conditional relative frequency: a cell count expressed as a fraction of its row or column total.
Reading the table
To find the number of girls who prefer basketball, locate the Girl row and Basketball column: 25.
To find the total who prefer tennis: look at the Tennis column total: 27.
Worked Examples
Example 1 — Completing a two-way table
A survey of 80 students asked whether they prefer cats or dogs, split by grade 7 and grade 8.
| Cats | Dogs | Total | |
|---|---|---|---|
| Grade 7 | 18 | 22 | 40 |
| Grade 8 | ? | 25 | 40 |
| Total | ? | ? | 80 |
Step 1: Grade 8 cats = 40 - 25 = 15.
Step 2: Total cats = 18 + 15 = 33.
Step 3: Total dogs = 22 + 25 = 47.
Check: 33 + 47 = 80 ✓.
Example 2 — Relative frequency
Using the completed table above, what fraction of all students prefer cats?
Example 3 — Conditional relative frequency
What proportion of grade 7 students prefer dogs?
This is a conditional relative frequency because the condition is "given the student is in grade 7."
Example 4 — Comparing groups
Is there a difference in cat preference between grades?
- Grade 7: prefer cats.
- Grade 8: prefer cats.
Grade 7 students prefer cats at a higher rate. A two-way table makes this comparison visible.
Common Mistakes
Mistake 1 — Adding marginal totals incorrectly
❌ Adding all the row totals and column totals to find the grand total, counting each number twice.
✅ The grand total equals the sum of all row totals (or all column totals) — not both. The grand total appears only once, in the bottom-right corner.
Mistake 2 — Confusing joint and conditional frequency
❌ "30 boys prefer soccer" means 30 out of all boys prefer soccer.
✅ The joint frequency is 30 (out of the grand total 120). The conditional frequency of soccer given boy is of boys.
Mistake 3 — Dividing by the wrong total for conditional frequency
❌ Finding the probability that a soccer fan is a boy: dividing 30 by 120 (grand total).
✅ Divide by the soccer column total: of soccer fans are boys.
Practice Problems
Problem 1: Complete the table.
| Morning | Evening | Total | |
|---|---|---|---|
| Monday | 15 | 20 | ? |
| Tuesday | 12 | ? | 30 |
| Total | ? | ? | ? |
Show Answer
Monday total = 35; Tuesday evening = 18; Total morning = 27; Total evening = 38; Grand total = 65.
Problem 2: Using the sports table from the Theory section, what percentage of all students prefer basketball?
Show Answer
Problem 3: In the sports table, what proportion of girls prefer soccer?
Show Answer
Problem 4: A student is chosen at random. What is the probability they are a boy who prefers tennis?
Show Answer
Problem 5: Do boys or girls show a stronger preference for basketball?
Show Answer
Boys: . Girls: .
Girls show a stronger preference for basketball.
Summary
- A two-way table organises counts for two categorical variables — rows for one, columns for the other.
- Joint frequency: a single cell count. Marginal frequency: a row or column total.
- Relative frequency: divide any count by the grand total.
- Conditional relative frequency: divide a cell count by its row or column total, depending on the condition.
- Two-way tables make it easy to compare groups and identify patterns in categorical data.
Related Topics
- Probability Basics — use table frequencies to calculate experimental probability
- Data Collection and Analysis — how to organise raw data before building a table
- Statistics Basics — broader overview of data analysis methods
Need help with two-way tables? Take a photo of your math problem and MathPal will solve it step by step. Open MathPal