Fiveable

📊AP Statistics Unit 2 Review

QR code for AP Statistics practice questions

2.2 Representing Two Categorical Variables

2.2 Representing Two Categorical Variables

Written by the Fiveable Content Team • Last updated June 2026
Verified for the 2027 exam
Verified for the 2027 examWritten by the Fiveable Content Team • Last updated June 2026
📊AP Statistics
Unit & Topic Study Guides

Previous Exam Prep

AP Cram Sessions 2021

Pep mascot

Two categorical variables can be summarized in a two-way table, also called a contingency table, and shown with side-by-side bar graphs, segmented bar graphs, or mosaic plots. These representations let you compare distributions and check whether the two variables look associated.

Why This Matters for the AP Statistics Exam

This topic is the foundation for working with categorical relationships on the AP Statistics exam. You will be expected to read a two-way table, switch between counts and relative frequencies, and explain what a graph shows about two categorical variables. Being able to compare distributions across categories also sets you up for later work, since two-way tables connect directly to probability ideas and to chi-square procedures in a later unit.

On both multiple-choice and free-response questions, you may need to pull values out of a table, calculate a relative frequency, or describe whether two variables appear associated. Clear, in-context language is important for strong exam work here.

Key Takeaways

  • A two-way table (contingency table) summarizes two categorical variables using rows and columns; cells can hold frequency counts or relative frequencies.
  • A joint relative frequency is one cell divided by the grand total for the whole table.
  • Side-by-side bar graphs, segmented bar graphs, and mosaic plots all display one categorical variable broken down by another.
  • Mosaic plots use both width and height, so the area of each rectangle matches a joint relative frequency.
  • You compare distributions across categories to decide whether two variables look associated.
  • Association is not the same as causation, so an apparent pattern does not prove cause and effect.

Various Tables and Diagrams

Two-Way Tables

A two-way table, also called a contingency table, has rows and columns that match the categories of the two variables. Each cell holds the count or proportion of data points that fall into that combination of categories. This makes it easy to see how individuals are distributed across the categories of both variables at once.

Here is an example of a two-way table:

Courtesy of Starnes, Daren S. and Tabor, Josh. The Practice of Statistics-For the AP Exam, 5th Edition. Cengage Publishing.

This table summarizes a survey of 4826 people who were asked about their chance of getting rich. You can read that 194 participants felt they had almost no chance of getting rich, 2367 participants were female, and 758 males thought there was a good chance they could get rich.

Joint Relative Frequencies

You can also fill a two-way table with relative frequencies, where each entry is a proportion out of the whole sample size. A joint relative frequency is the proportion of individuals who share two characteristics at once, such as being male and almost certain.

For example, if 486 males responded "almost certain" out of 4826 total people, the joint relative frequency is 486/4826. In a joint relative frequency table, the overall total in the bottom-right corner is always 1.00.

Side-by-Side Bar Graphs

Side-by-side bar graphs place the bars for each category of one variable next to each other, grouped by the categories of the other variable. By comparing the bars within each group, you can see how the categories of one variable line up against the categories of the other.

Here is an example of a side-by-side bar graph:

Courtesy of DevExpress

In this example, the grouping category is gender, and each bar shows the percentage of each gender holding a certain opinion about age and wealth.

Segmented Bar Graphs

Segmented bar graphs are similar to side-by-side bar graphs, but instead of separate bars, the proportions appear as segments stacked within a single bar. This is helpful for comparing how one variable splits up across the categories of the other variable.

Courtesy of Starnes, Daren S. and Tabor, Josh. The Practice of Statistics-For the AP Exam, 5th Edition. Cengage Publishing.

Here, each gender's bar adds up to 100%, which lets you compare the relative sizes of the different responses within each group.

Mosaic Plots

Mosaic plots divide the plot into rectangles whose areas are proportional to the data. The width of each bar is proportional to the number of people in each primary category, and the area of each region relative to the whole plot represents a joint relative frequency.

You can think of a mosaic plot as a picture version of a two-way table. It is useful for showing the relationship between two categorical variables and for comparing proportions across categories. Here is an example of a mosaic plot:

image courtesy of: blogs.sas.com

Determining Associations from Graphical Representations

Each of these graphs can help you decide whether two categorical variables are associated. To check, compare the heights (or widths) of the matching segments across different categories. If those proportions are clearly different, the variables appear associated, meaning one group may be more likely to give a certain response. That does not prove a cause-and-effect relationship.

