Skip to lesson

Math · Probability and Statistics

Chapter 4: Compound and Conditional Probability

Two-Way Tables and Association

Two categorical variables at once.

Lesson
3
Time
About 21 minutes
0 of 12 done

Step 1: Let's Learn

Read it, or press Listen and follow the words.

A two-way table cross-classifies every individual by two categorical variables at once.

Joint frequencies

The inner cells hold joint counts: how many are in one category of each variable simultaneously.

Marginal frequencies

The row and column totals in the margins give each variable on its own, ignoring the other.

Conditional distributions

Dividing a row by its own total gives the distribution of one variable within that group.

Judging association

Compare conditional distributions across rows. If they match, there is no association; if they differ, there is.

Use percentages

Comparing raw counts across groups of different sizes is misleading. Convert to percentages of the row total first.

Counting two variables at once

A two-way table cross-tabulates two categorical variables, with each cell counting individuals in both categories. The margins give the totals for each variable separately.

Percentages need a stated base

A percentage can be of the whole table, of a row, or of a column, and the three answer different questions. "60% have a pet" is ambiguous until you say 60% of whom.

Detecting association

Compare the conditional percentages across rows. If they differ substantially, the variables are associated. If they are nearly equal, the variables behave independently in this sample.

Simpson's paradox

A trend visible in every subgroup can reverse when the groups are combined. It is a real phenomenon with real consequences in medicine and admissions data, and it is why aggregate tables can mislead.

Step 2: Try It Yourself

Tap and try it out.

Two groups with different totals. Compare percentages rather than counts before claiming an association.
Group 1 yes30
Group 1 no20
Group 2 yes6
Group 2 no4

Group 1 yes has the most. It has 26 more than Group 2 no.

Step 3: Watch an Example

One step at a time.

Watch Tomas Compare Two Groups

Group 1 has 30 yes out of 50. Group 2 has 6 yes out of 10.

  1. Step 1

    The raw counts, 30 against 6, make Group 1 look far more enthusiastic.

Step 4: Your Turn

Practice makes it stick.

The Row

Problem 1 of 2

A row has 30 yes and 20 no. What proportion said yes, as a decimal?

The Margin

Problem 2 of 2

Cells hold 12, 8, 5 and 15. What is the grand total?

Read the Table

1 of 8

A row has 15 yes and 5 no. Proportion yes, as a decimal?

2 of 8

Cells 10, 10, 20, 20. Grand total?

3 of 8

Row 1 rate 0.6, row 2 rate 0.6. Is there association? 1 yes, 0 no.

4 of 8

Row 1 rate 0.8, row 2 rate 0.3. Is there association? 1 yes, 0 no.

5 of 8

A row has 9 yes out of 12. Proportion, as a decimal?

6 of 8

Where do marginal frequencies appear? 1 inner cells, 2 row and column totals.

7 of 8

Match each term with where it lives in a two-way table.

Tap a card on the left to start.

8 of 8

A row has 7 yes out of 28. Proportion, as a decimal?

Step 5: Quick Check

Show what you know.

Question 1 of 2

A row has 18 yes out of 24. What proportion said yes, as a decimal?

Question 2 of 2

Why compare percentages rather than counts across groups?

What You Learned

  • A two-way table cross-classifies by two categorical variables.
  • Inner cells are joint counts; margins give each variable alone.
  • Compare conditional distributions, as percentages, to judge association.