Instructional videos are coming to Albert.Join the waitlist
AP® Statistics
Practice

AP® Statistics Review: Representing Two Categorical Variables

✎ Study Mode — Highlight text and annotate as you read.

When you have two categorical variables, a simple bar chart isn’t enough. You need to see how one variable’s distribution changes across groups of the other. Two-way tables, bar graphs, and mosaic plots are the tools for this job. This article covers AP® Statistics Topic 2.1 (UNC-1.P): organizing two categorical variables, calculating the three types of relative frequency, and choosing the right display to reveal relationships in your data.

Two-Way Tables: Your Foundation

A two-way table (also called a contingency table) displays counts for every combination of two categorical variables. Suppose you surveyed 200 students about their favorite lunch option (pizza, salad, sandwich) and their grade level (junior or senior):

A two-way table and segmented bar chart compare conditional distributions.
A two-way table and segmented bar chart compare conditional distributions.
Pizza Salad Sandwich Total
Junior 45 28 32 105
Senior 38 35 22 95
Total 83 63 54 200

The inner cells are cell frequencies. Row and column totals are marginal frequencies. The lower-right corner is the grand total. Raw counts are useful, but proportions reveal patterns more clearly.

Understanding the Three Types of Relative Frequencies

Dividing counts by the appropriate total produces relative frequencies (proportions) that make comparisons fair across groups of different sizes. Each type answers a different question.

Bar charts and pie charts for one categorical variable.
Bar charts and pie charts for one categorical variable.

Joint Relative Frequency: “What fraction of all observations falls in this specific cell?” Divide the cell frequency by the grand total. For juniors who prefer pizza: 45 / 200 = 0.225 (22.5%). All joint relative frequencies sum to 1.

Marginal Relative Frequency: “What fraction of observations belongs to this overall category, ignoring the other variable?” Divide the marginal total by the grand total. For juniors overall: 105 / 200 = 0.525 (52.5%).

Conditional Relative Frequency: “Given a specific group, what fraction chooses this option?” Divide the cell frequency by the relevant marginal total — not the grand total. For pizza preference among juniors: 45 / 105 = 0.429 (42.9%).

Relative Frequency Type Question Answered Denominator
Joint What fraction of all observations is in this cell? Grand total (200)
Marginal What fraction belongs to this overall category? Grand total (200)
Conditional Given this group, what fraction chooses this option? Marginal total (e.g., 105 juniors)

Graphical Representations: Side-by-Side and Segmented Bar Graphs

Side-by-Side Bar Graphs: Groups bars by category, placing them next to each other for direct comparison. Use conditional relative frequencies (not raw counts) on the y-axis so different group sizes don’t distort the comparison. Best when your question is “How does the frequency of one category compare across groups?”

Segmented Bar Graphs: Shows the full distribution of one variable within each group as a single bar divided into labeled segments. Each bar reaches 100% and each segment’s height represents the conditional relative frequency. Best when your question is “Does the overall composition of preferences differ between groups?”

Display Best Question Main Limitation
Side-by-side bar graph How does one specific category compare across groups? Can get crowded with many categories
Segmented bar graph Does the overall composition differ between groups? Hard to compare segments that start at different baselines
Mosaic plot Do the distributions appear independent? Requires interpreting both width and height simultaneously

Mosaic Plots: A Visual Representation of All Three Frequencies

A mosaic plot represents all three relative frequency types as a rectangle divided into tiles. The width of each column represents the marginal relative frequency. The height of each tile represents the conditional relative frequency. The area of each tile equals the joint relative frequency. If all tiles in each column have the same proportional heights, the variables are independent. If heights vary across columns, there’s an association.

A mosaic plot shows group sizes and conditional proportions at once.
A mosaic plot shows group sizes and conditional proportions at once.

Comparing Distributions and Identifying Relationships

The ultimate goal: decide whether the two categorical variables are related. Calculate conditional relative frequencies for each group and compare them. If pizza preference is 42.9% among juniors and 40.0% among seniors — small difference, likely independent. If 42.9% vs. 10.0% — large difference signals a real association. Always compare conditional distributions using proportions, not raw counts.

Test-Taking Strategies

Mnemonic: JMC denominator rule — Joint and Marginal both use the grand total; Conditional uses the marginal of your condition. For graph choice: SSM — Side-by-side to compare one category across groups; Segmented to compare overall composition; Mosaic to visualize independence.

Cross-Topic Connections

  • Unit 2 (Probability, Random Variables, and Probability Distributions): Conditional relative frequencies are conditional probabilities. P(A|B) = conditional relative frequency of A given B.
  • Unit 3 (Chi-Square Tests): Two-way tables reappear when formally testing whether observed associations are statistically significant.

Common AP Exam Question Formats

  • “Calculate and interpret”: Always show your fraction (numerator / denominator = decimal = percentage), then interpret in context.
  • “Choose the display”: Look for “compare composition” (segmented), “compare categories across groups” (side-by-side), or “show joint and conditional frequencies” (mosaic).
  • “Is there an association?”: Calculate conditional relative frequencies for at least two groups, compare them, and state your conclusion in one sentence.

Frequent Student Mistakes

  • Dividing by the wrong total: Conditional frequencies use a row or column marginal, not the grand total. Reread the question before setting up your fraction.
  • Confusing conditional directions: “Pizza given junior” (45/105) and “junior given pizza” (45/83) are different fractions. Set up the fraction correctly first.
  • Misreading segmented bars: Compare proportions (relative segment sizes), not absolute heights.
  • Claiming causation: Use “associated with” or “related to” — never “causes.”

Test-Day Shortcuts and Time Tips

  • For conditional relative frequency, you only need the specific cell count and its marginal total — ignore the rest of the table.
  • On visual interpretation questions, compare segment sizes across groups before reading answer choices; your visual judgment is usually correct.
  • For FRQ association questions, budget 3–4 minutes: calculate two conditional relative frequencies, compare in one sentence, state whether variables appear associated.

Check for Understanding

Think you’ve got it? Complete the quiz below to make sure. Download your results at the end.

Highlight & Annotate
📝

Study Annotations

You just made your first highlight! You can highlight text and click images to add study notes as you read.

Your annotations are saved during this session, as long as you keep this browser tab open. When you’re done, use the Print button to save the article with all your notes in the margins.

Click any highlight to view or edit your note.

Click another word to finish highlighting, or press Esc to cancel
0 Notes
Study Mode
Print Preview — Article with Annotations

Ready to practice? Try Albert free.

Build real confidence with thousands of adaptive practice questions across AP®, SAT®, ACT®, and core subjects — aligned to what you’re studying right now.

Practice for Albert