For example, suppose you have data on class level (junior, senior, and so on) and whether students finish their homework on time. You could build a side-by-side bar graph or mosaic plot to compare the proportion of on-time students in each class. If those proportions differ noticeably across classes, that suggests an association between the two variables.

Keep in mind that an apparent pattern can be real or random, and even a real association does not mean one variable causes the other. Correlation does not imply causation. Other factors may be shaping the relationship, so interpret these graphs carefully.

How to Use This on the AP Statistics Exam

MCQ

  • Practice reading specific cells, row totals, and column totals out of a two-way table quickly.
  • Be ready to convert a count into a joint relative frequency by dividing the cell by the grand total.
  • Watch the wording. "What proportion of the whole sample is male and almost certain" is a joint relative frequency, not a row or column proportion.

Free Response

  • When a prompt gives a table or graph, state what the representation shows in context, using the actual variable names.
  • To argue for or against association, compare proportions across the categories instead of just comparing raw counts.
  • Use careful language such as "tend to" and avoid claiming cause and effect from a graph alone.

Common Trap

  • Comparing raw counts instead of proportions when groups have different sizes. Always compare relative frequencies when checking for association.

Common Misconceptions

  • A joint relative frequency is not the same as a conditional one. A joint relative frequency divides a cell by the grand total. Dividing by a row or column total gives a conditional relative frequency, which is a different idea.
  • Equal counts do not mean no association. Groups often have different totals, so you need to compare proportions, not raw counts.
  • An association is not proof of causation. Two variables can look related in a graph without one causing the other.
  • Segmented bars are not just stacked counts. When each bar reaches 100%, you are comparing proportions within each group, not totals.
  • A mosaic plot is more than a fancy bar chart. Bar widths carry information too, since they reflect how many individuals fall in each primary category.

Vocabulary

The following words are mentioned explicitly in the College Board Course and Exam Description for this topic.

Term

Definition

association

The relationship between two variables where knowing the value of one variable provides information about the other variable.

distribution

The pattern of how data values are spread or arranged across a range.

joint relative frequency

A cell frequency in a two-way table divided by the total number of observations in the entire table, expressing the proportion of the total for a specific combination of categories.

mosaic plots

A graphical representation of two categorical variables where rectangles are sized proportionally to represent the frequency or relative frequency of each combination of categories.

segmented bar graphs

A graphical representation where bars are divided into segments, with each segment representing a category of a second categorical variable, showing the composition within each category of the first variable.

side-by-side bar graphs

A graphical representation that displays bars for one categorical variable grouped side-by-side for each category of another categorical variable, allowing for easy comparison between groups.

two-way table

A table that displays the frequency distribution of two categorical variables, organized in rows and columns.

Frequently Asked Questions

How do you represent two categorical variables in AP Stats?

Use a two-way table, also called a contingency table, or a graph such as a side-by-side bar graph, segmented bar graph, or mosaic plot. These displays show how one categorical variable breaks down across another.

What is a two-way table?

A two-way table summarizes two categorical variables using rows and columns. Each cell contains a frequency count or relative frequency for one combination of categories.

What is joint relative frequency?

A joint relative frequency is one cell count divided by the total number of individuals in the table. It describes the proportion of the whole sample that falls into a specific combination of categories.

What is the difference between marginal and conditional relative frequency?

A marginal relative frequency uses a row total or column total out of the grand total. A conditional relative frequency looks within one row or column category, so the denominator is that row or column total.

When should you use a segmented bar graph?

Use a segmented bar graph when you want to compare conditional distributions across groups. Each bar is scaled to the same total, which makes the proportions within categories easier to compare.

What is a common AP Stats mistake with two categorical variables?

A common mistake is comparing raw counts when group sizes are different. Use relative frequencies or conditional distributions when you need a fair comparison across groups.

Pep mascot
Upgrade your Fiveable account to print any study guide

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Click below to go to billing portal → update your plan → choose Yearly→ and select "Fiveable Share Plan". Only pay the difference

Plan is open to all students, teachers, parents, etc
Pep mascot
Upgrade your Fiveable account to export vocabulary

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Plan is open to all students, teachers, parents, etc
report an error
description

screenshots help us find and fix the issue faster (optional)

add screenshot