Two-Way Tables

A two-way table shows data about two categories at once, like grade level and homework choice. Each row is one group, and each column is another. The cells inside show how many fit both. You can use the table to find percents and to see if the two categories are related.

Before this lesson: You should know percentages, converting fractions and decimals and ratios.

What Is a Two-Way Table?

A school asked 200 students one question: do you like online homework or paper homework? It also noted each student’s grade. A two-way table sorts all 200 answers by grade and by choice.

A two-way table of 200 students by grade and homework choice. 9th grade: 45 online, 55 paper, total 100. 12th grade: 70 online, 30 paper, total 100. Column totals: 115 online, 85 paper. Grand total: 200. The four inner cells are shaded blue and labeled joint frequencies. The row and column totals are shaded orange and labeled marginal frequencies. The grand total of 200 is shaded gray.
The inside cells are joint frequencies. The totals are marginal frequencies. All 200 students are the grand total.

Data like this, sorted into groups, is called categorical data. A count in a cell is called a frequency.

  • A joint frequency is a count inside the table. It fits one row and one column. For example, 45 ninth graders like online homework.
  • A marginal frequency is a row or column total. For example, 115 students in all like online homework.
  • The grand total is everyone in the survey: 200.

Relative Frequencies

A relative frequency is a count divided by a total. It turns counts into a decimal or percent. There are three kinds.

KindWhat you divide byExample
Joint relative frequencyThe grand total\frac{45}{200} = 0.225
Marginal relative frequencyThe grand total\frac{115}{200} = 0.575
Conditional relative frequencyA row or column total\frac{45}{100} = 0.45

A conditional relative frequency looks at just one group. For example, 45 of the 100 ninth graders like online homework. That is 45% of ninth graders.

Steps for reading a two-way table

  1. Find the row and column that match the question.
  2. Decide what the whole group is. Is it everyone, or just one row or column?
  3. Divide the count by that group’s total.
  4. Write the answer as a decimal or a percent.

Worked Examples

Example 1: Fill in a two-way table

80 students said whether they like cats or dogs better. Fill in the missing numbers.

CatDogTotal
Boys12?40
Girls?22?
Total30?80

Each row and column must add up to its total.

  • Boys who like dogs: 40 − 12 = 28.
  • Girls who like cats: 30 − 12 = 18.
  • Girls total: 18 + 22 = 40.
  • Dog total: 28 + 22 = 50. Check: 30 + 50 = 80.

Example 2: Joint and marginal relative frequencies

Use the homework table above. Divide each count by the grand total, 200.

OnlinePaperTotal
9th grade0.2250.2750.5
12th grade0.350.150.5
Total0.5750.4251

So 22.5% of all students are ninth graders who like online homework. And 57.5% of all students like online homework.

Example 3: Conditional relative frequencies by row

What percent of each grade likes online homework?

Divide by the row total. For ninth graders, \frac{45}{100} = 0.45, or 45%. For twelfth graders, \frac{70}{100} = 0.70, or 70%.

Example 4: Is there an association?

Two categories have an association if the percents are very different from group to group. Here, 45% of ninth graders like online homework, but 70% of twelfth graders do.

Those are far apart, so there is an association between grade and homework choice. Twelfth graders are more likely to choose online homework.

Example 5: Conditional relative frequency by column

Of the students who like paper homework, what percent are ninth graders?

Now the whole group is the Paper column, with 85 students. So \frac{55}{85} \approx 0.647, or about 64.7%.

Common Mistakes

MistakeExample of the errorFix
Dividing by the wrong total“What percent of 9th graders like online?” \frac{45}{200}The group is 9th graders, so use their total: \frac{45}{100} = 45\%.
Mixing up row and column percentsSaying 55 out of 85 means 55% of 9th graders like paper\frac{55}{85} is the percent of paper fans who are 9th graders. Of 9th graders, \frac{55}{100} = 55\% like paper.
Comparing counts, not percentsGroups of 90 and 60 people, so comparing 40 to 45Change each count to a percent of its own group first.
Totals that don’t add upRow totals of 40 and 40, but a grand total of 90Each row, each column and the grand total must add up.
Thinking association means cause“Being in 12th grade makes students like online homework.”An association only shows a link. It doesn’t prove one thing causes the other.

Practice Problems

Problems 1 to 8 use this table. A theater asked 150 people if they bought popcorn.

PopcornNo popcornTotal
Adults405090
Kids451560
Total8565150
  1. How many kids bought popcorn?
  2. How many people in all bought popcorn?
  3. What is the joint relative frequency of adults who bought popcorn?
  4. What is the marginal relative frequency of kids?
  5. What percent of adults bought popcorn?
  6. What percent of kids bought popcorn?
  7. Is there an association between age group and buying popcorn? Explain.
  8. Of the people who bought popcorn, what percent were kids?
  9. Fill in the table. Juniors: 30 said Yes, 50 in all. Seniors: 20 said No. In all, 70 said Yes, and 110 people were asked.
  10. In Group A, 30 said Yes and 20 said No. In Group B, 60 said Yes and 40 said No. Is there an association?
Show answers
  1. 45 kids.
  2. 85 people. This is the marginal frequency for the Popcorn column.
  3. \frac{40}{150} \approx 0.267, or about 26.7%.
  4. \frac{60}{150} = 0.4, or 40%.
  5. \frac{40}{90} \approx 0.444, or about 44.4%.
  6. \frac{45}{60} = 0.75, or 75%.
  7. Yes. 75% of kids bought popcorn, but only about 44.4% of adults did. The percents are far apart.
  8. \frac{45}{85} \approx 0.529, or about 52.9%.
  9. Juniors, No: 50 − 30 = 20. Seniors, Yes: 70 − 30 = 40. Seniors total: 40 + 20 = 60. No total: 20 + 20 = 40.
  10. No. In Group A, \frac{30}{50} = 60\% said Yes. In Group B, \frac{60}{100} = 60\% said Yes. The percents are the same.

FAQ

What is a two-way table?

It is a table that sorts data by two categories at once. Rows show one category and columns show the other.

What is the difference between joint and marginal frequency?

A joint frequency is a count inside the table, for one row and one column. A marginal frequency is a total, found in the last row or column.

How do you find a conditional relative frequency?

Divide a count by its row total or its column total, not the grand total. It answers questions like “What percent of this group…?” It is closely tied to probability.

How can you tell if there is an association in a two-way table?

Find the conditional percents for each group. If they are very different, there is an association. If they are about the same, there isn’t.

Summary

  • A two-way table sorts categorical data by two categories.
  • Joint frequencies are inside cells. Marginal frequencies are totals.
  • A relative frequency is a count divided by a total.
  • For conditional relative frequencies, divide by a row or column total.
  • Very different percents between groups show an association, not a cause.

Previous lesson: Linear, Quadratic and Exponential Models

Next lesson: Scatter Plots and Correlation

Back to the Algebra 1 Index