Mathwords logoMathwords

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 AA (with categories aia_i) and BB (with categories bjb_j), a mosaic plot divides a unit square into vertical strips of width P(ai)P(a_i). It then divides each strip into tiles of height P(bj∣ai)P(b_j \mid a_i). Each tile's area therefore equals the joint relative frequency P(ai and bj)P(a_i \text{ and } b_j). Equal tile heights across all strips indicate no association between AA and BB. Also called a Marimekko chart.

Key Formula

Area of tile=nin⏟width⋅nijni⏟height=nijn\text{Area of tile} = \underbrace{\frac{n_i}{n}}_{\text{width}} \cdot \underbrace{\frac{n_{ij}}{n_i}}_{\text{height}} = \frac{n_{ij}}{n}
Where:
  • nn = total number of observations
  • nin_i = number of observations in category ii of the horizontal variable (column total)
  • nijn_{ij} = number of observations in category ii of the horizontal variable and category jj 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.
Juniors: 120200=0.6,Seniors: 80200=0.4\text{Juniors: } \frac{120}{200} = 0.6, \qquad \text{Seniors: } \frac{80}{200} = 0.4
Step 2: Within each strip, find the tile heights as conditional proportions. Divide by the group total, not by 200.
Juniors online: 72120=0.6,Seniors online: 2080=0.25\text{Juniors online: } \frac{72}{120} = 0.6, \qquad \text{Seniors online: } \frac{20}{80} = 0.25
Step 3: Check one tile's area against the joint proportion from the table.
0.6×0.6=0.36=722000.6 \times 0.6 = 0.36 = \frac{72}{200}
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.

Related Terms

  • Mutually Exclusive — Categories in each strip cannot overlap
  • Disjoint Sets — Tiles partition the sample into non-overlapping groups
  • Odds — Ratio of tile heights within one strip
  • Population — Group whose categorical breakdown the plot describes
  • Box-and-Whisker Plot — Display for quantitative rather than categorical data
  • Stemplot — Another display covered in the same unit