Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›AP Statistics
  3. ›2 Probability, Random Variables and Probability Distributions
  4. ›2.1 Two categorical variables: tables and graphs

AP Statistics · Unit 2 · Probability, Random Variables and Probability Distributions

2.1 Two categorical variables: tables and graphs

Organize data for two categorical variables in a two-way table, interpret its values, and describe a relationship by comparing percentages.

  • 4 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5A two-way table sorts each unit by two categorical variables
  1. 1A two-way table sorts each unit by two categorical variables
  2. 2Totals around the edges describe each variable alone
  3. 3Each value must be read with both of its categories
  4. 4Comparing percentages within groups reveals a relationship
  5. 5A segmented bar chart shows the same comparison visually
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: A two-way table sorts each unit by two categorical variables

A school asks 200 students how they get to school and which grade level they are in. Each student gives two answers. One table can show both answers together.

A two-way table lists the categories of one variable in rows and the categories of another in columns. Each cell holds a joint frequency, the number of units in that pair of categories. Every unit belongs in exactly one cell. To build the table:

  • List the categories of one variable down the side.
  • List the categories of the other variable across the top.
  • Tally each unit into the one cell that matches both answers.
  • Add the row totals and the column totals.

Key terms · tap one for its definition

two-way table

A two-way table is a table of counts that classifies each unit by the categories of two categorical variables.

joint frequency

A joint frequency is the count of units in one particular pair of categories, found in a single cell.

Part 1 done

2

Part 2 of 5: Totals around the edges describe each variable alone

Now look at the edges of the finished table. The row totals and column totals sit in the margins. Each one is a marginal frequency, the total count for one category of a single variable.

Travel to school by grade level (number of students)

Grade levelBusNot busTotal
Underclass6654120
Upperclass206080
Total86114200
Grade level
Underclass
Bus
66
Not bus
54
Total
120
Grade level
Upperclass
Bus
20
Not bus
60
Total
80
Grade level
Total
Bus
86
Not bus
114
Total
200

The count in the bottom-right corner is the grand total. It is the number of all units in the table. Here, 200 students were surveyed, and 86 of them ride the bus. Marginal frequencies describe each variable alone. For example, 120 students are underclass, and 114 students do not ride the bus.

Key terms · tap one for its definition

marginal frequency

A marginal frequency is the total count for one category of a single variable, found in a row total or column total.

grand total

The grand total is the count of all units in a two-way table, which equals the sum of all cell counts.

Part 2 done

Quick check

One question on the part you just read

Easy

Identify what a joint frequency in a two-way table represents.
Show answer and explanation

Answer: C · Worked explanation

A joint frequency is the count in a single cell, which matches one category of each variable. The count for one category of one variable is a marginal frequency, found in a row or column total. The count of all units is the grand total.
3

Part 3 of 5: Each value must be read with both of its categories

A number in the table means little until you name its row and column. Here are four readings of the table above.

  • The cell 66 means that 66 underclass students ride the bus.
  • The row total 80 means that 80 upperclass students were surveyed.
  • The column total 114 means that 114 students do not ride the bus.
  • The grand total 200 means that the survey included 200 students.

Counts depend on group size, so they can mislead. To compare fairly, convert a count to a relative frequency, a count divided by a total.

Worked example

Finding a relative frequency

Find the percent of all students surveyed who are upperclass students that ride the bus.
  1. 1
    Word equation: relative frequency = cell count divided by grand total.
  2. 2
    Substitute the cell count 20 and the grand total 200: 20200\frac{20}{200}20020​.
  3. 3
    Calculate: 20200=0.10\frac{20}{200}=0.1020020​=0.10, which is 10%.

Answer: 10% of all students surveyed are upperclass students who ride the bus.

Common mistake

A larger count does not mean a larger percent. Here 66 underclass students ride the bus, but there are more underclass students in the survey.

Key term

relative frequency

A relative frequency is a count divided by a total, written as a proportion or a percent.

Part 3 done

4

Part 4 of 5: Comparing percentages within groups reveals a relationship

To compare the two grade levels fairly, find a percent within each row. Divide each cell by its own row total. Of 120 underclass students, 66 ride the bus, which is 55%. Of 80 upperclass students, 20 ride the bus, which is 25%.

Percent within each grade level

Grade levelBusNot bus
Underclass55%45%
Upperclass25%75%
Grade level
Underclass
Bus
55%
Not bus
45%
Grade level
Upperclass
Bus
25%
Not bus
75%

The two grade levels have different percents. When the distribution of one variable differs across the categories of the other, the variables have an association. Here, bus riding is more common among underclass students. If the percents were nearly equal, the table would show little or no association.

Exam tip

