Mosaic Plot — Definition, Formula & Examples
A mosaic plot is a graph of a two-way table. It uses rectangles whose widths show how one categorical variable is split and whose heights show how the second variable is split within each group.
For categorical variables (with categories ) and (with categories ), a mosaic plot divides a unit square into vertical strips of width . It then divides each strip into tiles of height . Each tile's area therefore equals the joint relative frequency . Equal tile heights across all strips indicate no association between and . Also called a Marimekko chart.
Key Formula
Where:
- = total number of observations
- = number of observations in category of the horizontal variable (column total)
- = number of observations in category of the horizontal variable and category of the vertical variable (cell count)
Worked Example
Problem: A survey of 200 students asks whether they prefer online or in-person classes. Of 120 juniors, 72 prefer online and 48 prefer in-person. Of 80 seniors, 20 prefer online and 60 prefer in-person. Find the tile dimensions for a mosaic plot with grade on the horizontal axis.
Step 1: Find each strip's width from the column totals. The widths must add to 1.
Step 2: Within each strip, find the tile heights as conditional proportions. Divide by the group total, not by 200.
Step 3: Check one tile's area against the joint proportion from the table.
Answer: The junior strip has width 0.6, split into heights 0.6 (online) and 0.4 (in-person). The senior strip has width 0.4, split into heights 0.25 (online) and 0.75 (in-person). The dividing lines sit at different heights in the two strips, so grade and class preference appear to be associated.
Why It Matters
On the AP Statistics exam, you may need to judge from a graph whether two categorical variables are associated. A mosaic plot makes this visible in one picture, because misaligned horizontal dividers signal association. It is also a natural visual check before you run a chi-square test for independence.
Common Mistakes
Mistake: Reading a tile's height as the proportion of the whole sample.
Correction: Height is a conditional proportion within that strip. In the example, the 0.25 height means 25% of seniors, not 25% of all students. The tile's area gives the share of the whole sample.
