Categorical Data: Two-Way Tables and Simpson's Paradox
Compute joint, marginal, and conditional distributions from two-way tables. Use conditional distributions to identify associations between categorical variables. Explore Simpson's Paradox: an association can reverse when a confounding variable is considered.
A lesson of AP Statistics, in Exploring Two-Variable Data, about 10 minutes.
Two-Way Tables and Categorical Associations
By the end of this lesson, you will be able to construct and interpret two-way frequency tables, calculate joint, marginal, and conditional distributions, and determine whether two categorical variables are associated.
Two-Way (Contingency) Tables
A two-way table displays the relationship between two categorical variables. Rows represent one variable; columns represent the other.
Example: 200 students surveyed on preferred learning style and gender:
| Visual | Auditory | Kinesthetic | Total | |
|---|---|---|---|---|
| Female | 48 | 30 | 22 | 100 |
| Male | 35 | 40 | 25 | 100 |
| Total | 83 | 70 | 47 | 200 |
Types of Frequencies
Joint frequency: count in a specific cell (e.g., 48 female visual learners)
Marginal frequency: a row or column total (e.g., 100 females total; 83 visual learners total)
Conditional distribution: distribution of one variable given a specific value of the other
Marginal Distribution
The distribution of a single variable, ignoring the other. Read from the totals row or column.
Marginal distribution of learning style:
- Visual: 83/200 = 41.5%
- Auditory: 70/200 = 35%
- Kinesthetic: 47/200 = 23.5%
Conditional Distribution
The distribution of one variable for a specific group defined by the other variable. Divide each cell by the row (or column) total.
Conditional distribution of learning style | Female:
- Visual: 48/100 = 48%
- Auditory: 30/100 = 30%
- Kinesthetic: 22/100 = 22%
Conditional distribution of learning style | Male: