You've surveyed the whole year group: how do they get to school — walk, cycle, or bus? — and you also noted whether each was a boy or a girl. Now the questions pour in. How many girls cycle? What fraction of everyone walks? Are boys more likely to take the bus than girls? A long list of answers would take all evening to sift.
A two-way table tames the lot. It sorts data classified two ways at once into a neat grid, and the row and column totals in the margins unlock every one of those questions with a glance and a quick division.
A two-way table sorts data by two categories at once: one runs across the columns, the other down the rows. Each inner cell is a count of items that match both labels — its row label and its column label. The totals sit in the margins: a Total column on the right adds up each row, a Total row along the bottom adds up each column.
Suppose we ask every pupil in a class whether they walk, take the bus, or come by car, and we split that by boys and girls. One category (travel) goes across, the other (boys/girls) goes down:
| Walk | Bus | Car | Total | |
|---|---|---|---|---|
| Boys | 8 | 5 | 2 | 15 |
| Girls | 6 | 7 | 2 | 15 |
| Total | 14 | 12 | 4 | 30 |
Read across the boys' row:
A blank cell is never a mystery — it's forced by its line's total. Here three cells are missing
(shown as
| Walk | Cycle | Bus | Total | |
|---|---|---|---|---|
| Boys | 9 | ? | 7 | 20 |
| Girls | 11 | 3 | ? | 20 |
| Total | ? | 7 | 13 | 40 |
With the table above complete, pick a pupil at random from all
Now a subtler question — "of the girls, what fraction walk?" — restricts us to the girls only,
so we divide by the girls' row total, not the grand total:
A count on its own can mislead when the groups differ in size, so statisticians compare
proportions. Using worked example 1 (each row totals
Walk is
The classic two-way-table trap is dividing by the wrong total. Look carefully at the words "out of":
Same cell on top, different denominator — and very different answers
(
Two-way tables have a fancier name in the wild: contingency tables, and they're the workhorse of real data analysis. Every census, medical study, and market survey ends up summarised in one — counts of people split by two things at once.
Their real power is comparison. When statisticians line up the proportions across the rows and columns, they're hunting for whether two things are associated: does taking a treatment relate to recovering? Does the advert relate to buying? If the row proportions differ, something's going on. That simple grid of counts is the very first step toward serious statistical inference.