Two-Way Frequency Tables
Construct and interpret two-way frequency tables for categorical data. Calculate joint, marginal, and conditional frequencies. Use tables to determine whether an association exists between two categorical variables.
A lesson of Algebra 1, in Data Analysis & Statistics, about 30 minutes.
By the end of this lesson, you will be able to read a two-way table, tell joint from marginal from conditional frequencies, compute each one correctly, and decide whether two categorical variables are associated.
Two Categories at Once
A two-way table counts how many individuals fall into each combination of two categorical variables.
| Plays sport | No sport | Total | |
|---|---|---|---|
| Has a job | $18$ | $32$ | $50$ |
| No job | $42$ | $8$ | $50$ |
| Total | $60$ | $40$ | $100$ |
Each inner cell is a count of people who are BOTH things. The $18$ means eighteen students both have a job and play a sport.
The margins are the row and column totals, and they say how many are in each category overall, ignoring the other variable. $60$ students play a sport, and $50$ have a job.
The grand total appears in the corner, and every row and every column must add to its margin. Checking that first catches a mis-copied table before any analysis depends on it.
Three Kinds of Frequency
The difference between these is entirely what you divide by, and that is where nearly all the errors live.
Joint frequency: a single inner cell, over the GRAND total.
$$\frac{18}{100} = 18% \quad \text{have a job AND play a sport}$$
Marginal frequency: a row or column total, over the grand total.
$$\frac{60}{100} = 60% \quad \text{play a sport, overall}$$
Conditional frequency: a cell over its own ROW or COLUMN total.
$$\frac{18}{50} = 36% \quad \text{of those with a job, play a sport}$$
$$\frac{18}{60} = 30% \quad \text{of those who play a sport, have a job}$$
Those last two are different numbers from the same cell, because the condition changed which total is the denominator. Reading the words carefully is the whole skill: "of those who…" tells you what to divide by.
Sort It: What Do You Divide By
Use the table above.
Example 1: Reading the Table
Here is every step, worked all the way through, using the table above.
- How many students are in the study altogether? 100
- How many play a sport? 60