Welcome to the World of Two Categorical Variables!

In Unit 1, you learned how to handle one variable at a time (like just "height" or just "favorite color"). But the real magic of statistics happens when we look at how two different things relate to each other! In this chapter, we’ll explore how to organize and visualize the relationship between two categorical variables (categories like "Yes/No," "Freshman/Senior," or "Red/Blue/Green").

By the end of these notes, you'll be able to read complex tables like a pro and understand the visual stories told by bar charts and mosaic displays.

1. The Two-Way Table (Contingency Table)

A two-way table is a grid used to summarize data for two categorical variables. One variable is assigned to the rows, and the other is assigned to the columns.

Example: Imagine we ask 100 students if they play a sport and if they have a part-time job.

- Row Variable: Plays a Sport (Yes/No)
- Column Variable: Has a Job (Yes/No)

Quick Review: The numbers inside the grid (where the rows and columns meet) are called counts or frequencies. The totals at the ends of the rows and columns are called marginal totals.

2. Summary Statistics: Relative Frequencies

Counts are great, but proportions (or percentages) usually tell a better story. In AP Statistics, we look at three specific types of relative frequencies. Don't worry if these sound similar; the key is all in the denominator (the bottom number of your fraction).

A. Joint Relative Frequency

This tells us what proportion of the entire group falls into a specific category for both variables.
Formula: \( \text{Joint Relative Frequency} = \frac{\text{Cell Count}}{\text{Table Total}} \)

Example: If 20 out of 100 students play a sport AND have a job, the joint relative frequency is \( \frac{20}{100} = 0.20 \).

B. Marginal Relative Frequency

This tells us the proportion of the entire group that falls into one category of one variable, ignoring the other variable. These are found in the "margins" (the totals).
Formula: \( \text{Marginal Relative Frequency} = \frac{\text{Row or Column Total}}{\text{Table Total}} \)

Example: If 60 out of 100 students play a sport (regardless of whether they have a job), the marginal relative frequency for playing a sport is \( \frac{60}{100} = 0.60 \).

C. Conditional Relative Frequency

This is the most important one! It tells us the proportion of one group that falls into a specific category. We "condition" our focus on just one row or one column.
Formula: \( \text{Conditional Relative Frequency} = \frac{\text{Cell Count}}{\text{Row or Column Total}} \)

Example: Of the students who have a job (let's say there are 40), how many play a sport (say 20)? The conditional relative frequency is \( \frac{20}{40} = 0.50 \).

Key Takeaway:

To identify which frequency you need, ask: "Out of whom?"
- Out of everyone? It's Joint or Marginal.
- Out of a specific group? It's Conditional.

3. Graphical Representations

Once we have our frequencies, we need to see them! There are two main ways the AP Exam will show this data.

Segmented Bar Charts

In a segmented bar chart, each category of the explanatory variable is represented by a bar. Each bar is scaled to \( 100\% \). The bar is then "segmented" into parts that represent the conditional relative frequencies of the other variable.

Analogy: Think of it like a stack of different colored blocks. Every stack is the same height (\( 100\% \)), but the amount of each color in the stack changes depending on the group.

Mosaic Displays

A mosaic display is very similar to a segmented bar chart, but with one major twist: the width of the bars matters!

- Height: Shows the conditional relative frequencies (just like the segmented bar chart).
- Width: Shows the marginal relative frequencies of the groups.

Did you know? If one group has twice as many people as the other, its bar in a mosaic display will be twice as wide!

4. Association and Independence

The whole point of using these tables and charts is to see if there is an association between the two variables.

What is an Association?
There is an association if knowing the value of one variable helps us predict the value of the other. In other words, if the conditional relative frequencies are different for different groups, there is an association.

What is Independence?
Two variables are independent if the conditional relative frequencies are the same for all groups. (You will dive deeper into the math of independence in Section 2.7!).

How to spot it on a graph:
- Association: The segments in the bars look different (the "lines" don't match up across bars).
- No Association (Independence): The segments in the bars look identical across all groups.

Common Mistake to Avoid:

Don't confuse counts with proportions. A group might have a higher count of something just because that group is much larger overall. Always check the relative frequencies (percentages) before claiming there is an association!

Chapter Summary

- Two-way tables organize data for two categorical variables.
- Joint frequencies use the table total; Marginal frequencies use row/column totals over the table total.
- Conditional frequencies are the key to finding associations; they focus on one group at a time.
- Segmented bar charts compare proportions across groups using bars of equal width.
- Mosaic displays compare proportions using bars where the width represents the relative size of the group.
- Association exists if the conditional relative frequencies change depending on which group you look at.