This course has been archived. The College Board updated AP Statistics for the 2026–27 school year, and the units and topics changed.
Go to the new AP® Statistics
5m left·0%
Reading Time: 5 min
Last Updated: February 5, 2026
Main Ideas: 3
Reading Time: 5 min
Last Updated: February 5, 2026
Main Ideas: 3

Topic 2.2 Notes – Representing Two Categorical Variables

Read aloud
Two-way tables and their graphs help you understand how two categorical variables relate to each other. Instead of looking at one variable at a time, you’re asking how combinations of categories are distributed. This is where you start seeing association, which sets up later inference with chi-square tests.

Two-Way Tables and Joint Relative Frequencies

When each individual in your data set is classified by two categorical variables, you organize the information in a two-way table (also called a contingency table).

  • Rows = categories of one variable
  • Columns = categories of the other variable
  • Cells = number of individuals in that combination

Here is a sample two-way table for 200 students classified by grade level and whether they play sports:

Two-way table of grade level and sports participation

From a table like this, you can identify:

  • Joint frequencies = the counts inside the table (ex: 50 ninth graders who play sports).
  • Marginal totals = row and column totals (ex: 80 ninth graders total).
  • Grand total = total number of individuals (200 here).

Relative Frequencies

Raw counts depend on sample size. Proportions are usually more meaningful.

  • Joint relative frequency
    cell countgrand total \frac{\text{cell count}}{\text{grand total}}

    Using the table above, 50200=0.25 \frac{50}{200} = 0.25 .
    So 25% of all students are ninth graders who play sports.

All joint relative frequencies together add to 1.00.

  • Marginal relative frequency
    row or column totalgrand total \frac{\text{row or column total}}{\text{grand total}}

If a table is entirely in joint relative frequencies, the bottom-right total is 1.

Conditional Relative Frequencies

This is where the AP questions usually live.

A conditional relative frequency compares categories within a group.

  • Row conditional → divide each cell by its row total.
  • Column conditional → divide each cell by its column total.

Using the ninth-grade row in the table above:
5080=0.625 \frac{50}{80} = 0.625 .

So 62.5% of ninth graders play sports.

Notice what changed. We are no longer dividing by 200. We’re dividing by 80 because we’re restricting attention to ninth graders.

When you’re asked to compare distributions, you almost always use conditional relative frequencies, not counts.

Graphs for Two Categorical Variables

All the graphs below use the same example about grade level and whether students play sports. Each one is a visual version of conditional distributions.

Side-by-Side Bar Graphs

Side-by-side bar graph of conditional percentages

Each grade level has separate bars for “Yes” and “No.”

You compare the heights of corresponding bars across grades.
Great for spotting differences in proportions quickly.

Segmented Bar Graphs

Segmented bar graph with each group totaling 100%

Each bar represents 100% of that grade level.
Segments show the conditional proportions within that grade.

Now you’re comparing how each 100% bar is divided up.

Mosaic Plots

Mosaic plot showing marginal and conditional distributions

A mosaic plot combines everything:

  • Width = marginal distribution of one variable
  • Height within each section = conditional distribution
  • Area of each rectangle = joint relative frequency

Think of it as a picture version of the two-way table.

Determining Whether Variables Are Associated

Two categorical variables are associated if knowing one helps predict the other.

They are independent if the conditional distributions are the same across groups.

Here’s how you decide:

  1. Choose which variable defines the groups.
  2. Compare the conditional proportions across those groups.
  3. Look for meaningful differences.

In the sports example, 62.5% of ninth graders play sports compared to 58.3% of tenth graders. Those percentages are close, so there may not be much association.

On a free-response question, you must:

  • Mention both variables
  • Compare conditional percentages
  • Conclude in context

Example:
“There is little evidence of an association between grade level and playing sports because the percent who play sports is similar for ninth and tenth graders.”

Never say one variable causes the other unless it was a randomized experiment designed to show causation.

Key Takeaways

A joint relative frequency is cellgrand total \frac{\text{cell}}{\text{grand total}} ; a conditional relative frequency divides by a row or column total.
Always compare proportions, not raw counts, when group sizes differ.
Association means conditional distributions differ across groups.
Mosaic plot area represents joint relative frequency.
Your conclusion must name both variables and be written in context.

AP® is a trademark registered by the College Board, which is not affiliated with, and does not endorse this website.

Notes

1 credit used · 5/5 remaining