Leave lesson

Statistics · Data representation

1 / 17

Two-way tables

Why every person in a two-way table is counted exactly once, so the rows, the columns and the grand total all have to agree — and why completing a table is never guesswork: you find the row or column with a single gap and work outwards.

Statistics · Data representation

Two-way tables

Why every person in a two-way table is counted exactly once, so the rows, the columns and the grand total all have to agree — and why completing a table is never guesswork: you find the row or column with a single gap and work outwards.

Why it works

An ordinary frequency table sorts a group by one question: how many chose each option. A two-way table sorts the same group by two questions at once. Each row heading answers the first question, each column heading answers the second, and every single member of the group lands in exactly one cell — never two, never none.

That one sentence is the whole subject. Everything else falls out of it.

Why the totals have to agree. Because each person sits in exactly one cell, adding up the cells along a row counts everybody in that row exactly once — so the row total must be the cells of that row added up. The same argument runs down a column. And now the grand total can be reached by two completely different routes: add the row totals, or add the column totals. Both routes count every person once, so both must give the same number.

This is why a two-way table checks itself. If your row totals add to 210210 but the survey was of 200200 people, nobody has to tell you there is a mistake — the table has already said so.

Completing a table: never guess, work outwards. Here is a partly-filled table for 150150 people who visited a museum, sorted by ticket type and by whether they went into the special exhibition.
Went inDid not go inTotal
Adult42427575
Child2727
Concession12123030
Total7272150150
The method is a single instruction: find a row or a column with exactly one empty cell, because that cell is then forced. One gap in a line means one unknown in an addition whose answer you already know, and an addition with one unknown has exactly one solution. There is nothing to choose.
  • Adult row: 42+=7542 + \square = 75, so the gap is 7542=3375 - 42 = 33.
  • Concession row: 12+=3012 + \square = 30, so the gap is 3012=1830 - 12 = 18.
  • The "Went in" column now has one gap: 42++12=7242 + \square + 12 = 72, so it is 1818.
  • Child row: it now reads 1818 and 2727, so its total is 18+27=4518 + 27 = 45.
  • "Did not go in" column: 33+27+18=7833 + 27 + 18 = 78.
Then re-add everything: 75+45+30=15075 + 45 + 30 = 150 ✓ and 72+78=15072 + 78 = 150 ✓. Two independent routes to 150150, so the table is consistent.

The trap, made concrete. Suppose instead you start at the Child row, which looks inviting because it is nearly empty. It has two gaps, so nothing is forced, and the temptation is to invent something reasonable — "children are probably about half and half, so put 2727 next to the 2727". Watch what that does. The Child row total becomes 5454, so the grand total from the rows is 75+54+30=15975 + 54 + 30 = 159, not 150150. And the "Went in" column becomes 42+27+12=8142 + 27 + 12 = 81, not the 7272 printed. Two separate contradictions, from one guess. The table is not being fussy — the guess was simply wrong, and 1818 was the only number that ever fitted.

A second, quieter trap is subtracting from the wrong total. For the Adult "Did not go in" cell, 15042=108150 - 42 = 108 looks like a calculation. But that cell lives inside the Adult row, and the whole Adult row is only 7575 people — a piece of something cannot be bigger than the thing itself. A cell is completed from its own row total or its own column total, never from the grand total.

Building a table from words. When the data arrives as prose, draw the empty grid first — row headings, column headings, and a Total row and Total column — then place each number where it belongs. The order the facts are given in is almost never the order you fill them in, which is exactly why you draw the grid first and then hunt for single gaps.

Combining cells. A "how many..." question is one of three moves: read one cell, add several cells, or subtract from a total. "How many visitors were not adults and did not go into the exhibition?" adds two cells: 27+18=4527 + 18 = 45. The one thing you must not do is add the Total row or Total column into your count — those numbers are not extra people, they are the same people counted twice.

When a relationship replaces a number. Sometimes a fact is given as a comparison rather than a count: *"three times as many of the members chose tea as chose coffee"*. Nothing new is needed. Call one of those cells xx, write the other as 3x3x, fill in every cell you still can by subtraction, and then one row or column total gives you an equation in xx. If 6060 members are left to share between the two drinks, then x+3x=60x + 3x = 60, so x=15x = 15 and the other cell is 4545. Notice what did not work: splitting the 6060 equally as 3030 and 3030, which ignores the "three times", or writing 6060 and 180180, which ignores the total. A letter simply holds one cell's place until the totals pin it down.

Finish by re-adding every row, every column, and the grand total both ways.