Statistics & Probability · Grades 8, 9
Two-Way Tables: Finding Patterns in Categorical Data
Quick answer
A two-way table sorts data by two categories at once, with the totals along the edges. Raw counts alone rarely answer the question, because unequal group sizes distort the comparison. Converting each row to percentages of its own total puts the groups on equal footing, and a difference that survives that is evidence of a real association.
What you'll learn
- Build and read a two-way frequency table
- Calculate relative frequencies by row or column
- Decide whether two categorical variables are associated
- Name and compute joint, marginal and conditional relative frequencies
Sorting by two categories at once
A two-way frequency table counts how many fall into each combination of two categories.
Students asked whether they play a sport and whether they play an instrument:
| Instrument | No instrument | Total | |
|---|---|---|---|
| Sport | |||
| No sport | |||
| Total |
Each inner cell is one combination. The edges hold the marginal totals, and the corner holds the grand total.
Two checks worth running before anything else:
- each row’s cells add to its row total: ✓
- the row totals and column totals both add to ✓
If either fails, the table is wrong and nothing computed from it will be right.
Reading a cell
Every inner cell answers a “both” question.
| Question | Cell | Answer |
|---|---|---|
| Play sport and instrument? | top left | |
| Play sport, no instrument? | top right | |
| Play neither? | bottom right | |
| Play sport at all? | row total |
Why raw counts mislead
Do sporty students play instruments less often?
Comparing the two “instrument” counts directly: against . It looks like sporty students play instruments less.
But the two groups are not the same size — against — so the counts are not comparable. Convert each row to percentages of its own total:
| Instrument | No instrument | |
|---|---|---|
| Sport | ||
| No sport |
Now the comparison is fair, and the gap is larger than the raw counts suggested: against .
Dividing each row by its own total is what puts unequal groups on equal footing. It is the same reasoning as a unit rate: reduce both to a common basis, then compare.
Deciding whether there is an association
Two categories are associated when knowing one changes what you would expect of the other.
The test is whether the row percentages differ:
- Similar rows — no association. Knowing whether a student plays sport tells you nothing about the instrument.
- Different rows — association. Here against is a substantial gap, so the two are associated.
Compare against a table with no association:
| Instrument | No instrument | |
|---|---|---|
| Sport | ||
| No sport |
Near-identical rows mean the categories are close to independent.
Row or column percentages
Which you compute depends on the question.
| Question | Divide by |
|---|---|
| Of sporty students, how many play an instrument? | the row total |
| Of instrument players, how many play sport? | the column total |
These give different numbers and answer different questions:
Same cell, two denominators. Read the question to see which group is being asked about, and divide by that group’s total.
The three kinds of relative frequency
Every relative frequency in a two-way table is one count divided by another. Which two counts decides its name.
| Kind | Divide | Answers |
|---|---|---|
| joint | a cell by the grand total | what share of everyone is in both groups |
| marginal | a row or column total by the grand total | what share of everyone is in one group |
| conditional | a cell by its row or column total | within one group, what share is in the other |
Using the sport and instrument table, with students in all:
The denominator names the kind. Divide by the grand total and you get a joint or marginal frequency. Divide by a row or column total and you get a conditional one.
Dividing every cell by the grand total gives a whole table of joint relative frequencies, with the marginal ones along its edges:
| Instrument | No instrument | Total | |
|---|---|---|---|
| Sport | |||
| No sport | |||
| Total |
The whole table adds to , which is the same check as before in a new unit.
Association is judged with conditional frequencies. Joint frequencies mix up two things at once — how common a combination is and how big each group is — so comparing them repeats the raw-count problem from earlier.
Why association is not cause
A table can show two categories occurring together more often than chance would suggest. It cannot show that one produces the other.
Sport and instrument playing are associated here, and nothing in the table says which way round — or whether some third thing, such as how much free time a student has, drives both.
That limit is not a flaw in the method. It is what the method measures: a two-way table records how often things co-occur, and co-occurrence is not causation.
Worked examples
Common mistakes
Practice problems
Use this table for questions 1 to 6.
| Bus | Walk | Total | |
|---|---|---|---|
| Grade 7 | |||
| Grade 8 | |||
| Total |
-
How many Grade 7 students walk?
Answer
Full solution
The cell where the Grade 7 row meets the Walk column.
-
How many students take the bus in total?
Answer
Full solution
The Bus column total.
-
How many students are there altogether?
Answer
Full solution
The grand total in the corner, which matches and .
-
What percentage of Grade 7 take the bus?
Answer
Full solution
, using the Grade 7 row total.
-
What percentage of Grade 8 take the bus?
Answer
Full solution
.
-
Is grade level associated with how students travel?
Answer
Yes
Full solution
against is a large gap, so knowing the grade level changes what you would expect.
-
A row total is and one cell is . Find the other cell.
Answer
Full solution
.
-
Of the bus users above, what percentage are in Grade 8?
Hint
Which total does the question name?
Answer
About
Full solution
The question is about bus users, so divide by the column total: .
-
Two rows give and for the same category. Is there an association?
Answer
No meaningful one
Full solution
The rows differ by two points, so knowing which group a member is in barely changes the expectation.
-
Two groups of and both have members choosing an option. Sam says the option is equally popular in both. Assess his claim.
Hint
What fraction of each group is that?
Answer
No. It is of the first group and of the second.
Full solution
The counts match, and the groups do not.
against .
So the option is five times as popular in the smaller group. Equal counts across unequal groups is exactly the situation relative frequencies exist to handle — and comparing raw counts here reverses the true picture rather than merely blurring it.
-
A survey of students finds in Grade 8, of whom walk to school. Find the joint relative frequency of “Grade 8 and walks”, and the conditional relative frequency of walking among Grade 8 students.
Hint
The two answers use different denominators.
Answer
Joint ; conditional
Full solution
A joint relative frequency divides the cell by the grand total: of all students are in Grade 8 and walk.
A conditional relative frequency divides the same cell by its own group’s total: of Grade 8 students walk.
Same cell, two denominators, two different questions answered.
Frequently asked questions
What is a two-way table?
A table sorting data by two categories at once, with row and column totals along the edges.
What is a relative frequency?
A count expressed as a fraction or percentage of a total, which lets groups of different sizes be compared fairly.
Should I use row or column percentages?
Whichever matches the question. To compare groups defined by the rows, convert each row to percentages of its own row total.
What does association mean here?
That knowing one category changes what you would expect of the other. If the row percentages differ noticeably, the two are associated.
Does association prove one thing causes the other?
No. A two-way table can show that two categories occur together more often than chance would suggest, and that alone never establishes cause.
Standards alignment
This lesson covers the following Common Core State Standards for Mathematics.
- CCSS.MATH.CONTENT.8.SP.A.4Statistics and ProbabilityUnderstand that patterns of association can also be seen in bivariate categorical data by displaying frequencies and relative frequencies in a two-way table. Construct and interpret a two-way table summarizing data on two categorical variables collected from the same subjects. Use relative frequencies calculated for rows or columns to describe possible association between the two variables.
- CCSS.MATH.CONTENT.HSS.ID.B.5Interpreting Categorical and Quantitative DataSummarize categorical data for two categories in two-way frequency tables. Interpret relative frequencies in the context of the data (including joint, marginal, and conditional relative frequencies). Recognize possible associations and trends in the data.