Two Dimensions, Two Kinds of Information
In Using a Segmented Bar Chart to Check for Association, each group’s bar had the same width and represented \(100\%\) of that group. That made it easy to compare conditional distributions, but the chart did not show how large the groups were. A mosaic plot shows both: group widths reflect group sizes, while the heights of the stacked segments show the response percentages within each group.
A mosaic plot displays the combinations of categories from two categorical variables. One variable defines the groups arranged along the horizontal direction. The other variable supplies the response categories stacked vertically within each group. The order of the groups and response categories should be identified by labels; their visual placement alone does not define their meaning.
These visual features answer different questions. The width tells you how many individuals are in a group relative to the full data set. A segment’s height tells you what percentage of that particular group is in the response category. The area of the segment combines both pieces of information and represents the category’s count relative to all individuals.
How Width, Height, and Area Are Determined
Start with a two-way table and identify the group totals and grand total. If the total horizontal width of the plot is \(W\), a group with total \(n_j\) among \(N\) individuals gets width \(W(n_j/N)\). The group widths add to the full width because the group totals add to \(N\).
Within that group’s rectangle, a response category with count \(c\) has height proportional to \(c/n_j\), the conditional proportion for that category in the group. If the plot’s full vertical height is \(H\), the segment’s height is \(H(c/n_j)\). The heights of all response segments within one group add to \(H\), just as the group’s conditional percentages add to \(100\%\).
Multiplying a segment’s width by its height shows why its area represents the cell count:
The group total \(n_j\) cancels, leaving an area proportional to the cell count \(c\). In other words, a wider segment with less height can still have a greater area than a narrower segment with more height. The dimensions are often chosen to make the plot fit a page or screen; the particular physical measurements are not the important part. The proportional relationships are.
Worked Example: Constructing a Mosaic Plot from Counts
Worked Example: Constructing a Mosaic Plot from Counts
A fictional survey asks 140 students how they usually get to an after-school activity. The groups are students who travel by school bus or by family car; the response categories are walk, bicycle, and other. Find the widths and segment heights for a mosaic plot, then explain what each dimension represents.
| Travel group | Walk | Bicycle | Other | Total |
|---|---|---|---|---|
| School bus | 24 | 10 | 6 | 40 |
| Family car | 30 | 50 | 20 | 100 |
| Total | 54 | 60 | 26 | 140 |
State. Travel group defines the horizontal rectangles, and usual travel method is the response variable stacked within each rectangle.
Plan. Use each group’s share of the 140 students to set its width. Use each response count divided by its own group total to set the segment heights. For easy illustration, let the full plot be 14 units wide and 10 units high.
Do: widths. The school-bus group receives \(14(40/140)=4\) units of width. The family-car group receives \(14(100/140)=10\) units. The widths add to \(4+10=14\), the full width. The car group is wider because it contains more students.
Do: segment heights. Among the 40 students who travel by school bus, the percentages walking, bicycling, and using another method are \(24/40=60\%\), \(10/40=25\%\), and \(6/40=15\%\). Their heights in the 10-unit plot are \(10(0.60)=6\), \(10(0.25)=2.5\), and \(10(0.15)=1.5\) units.
Among the 100 students who travel by family car, those percentages are \(30/100=30\%\), \(50/100=50\%\), and \(20/100=20\%\). The respective heights are \(10(0.30)=3\), \(10(0.50)=5\), and \(10(0.20)=2\) units. For each group, the segment heights add to 10.
| Travel group | Width | Walk height | Bicycle height | Other height |
|---|---|---|---|---|
| School bus | 4 | 6 | 2.5 | 1.5 |
| Family car | 10 | 3 | 5 | 2 |
Conclude. The family-car rectangle should be two and a half times as wide as the school-bus rectangle because \(100/40=2.5\). The school-bus group has a larger walking percentage, while the family-car group has a larger bicycling percentage. The plot makes the group-size difference and these conditional-percentage differences visible at the same time.
Read the Percentages and the Group Sizes Separately
To compare conditional distributions, compare the heights of corresponding response segments across groups. A taller segment means a higher percentage within its own group. To compare group sizes, compare rectangle widths. Do not use a segment’s height alone to decide which group has more individuals in that response category; the group’s width matters too.
For example, a response category might make up a large percentage of a small group but a smaller percentage of a much larger group. The first group’s segment would be taller, but the second group’s segment could have greater area and represent more individuals. This is one reason a mosaic plot adds information beyond a segmented bar chart.
Worked Example: A Lower Percentage Can Mean More Individuals
Worked Example: A Lower Percentage Can Mean More Individuals
A fictional survey records how students travel to an afternoon activity. There are 30 students in the morning group and 90 in the afternoon group. Twelve morning students and 18 afternoon students usually cycle. Determine how the cycle segments compare in percentage, count, and area in a mosaic plot.
| Time group | Cycle | Do not cycle | Total |
|---|---|---|---|
| Morning | 12 | 18 | 30 |
| Afternoon | 18 | 72 | 90 |
| Total | 30 | 90 | 120 |
State. Time group determines rectangle width, and cycling status determines the stacked segments.
Plan. Compare the cycling percentages using each time group’s total as the denominator. Compare counts directly from the table. To illustrate the widths and heights, use a plot 12 units wide and 8 units high.
Do. The morning cycling percentage is \(12/30=40\%\), and the afternoon cycling percentage is \(18/90=20\%\). The morning segment is twice as tall in percentage terms. Yet there are 18 afternoon cyclists and 12 morning cyclists, so the afternoon group has 6 more cyclists.
The morning width is \(12(30/120)=3\) units, and the afternoon width is \(12(90/120)=9\) units. Their widths show the afternoon group is three times as large. The cycling heights are \(8(12/30)=3.2\) units for morning and \(8(18/90)=1.6\) units for afternoon.
Check the areas. The morning cycling segment has area \(3(3.2)=9.6\) square units. The afternoon cycling segment has area \(9(1.6)=14.4\) square units. The plot’s total area is \(12(8)=96\) square units, so each student corresponds to \(96/120=0.8\) square units. The areas agree with the counts: \(12(0.8)=9.6\) and \(18(0.8)=14.4\).
Conclude. Cycling is a higher percentage of the morning group, but more students cycle in the larger afternoon group. The mosaic plot shows this with a taller morning cycling segment and a larger afternoon cycling area. A statement about percentage and a statement about count answer different questions.
Worked Example: Group Widths Do Not Determine Association
Worked Example: Group Widths Do Not Determine Association
A fictional community survey records whether residents compost and whether they live in an apartment or a house. Use the table to describe the group sizes and compare the conditional percentages. Then explain what a mosaic plot would suggest about association.
| Housing type | Composts | Does not compost | Total |
|---|---|---|---|
| Apartment | 32 | 48 | 80 |
| House | 24 | 16 | 40 |
| Total | 56 | 64 | 120 |
State. Housing type defines the groups, and composting status is the response. The plot’s widths will represent the numbers of apartment and house residents.
Plan. Compare the composting percentages within each housing group, using that group’s total as the denominator. Then use the corresponding segment heights—not the widths—to assess whether the conditional distributions differ.
Do. The apartment composting percentage is \(32/80=40\%\); the percentage that does not compost is \(48/80=60\%\). The house composting percentage is \(24/40=60\%\); the percentage that does not compost is \(16/40=40\%\). The composting percentages differ by \(60\%-40\%=20\) percentage points, with the higher percentage among residents in houses.
If the plot is 12 units wide, apartment residents receive \(12(80/120)=8\) units of width and house residents receive \(12(40/120)=4\) units. The apartment rectangle is twice as wide because there are twice as many apartment residents. Nevertheless, the house rectangle has the taller composting segment: \(60\%\) compared with \(40\%\).
Conclude. The conditional distributions differ, so the mosaic plot suggests an association between housing type and composting status in these data. Apartment residents have the larger group and also the larger composting count, 32 compared with 24. But the percentage who compost is higher among house residents. The widths and heights reveal why these statements can both be true.
What Mosaic Plots Add to Segmented Bar Charts
A segmented bar chart gives every group an equal-width bar. That design emphasizes conditional percentages and is especially convenient when the main question is whether response distributions differ across groups. A mosaic plot uses unequal widths, so it also displays group sizes. Its segment areas then communicate cell counts relative to the whole data set.
The two displays can be useful for related but distinct purposes. If the group totals are very unequal, a mosaic plot makes that imbalance immediately visible. If the goal is to compare conditional distributions without the larger group dominating the visual space, an equal-width segmented bar chart may be easier to compare. In either display, use conditional percentages to describe differences in distributions.
Neither graph establishes that one variable causes the other. A mosaic plot describes the two-way table from the data collected. As in earlier tutorials on association in two-way tables, differences in conditional distributions indicate an association in the displayed data, not proof of cause and effect.
Common Mistakes and AP Exam Tips
- Treating unequal widths as unequal percentages. Widths represent group sizes, not response percentages. Compare segment heights to compare conditional percentages.
- Using only segment height to compare counts. A taller segment is a higher percentage of its group, but the group may be small. Use area or the table’s counts to compare numbers of individuals.
- Assuming a wide rectangle means a particular response is common. A wide rectangle says that the group is large. Its response distribution is shown by the heights of its segments.
- Forgetting the denominator changes by group. A segment’s height comes from its count divided by its own group total, not by the grand total.
- Calling the groups associated just because their sizes differ. Different group totals affect widths, but association is assessed by comparing the conditional distributions—the segment heights.
- Giving a vague comparison. A full-credit description names the groups and response category, gives the direction of the percentage difference, and distinguishes a percentage comparison from a count comparison when relevant.
For an AP-style interpretation, identify the group and response variables, compare corresponding conditional percentages, and state the pattern in context. When group sizes are relevant, describe the widths separately. For example: “Residents in houses have a higher composting percentage than apartment residents, although the apartment group is larger and has more composting residents by count. The displayed conditional distributions differ, suggesting an association between housing type and composting status in this survey.”
Check Your Understanding
Use the difference between widths, segment heights, and areas to answer each question.
- A mosaic plot is 15 units wide and represents 300 individuals. One group contains 120 individuals. How wide should that group’s rectangle be?
- In a group of 50 people, 20 choose a particular response. If the full plot height is 8 units, what is the response segment’s percentage and height?
- One group’s response segment is taller than the corresponding segment in another group. What does that tell you, and what does it not necessarily tell you?
- Why might a response segment have greater area in a group where its percentage is lower?
- Which part of a mosaic plot should you compare to assess whether conditional distributions differ across groups?