AP® Statistics · Unit 2 · Topic 2.1
Segmented Bar Charts for Two Categorical Variables
A segmented bar chart turns each group in a two-way table into one bar, divided into pieces by percentage, so you can compare the rate of some outcome fairly across groups of different sizes.
Two-way tables hide comparisons because raw counts depend on group size. If 90 of 150 city respondents say yes and 40 of 100 rural respondents say yes, stacking raw counts into two bars makes the city bar taller just because the city group is bigger, not because city people say yes more often. You need rates, not counts.
To build the chart, take each column of the two-way table as one group, one bar. Find each group's total, then divide every category count in that column by the column total to get conditional relative frequencies. Stack those percentages inside the bar, so every bar reaches 100 percent no matter how many people were actually surveyed. Now segment height means rate within the group, and bars of equal height are directly comparable.
This is why normalizing to percent matters: for the city group, 90/150 = 60 percent yes; for the rural group, 40/100 = 40 percent yes. Even though city has more total respondents, the comparison that matters is 60 percent versus 40 percent, visible only once both bars are scaled to the same height. This idea sets up conditional probability and independence in the next topics: if the yes-rate were the same across groups, the segments would line up evenly, which is exactly the visual test for whether two categorical variables are associated.
Key terms
- Segmented bar chart
- A bar chart where each bar represents one group, divided into segments showing the percentage in each category.
- Conditional relative frequency
- The proportion of a category within one specific group, found by dividing the count by that group's total.
- Two-way table
- A table that displays counts for combinations of two categorical variables, organized by rows and columns.
- Normalized bar
- A bar scaled so its segments always sum to 100 percent, making groups of different sizes directly comparable.
Watch it explained
Check yourself
End of topic.