Name both groups and give both percents when you describe a relationship. For example, write 55% of underclass students versus 25% of upperclass students.

Key term

association

An association exists between two variables when the distribution of one variable differs across the categories of the other.

Part 4 done

Quick check

One question on the part you just read

Easy

Identify the value in a two-way table that equals the number of units surveyed.
Show answer and explanation

Answer: A · Worked explanation

The grand total is the sum of all cell counts, so it equals the number of units in the table. A single column total counts only one category of one variable. The largest cell count is only one pair of categories.
5

Part 5 of 5: A segmented bar chart shows the same comparison visually

A table of percents is accurate, but a picture makes the pattern quick to see. A segmented bar chart draws one bar for each group. Each bar is divided into segments showing the percent in each category of the other variable.

Figure 1. Both bars total 100%. The bus segment is much larger for underclass students than for upperclass students.

Every bar has the same total height of 100%. Different segment sizes in the bars point to an association. Look for segments that change size from one bar to the next. A side-by-side bar chart instead places separate bars next to each other, grouped by the other variable.

Go deeperMosaic plots

A mosaic plot extends the segmented bar chart. The width of each bar is proportional to the size of its group.

The area of each block then matches that cell’s share of all the units. This shows both group sizes and within-group percents in one picture.

Key terms · tap one for its definition

segmented bar chart

A segmented bar chart is a graph with one bar per group, in which segments show the percent of each category within that group.

side-by-side bar chart

A side-by-side bar chart is a graph that places separate bars next to each other to compare categories across groups.

Note read

Check your recall[13 marks]

6 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.Identify[1 mark]

    Identify the name for the totals found along the right edge and bottom edge of a two-way table.

    Show mark schemeHide mark scheme

    Model answer

    They are marginal frequencies.

    • 1 mark for naming them marginal frequencies
  2. 2.Calculate[2 marks]

    A two-way table of 250 people shows 45 people who are both left-handed and under 30. Calculate the percent of all people who are left-handed and under 30.

    Show mark schemeHide mark scheme

    Model answer

    Relative frequency = cell count divided by grand total = 45250=0.18\frac{45}{250}=0.1825045​=0.18, so 18%.

    • 1 mark for dividing the cell count 45 by the grand total 250
    • 1 mark for giving the answer 18%
  3. 3.Explain[2 marks]

    Explain why comparing raw counts can mislead when the groups have different sizes.

    Show mark schemeHide mark scheme

    Model answer

    A larger group can have a larger count even when a smaller percent of its members are in the category. Percents within each group adjust for group size and allow a fair comparison.

    • 1 mark for stating that a larger group can produce a larger count without a larger percent
    • 1 mark for explaining that percents within each group adjust for group size
  4. 4.Describe[3 marks]

    Describe how to build a segmented bar chart from a two-way table.

    Show mark schemeHide mark scheme

    Model answer

    Draw one bar for each category of the variable that defines the groups. Convert each group’s counts to percents of that group’s total. Divide each bar into segments for the other variable’s categories so that every bar totals 100%.

    • 1 mark for drawing one bar for each group
    • 1 mark for converting each group’s counts to percents of that group’s total
    • 1 mark for dividing each bar into segments so that every bar totals 100%
  5. 5.Justify[3 marks]

    Club A has 150 members, and 60 prefer tea. Club B has 50 members, and 30 prefer tea. Justify whether club and drink preference show an association.

    Show mark schemeHide mark scheme

    Model answer

    In club A, 60150=40%\frac{60}{150}=40\%15060​=40% prefer tea. In club B, 3050=60%\frac{30}{50}=60\%5030​=60% prefer tea. The percents differ, so the distribution of preference differs between the clubs, and the variables show an association.

    • 1 mark for finding 40% for club A
    • 1 mark for finding 60% for club B
    • 1 mark for concluding that the distributions differ, so there is an association
  6. 6.Describe[2 marks]

    Describe what it means for two categorical variables to have an association.

    Show mark schemeHide mark scheme

    Model answer

    The distribution of one variable differs across the categories of the other variable. For example, the percent in a category changes from group to group.

    • 1 mark for stating that the distribution of one variable differs across categories of the other
    • 1 mark for giving a correct example or description of percents changing between groups

Practice this topic

10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)

0 right0 of 10 answered

Includes the 2 quick checks in the note above.

3.

Easy·Identify[1 mark]

Identify the graph best suited to comparing the percent in each response category across groups.
Show answer and explanation

Answer: B · Worked explanation

A segmented bar chart scales every group’s bar to 100%, so segment sizes can be compared directly. A pie chart of column totals ignores the groups. A histogram and a scatterplot are not built for categorical comparisons like this. Segment sizes show the pattern at a glance.
4.

Medium·Calculate[2 marks]

