Two-Way
Tables
Learn to construct and interpret two-way tables that reveal hidden patterns between categorical variables.
What Is a Two-Way Table?
A two-way table (also called a contingency table) organizes data about two categorical variables collected from the same group of subjects. Rows represent one variable, columns represent the other, and each cell shows the count (frequency) of subjects in that combination.
Anatomy of a Two-Way Table
Why Two-Way Tables Matter
Two-way tables appear everywhere: medical studies (treatment vs. outcome), surveys (opinion vs. age group), and school research (study habit vs. grade). They answer a simple but powerful question:
Key Vocabulary
Three Types of Relative Frequency
Frequency vs. Relative Frequency
| Frequency | Relative Frequency | |
|---|---|---|
| What it shows | Raw count | Proportion or % |
| Example value | 24 students | 0.40 or 40% |
| Best for | Seeing totals | Comparing groups |
| Reveals association? | Hard to tell | Yes: compare across rows/columns |
How to Construct a Two-Way Table
Example 1: Curfew and Chores
A teacher surveyed 60 students about whether they have a curfew on school nights and whether they have assigned chores at home. Here are the results:
| Has Chores | No Chores | Total | |
|---|---|---|---|
| Has Curfew | 28 | 7 | 35 |
| No Curfew | 12 | 13 | 25 |
| Total | 40 | 20 | 60 |
Row Relative Frequencies
Divide each cell by its row total to see what percentage of each group (Curfew vs. No Curfew) has chores:
| Has Chores | No Chores | |
|---|---|---|
| Has Curfew | \(\frac{28}{35} = \) 80% | \(\frac{7}{35} = \) 20% |
| No Curfew | \(\frac{12}{25} = \) 48% | \(\frac{13}{25} = \) 52% |
Example 2: Sport and Grade Level
A school collected data on 100 students about their preferred sport and grade level:
| Basketball | Soccer | Other | Total | |
|---|---|---|---|---|
| 7th Grade | 15 | 20 | 10 | 45 |
| 8th Grade | 25 | 15 | 15 | 55 |
| Total | 40 | 35 | 25 | 100 |
Example 3: Column Relative Frequencies
Using the same sport data, compute column relative frequencies to answer: "Of all basketball players, what fraction are 8th graders?"
| Basketball | Soccer | Other | |
|---|---|---|---|
| 7th Grade | \(\frac{15}{40} =\) 37.5% | \(\frac{20}{35} \approx\) 57% | \(\frac{10}{25} =\) 40% |
| 8th Grade | \(\frac{25}{40} =\) 62.5% | \(\frac{15}{35} \approx\) 43% | \(\frac{15}{25} =\) 60% |
Interpreting Association
Visualizing Association
Compare the row relative frequencies from Example 1 side-by-side:
Common Mistakes
Summary Comparison
| Concept | Definition | When to Use |
|---|---|---|
| Joint Frequency | Count in one cell | Reporting exact numbers |
| Marginal Frequency | Row or column total | Finding group sizes |
| Row Relative Freq. | \(\frac{\text{cell}}{\text{row total}}\) | Comparing columns within each row |
| Column Relative Freq. | \(\frac{\text{cell}}{\text{col total}}\) | Comparing rows within each column |
| Overall Relative Freq. | \(\frac{\text{cell}}{\text{grand total}}\) | Seeing each cell's share of total |
Question 1 of 5
A survey of 80 students asked whether they prefer cats or dogs and whether they play a sport:
Cats + Sport: 18 | Cats + No Sport: 22
Dogs + Sport: 30 | Dogs + No Sport: 10
What is the row relative frequency of "Dogs + Sport" (relative to all dog lovers)?
Question 2 of 5
In a two-way table, what does a marginal frequency represent?
Question 3 of 5
A two-way table shows data about homework completion (Yes/No) and test result (Pass/Fail) for 50 students:
Homework Yes + Pass: 30 | Homework Yes + Fail: 5
Homework No + Pass: 6 | Homework No + Fail: 9
What fraction of students who did not complete homework passed the test?
Question 4 of 5
Two groups have the following row relative frequencies for "Likes Reading": Group A = 70%, Group B = 68%. What can you conclude?
Question 5 of 5
A researcher finds an association between eating breakfast and test scores in a two-way table. Students who eat breakfast have higher test scores on average.
Which statement is the best interpretation of this finding?