What is a two-way table in math?
A two-way table shows counts for two categorical variables collected from the same group, with one variable in the rows and the other in the columns. Each inside cell is a joint frequency, and the totals in the margins are marginal frequencies. Dividing a cell by a row or column total gives relative frequencies that reveal associations.
Two-Way Table in a picture
Formal definition and notation
A two-way (contingency) table cross-classifies n observations by two categorical variables with r and c categories. Cell (i, j) holds the joint frequency nij; row and column totals are marginal frequencies, and their sums equal n. Joint, marginal and conditional relative frequencies are nijn, nin and nijni.
| Symbol | Read it as | Meaning |
|---|---|---|
| joint frequency | joint frequency | a count inside the table: both categories at once |
| marginal frequency | marginal frequency | a row or column total, in the margin of the table |
| 3050 | 30 out of 50 | a conditional (row) relative frequency: 30 of the 50 grade 7 students |
Key facts
- Joint frequencies are found inside the table cells; totals appear in the margins.
- Every row must add to its row total and every column to its column total, which lets you fill in missing cells.
- To look for an association, compare row (or column) percentages, not raw counts, because the groups can be different sizes.
- If the percentages are about the same for every group, the two variables show no association.
- A two-way table counts categories (grade, yes/no, color). For two numerical variables, use a scatter plot.
Relative frequencies
- joint
- inside cell divided by the grand total: 30/110 of all students are grade 7 sport players
- marginal
- row or column total divided by the grand total: 50/110 of students are in grade 7
- conditional
- inside cell divided by its row or column total: 30/50 of grade 7 students play
The word of tells you the denominator. Percent of grade 7 students means divide by the grade 7 total; percent of all students means divide by the grand total.
Two-Way Table examples, step by step
Example 1: Fill in a missing cell
In a survey, 30 boys chose a favorite pet: 12 chose cats and the rest chose dogs. How many boys chose dogs, and where does that number go in a two-way table of gender and pet?
- The row for boys must add to its total: 12 + dogs = 30.
- Subtract: 30 − 12 = 18.
- 18 is a joint frequency, so it goes in the inside cell where the boys row meets the dogs column.
Answer: 18 boys chose dogs; it goes in the boys–dogs cell.
Example 2: A conditional relative frequency
Of 60 sixth graders, 18 walk to school and 42 ride the bus. Of 60 seventh graders, 27 walk and 33 ride the bus. What percent of seventh graders walk?
- The question is about seventh graders, so the denominator is the seventh-grade total, 60.
- Fraction: 2760.
- Convert: 27 ÷ 60 = 0.45 = 45%.
Answer: 45% of seventh graders walk to school.
Example 3: Is there an association?
In a class survey, 50 students sleep 8 or more hours and 35 of them passed a quiz. Of 40 students who sleep less, 20 passed. Is there evidence of an association between sleep and passing?
- Compare rates, not counts. Pass rate with 8+ hours: 3550 = 70%.
- Pass rate with less sleep: 2040 = 50%.
- 70% is much higher than 50%, so the two variables appear associated in this group.
- A survey like this shows association only; it does not prove that more sleep causes passing.
Answer: Yes: 70% of the 8+ hour group passed versus 50% of the others, so the data suggest an association.
Common mistakes
Don’t use a row or column total when you need a joint frequency. Use the inside cell, which counts students in both categories.
Of grade 7 students means the grade 7 row total is the denominator. 30/110 answers a different question: the share of all students who are grade 7 players.
The groups are different sizes (60 and 50). Raw counts can mislead whenever the totals differ.
Not to be confused with
A frequency table counts one variable (for example, favorite color). A two-way table counts two variables at once, so each cell is a combination such as grade 7 and plays a sport.
A scatter plot shows two numerical variables as points. A two-way table shows two categorical variables as counts.
Quick check: 3 questions
In a table of 100 people, 14 are seniors who prefer movies. The seniors row total is 40, and the movies column total is 32. What is the joint frequency of seniors who prefer movies?
Answer: A. The joint frequency is the inside cell where seniors meets movies: 14. Choices B and C are marginal totals, and D is the grand total.Show answer and explanation
Using the same table, what percent of seniors prefer movies?
Answer: B. Of seniors means divide by the seniors total: 1440 = 35%. Choice A divides by the grand total, C divides by the movies total (that is the percent of movie fans who are seniors), and D is the seniors share of everyone.Show answer and explanation
Using the same table, what percent of all 100 people are seniors who prefer movies?
Answer: C. Of all people means divide by the grand total: 14100 = 14%. This is a joint relative frequency. Choices A and B use a row or column total, and D is the share who prefer movies.Show answer and explanation
Two-Way Table: frequently asked questions
What is the difference between joint, marginal and conditional frequency?
A joint frequency is an inside cell: people in both categories, such as grade 7 and plays a sport. A marginal frequency is a row or column total, such as all grade 7 students. A conditional relative frequency divides a cell by its own row or column total, such as 30 of the 50 grade 7 students, or 60%.
How do you tell if there is an association in a two-way table?
Compute the percentages within each row (or each column) and compare them. If 60% of grade 7 and 75% of grade 8 play a sport, the rates differ, so grade and playing a sport appear associated. If the rates were about equal, there would be no evidence of association.
Why is a two-way table also called a contingency table?
Statistics books often say contingency table. The table shows how the counts for one variable depend on, or are contingent on, the category of the other variable. Two-way table, contingency table and two-way frequency table all name the same kind of display.
Practice and tools
Sources
- Common Core State Standards, Grade 8 Statistics and Probability (8.SP.A.4)
- Common Core State Standards, High School Interpreting Categorical and Quantitative Data (HSS-ID.B.5)
- OpenStax, Introductory Statistics 2e, 3.4 Contingency Tables
Updated November 2026·Reviewed by the Effortless Math team·Standards: CCSS 8.SP.A.4, CCSS HSS-ID.B.5
Cite this entry
Effortless Math Team. “Two-Way Table.” Effortless Math Dictionary. Updated November 2026. https://www.effortlessmath.com/math-dictionary/two-way-table/
Flashcard
Browse all terms in the Math Dictionary · More statistics terms · Random term