Relationship

Mosaic plot (contingency table)

Represents contingency-table frequencies through recursively partitioned rectangular areas.

  • Plot
  • Relationship
  • Composition

What it answers

How are categorical variables associated?

Shape
Proportionally partitioned tiles
What it shows
Unequal combinations and association patterns.

Example

The question

Does the share of repeat buyers differ by sign-up channel?

Customers by sign-up channel and repeat purchase (mosaic plot)

Customers by sign-up channel and repeat purchase (mosaic plot)Tile widths show each channel’s share of customers; heights split repeat and one-off buyers. Search: 45% of customers, 62% bought again; Social: 30% of customers, 38% bought again; Referral: 25% of customers, 74% bought again.Bought againOne purchase62%38%Search45% of customers38%62%Social30% of customers74%26%Referral25% of customers
Customers by sign-up channel and repeat purchase (mosaic plot)Tile widths show each channel’s share of customers; heights split repeat and one-off buyers. Search: 45% of customers, 62% bought again; Social: 30% of customers, 38% bought again; Referral: 25% of customers, 74% bought again.Bought againOne purchase62%38%Search45%38%62%Social30%74%26%Referral25%
Tile widths show each channel’s share of customers; heights split repeat and one-off buyers. Search: 45% of customers, 62% bought again; Social: 30% of customers, 38% bought again; Referral: 25% of customers, 74% bought again.

Illustrative data. It belongs to no company.

When to use it

Use it when

Exploring contingency tables and category association.

Avoid it when

Sparse high-dimensional categories or unclear partition order.

How to read it

Read tile area as count/share and inspect departures from a reference model if shown.

Note

Related to Marimekko charts but often used for statistical association.

The data you need

Layout
Long table
Fields
CategoryA: text; CategoryB: text; Count: nonnegative number
One row is
One category combination and its frequency. What is the grain?
Rules
Aggregate duplicate combinations. Preserve zero cells and use a positive total.
Optional
Raw alternative: one row per observation with both category columns. More factors are possible.
Preparation
Build a complete contingency table; calculate joint frequencies and optionally expected counts for the chosen association display.
Units
Tile area represents contingency count or grand-total share. Residual shading, if present, is a different statistic.
Example of the input layout: Long tableA long table: one row per observation, few columns. New data adds rows.CategoryACategoryBCountAABBC
A long table: one row per observation, few columns. New data adds rows.

Worked example

Counts A-Yes 30, A-No 10, B-Yes 20, B-No 40 total 100. Tiles occupy 30%,10%,20%,40%; group composition differs.

CategoryACategoryBCount
AYes30
ANo10
BYes20
BNo40