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 but the survey was of 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 people who visited a museum, sorted by ticket type and by whether they went into the special exhibition.
| Went in | Did not go in | Total | |
|---|---|---|---|
| Adult | |||
| Child | |||
| Concession | |||
| Total |
- Adult row: , so the gap is .
- Concession row: , so the gap is .
- The "Went in" column now has one gap: , so it is .
- Child row: it now reads and , so its total is .
- "Did not go in" column: .
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 next to the ". Watch what that does. The Child row total becomes , so the grand total from the rows is , not . And the "Went in" column becomes , not the printed. Two separate contradictions, from one guess. The table is not being fussy — the guess was simply wrong, and 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, looks like a calculation. But that cell lives inside the Adult row, and the whole Adult row is only 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: . 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 , write the other as , fill in every cell you still can by subtraction, and then one row or column total gives you an equation in . If members are left to share between the two drinks, then , so and the other cell is . Notice what did not work: splitting the equally as and , which ignores the "three times", or writing and , 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.