Of 80 teens surveyed, 48 own a smartwatch. Of 120 adults surveyed, 36 own one. Calculate the percent of adults surveyed who own a smartwatch.
Show answer and explanation

Answer: D · Worked explanation

The percent is the adult count divided by the adult total: 36120=0.30\frac{36}{120}=0.3012036​=0.30, or 30%. Dividing 36 by all 200 people gives 18%, a percent of the grand total rather than of adults. The value 60% is the teen percent, 4880\frac{48}{80}8048​.
5.

Medium·Determine[2 marks]

A two-way table of 300 voters shows 60 voters under 40, of whom 36 favor a measure, and 240 voters aged 40 or over, of whom 120 favor it. Determine which conclusion is best supported.
Show answer and explanation

Answer: A · Worked explanation

Within each group, 3660=60%\frac{36}{60}=60\%6036​=60% and 120240=50%\frac{120}{240}=50\%240120​=50%, so younger voters favor the measure at a higher rate. The count 120 is larger only because that group is four times bigger. Percents can be compared even when group sizes differ. Always divide by the group total.
6.

Medium·Calculate[2 marks]

A two-way table of 400 shoppers shows 88 who are both under 25 and bought online. The under-25 row total is 160. Calculate the percent of all shoppers who are under 25 and bought online.
Show answer and explanation

Answer: B · Worked explanation

A percent of all shoppers divides by the grand total: 88400=0.22\frac{88}{400}=0.2240088​=0.22, or 22%. Dividing by the row total 160 gives 55%, which is the percent of under-25 shoppers who bought online. The value 40% is the share of shoppers who are under 25.
7.

Medium·Identify[2 marks]

In a table of students by grade and club, the cell for seniors and the drama club is 12. Identify the correct interpretation.
Show answer and explanation

Answer: C · Worked explanation

A cell count matches one row and one column, so 12 is the number of seniors in drama. The number of students in the drama club overall would be the column total. A count says nothing about percent until it is divided by a total.
8.

Hard·Determine[2 marks]

In a table, 300 adults under 50 include 90 who got a flu shot, and 200 adults aged 50 or over include 100 who did. Determine the percent vaccinated in each group.
Show answer and explanation

Answer: D · Worked explanation

Within each group, 90300=30%\frac{90}{300}=30\%30090​=30% and 100200=50%\frac{100}{200}=50\%200100​=50%. The values 18% and 20% divide by all 500 adults instead of each group. The values 90% and 100% treat counts as percents, and 70% is the unvaccinated share of the younger group. Each percent must use its own group total.
9.

Hard·Interpret[2 marks]

A segmented bar chart compares two groups. Both bars have the same segment percents. Interpret this result.
Show answer and explanation

Answer: B · Worked explanation

Matching segments mean the distribution of the response does not change from group to group, which indicates little or no association. Each bar is scaled to 100%, so equal heights say nothing about group sizes. Matching bars signal no association, not a strong one.
10.

Hard·Determine[2 marks]

A table shows that 66 underclass and 20 upperclass students ride the bus. There are 120 underclass and 80 upperclass students in all, 200 students total. Determine the percent of bus riders who are underclass.
Show answer and explanation

Answer: A · Worked explanation

Bus riders total 66+20=8666+20=8666+20=86, and 6686≈0.767\frac{66}{86}\approx0.7678666​≈0.767, or about 77%. Dividing by the 120 underclass students gives 55%, which answers a different question. The value 33% divides by all 200 students, and 23% is the upperclass share of riders. The denominator must be the total number of bus riders.

Keep going

Next topic2.2 Two categorical variables: summary statisticsPrevious topic1.13 Experimental design

More in Unit 2 · Probability, Random Variables and Probability Distributions

  1. 2.1Two categorical variables: tables and graphsNotes · 10 questions
  2. 2.2Two categorical variables: summary statisticsNotes · 10 questions
  3. 2.3SimulationNotes · 10 questions
  4. 2.4Introduction to probabilityNotes · 10 questions
  5. 2.5Mutually exclusive eventsNotes · 10 questions
  6. 2.6Conditional probabilityNotes · 10 questions
  7. 2.7Independent events and unionsNotes · 10 questions
  8. 2.8Random variables and distributionsNotes · 10 questions
  9. 2.9Parameters of random variablesNotes · 10 questions

All AP Statistics topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by College Board or any exam board.

On this page

0/5 read

  1. 1A two-way table sorts each unit by two categorical variables
  2. 2Totals around the edges describe each variable alone
  3. 3Each value must be read with both of its categories
  4. 4Comparing percentages within groups reveals a relationship
  5. 5A segmented bar chart shows the same comparison visually
  6. Check your recall
  7. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe