From the free course AP Statistics on Lykke
2.2 Summary Statistics for Two Categorical Variables
Key concepts: Two-way table — counts cross-classified by two categorical variables · Joint relative frequency — one cell divided by the grand total · Marginal relative frequency — row or column total over the grand total · Conditional relative frequency — a cell over its own row total · Association — conditional distributions that differ across groups · Segmented bar comparison — reading association from equal-height bars
A raw count of 80 students passing an exam tells us very little about the effectiveness of a study method until we know the context of the entire group.
A raw count of 80 students passing an exam tells us very little about the effectiveness of a study method until we know the context of the entire group. To move from simple counting to statistical reasoning, we must transform counts into relative frequencies—proportions that allow us to compare groups of different sizes and identify associations between variables.
The Three Frequencies of Association
When analyzing two categorical variables, we use three distinct types of summary statistics to describe the distribution: joint, marginal, and conditional relative frequencies. Each answers a different question by changing the "base" or denominator of our calculation.
Joint Relative Frequency (LO 2.2.A, EK 2.2.A.1): The proportion of the total number of observations that fall into a specific category for both variables.
Marginal Relative Frequency (LO 2.2.A, EK 2.2.A.2): The proportion of the total number of observations that fall into a specific category for one of the variables, regardless of the other variable.
Conditional Relative Frequency (LO 2.2.A, EK 2.2.A.3): The proportion of a specific category of one variable given that an observation falls into a specific category of the other variable.
Worked Problem: The Study Habit Study
Consider a study of 200 students investigating the relationship between their primary Study Location (Library or Home) and their Exam Result (Pass or Fail). This scenario allows us to practice calculating and interpreting these statistics (Skill 3.B, 4.A).
The Data (Two-Way Table)
| Pass | Fail | Total | |
|---|---|---|---|
| Library | 80 | 20 | 100 |
| Home | 60 | 40 | 100 |
| Total | 140 | 60 | 200 |
1. Calculating Joint Relative Frequency (Skill 3.B)
Question: What proportion of all students studied in the library and passed?
- Calculation: $\frac{\text{Cell Count}}{\text{Grand Total}} = \frac{80}{200} = 0.40$
- Interpretation (Skill 4.A): 40% of the students in this study both used the library and passed the exam.
2. Calculating Marginal Relative Frequency (Skill 3.B)
Question: What proportion of all students passed the exam?
- Calculation: $\frac{\text{Column Total}}{\text{Grand Total}} = \frac{140}{200} = 0.70$
- Interpretation (Skill 4.A): Overall, 70% of the students in the study passed the exam, regardless of where they studied.
3. Calculating Conditional Relative Frequency (Skill 3.B)
Question: Of the students who studied in the library, what proportion passed?
- Calculation: $\frac{\text{Cell Count}}{\text{Row Total}} = \frac{80}{100} = 0.80$
- Interpretation (Skill 4.A): Among students who studied in the library, 80% passed the exam.
Interpreting Results: Identifying Association (Skill 4.B)
The ultimate goal of these summary statistics is to determine if an association exists between the two variables. Two categorical variables are associated if the conditional relative frequencies of one variable change depending on the category of the other variable.
In our study habit example, we compare the conditional passing rates:
- Pass rate given Library: 80%
- Pass rate given Home: $\frac{60}{100} = 60%$
Because the proportion of students who passed is different for those who studied in the library (0.80) compared to those who studied at home (0.60), we conclude that there is an association between study location and exam result (Skill 4.B). If these proportions were equal, we would say the variables are independent.
Misconception Clinic: The Denominator Trap
A common error is confusing the direction of a conditional relative frequency. The phrase "the proportion of passers who studied in the library" is not the same as "the proportion of library-studiers who passed."
- Proportion of passers in the library: Denominator is the total number of passers (140). Result: $80/140 \approx 0.57$.
- Proportion of library-studiers who passed: Denominator is the total number of library-studiers (100). Result: $80/100 = 0.80$.
Always identify the group being described first (the "given" condition) to set your denominator correctly.
Interpretation Check
Using the table above, calculate the conditional relative frequency of students who failed, given that they studied at home.
- A. $40/200 = 0.20$
- B. $40/60 = 0.67$
- C. $40/100 = 0.40$
- D. $60/200 = 0.30$
Correct Answer: C. The condition is "studied at home," so the denominator is the row total for Home (100). The numerator is the count of those who failed in that row (40).
