๐Ÿ“Š Statistics Steppe ยท Statistics

Two-Way Tables

Cross two yes-or-no questions in one table, turn the counts into relative frequencies by row or column, and say whether the answers to one question lean on the other.

In short

  • A two-way table sorts one group by two yes-or-no questions at once: the four cells satisfy both descriptions, the marginal totals satisfy one, and both pairs of margins add to the same grand total.
  • To complete a table, hunt for a line with exactly one gap and close it by subtracting; filling that gap usually leaves another line with one gap, and so on until the table is full.
  • Joint divides a cell by the grand total, marginal divides a margin by the grand total, and conditional divides a cell by its own row or column total. The words "of all the ..." and "of the ones who ..." tell you which.
  • Association is judged by comparing a conditional relative frequency across the rows: clearly different rates suggest the two questions lean on each other, close rates suggest they do not.
  • A table can show that two things travel together, but never that one of them causes the other.

One group, two questions

A two-way table is what you get when the same group of people is asked two yes-or-no questions and sorted by both answers at once. One question becomes the rows, the other becomes the columns, and every person lands in exactly one of the four inner boxes.

Here are 100 campers at Tally Camp, asked whether they like archery and whether they like fishing.

  • The archery row: 30 of them also like fishing, 20 do not, and the row totals 50.
  • The no-archery row: 12 of them like fishing, 38 do not, and that row totals 50 as well.
  • The column totals underneath: 42 campers like fishing, 58 do not, and 100 campers were asked.

The four inner numbers are the cells. The four numbers along the edges are the marginal totals โ€” "marginal" because they live in the margin of the table. The 100 in the corner is the grand total, and it is the one number every other line has to agree with: the two row totals add to it, and so do the two column totals.

That double agreement is the whole engine of this skill. It means a table can be finished from partial information, and it means every answer you take out of one can be checked against a second line.

Completing a table you were not given whole

Suppose some entries have been rubbed out. You do not need clever reasoning โ€” you need a line with exactly one gap in it, because a single gap is a subtraction.

Take a row total of 50 with one of its cells showing 30. The other cell has to be 50 - 30 = 20, because a row is only ever its two cells added together. The same is true down a column, and true again for the Total column, whose two row totals add to the grand total.

The method, then, is a loop:

  • Look along every row, down every column, and down the Total column.
  • Find a line with one gap and close it by subtracting.
  • Write the new number in. A line that had two gaps a moment ago now has one.
  • Repeat until the table is full, then check that every line still adds up.

Sometimes a description arrives as sentences instead of a grid โ€” "Of the 40 campers, 25 like archery; 10 of the archers also like fishing; 18 campers in all like fishing." Draw the empty grid first and place each sentence where it belongs. "25 like archery" is a row total. "18 in all like fishing" is a column total. The sentence starting "10 of the archers also..." is a single cell, because it satisfies both descriptions at once. Getting that third one into a total instead of a cell is the commonest way a table goes wrong before any arithmetic starts.

Three relative frequencies, three different totals

A relative frequency is a count divided by a total, written as a fraction, a decimal or a percent. All the difficulty is in choosing which total goes underneath, and there are exactly three sensible choices.

  • A joint relative frequency divides a cell by the grand total: 30 out of 100 campers both like archery and like fishing, which is 30/100 = 30 %.
  • A marginal relative frequency divides a marginal total by the grand total: 42 out of 100 campers like fishing, which is 42 %.
  • A conditional relative frequency divides a cell by its own row or column total: of the 50 campers who like archery, 30 like fishing, which is 30/50 = 60 %.

Look at those two numbers, 30 % and 60 %. They came from the same cell. The joint one says "30 % of everybody"; the conditional one says "60 % of the archers". Both are true, and they answer different questions.

The words in the question tell you which one is wanted. "Of all the campers" means the grand total. "Of the campers who like archery" means that row alone โ€” everyone outside it, grand total included, is out of the question. A row's conditional relative frequencies always add to 100 %, which is a quick check that you divided by the right thing.

Judging association

Two variables are associated when knowing the answer to one question changes what you would expect for the other. A two-way table answers that by comparing a conditional relative frequency across the rows.

In the camp table: 30 of the 50 archers like fishing, which is 60 %. Of the 50 non-archers, 12 like fishing, which is 24 %. Sixty against twenty-four is a wide gap, so the table suggests archery and fishing go together at this camp.

Compare rates, never the raw counts. If one row simply holds more people, it will hold more of everything, and the bigger cell proves nothing at all. A row of 60 campers with 30 fishers (50 %) and a row of 20 campers with 15 fishers (75 %) has its larger count and its larger rate in different rows โ€” the rate is the one that answers the question.

If the two rates come out close together, the honest conclusion is that the table shows no clear association. And whichever way it comes out, a two-way table shows that two things travel together; it never shows that one causes the other. Campers who like archery may like fishing because both are taught by the same patient instructor on the same afternoon.

Worked examples

Example 1

Of the 40 campers surveyed, 25 like archery. Of those 25, ten also like fishing. Altogether 18 campers like fishing. How many campers like neither archery nor fishing?

  1. Draw the grid: rows for archery and no archery, columns for fishing and no fishing, with a Total row and a Total column around them.
  2. Place the three facts. Archery row total = 25. Archery-and-fishing cell = 10. Fishing column total = 18. Grand total = 40.
  3. The Total column has one gap: the no-archery row total is 40 - 25 = 15.
  4. The fishing column now has one gap: the no-archery-and-fishing cell is 18 - 10 = 8.
  5. The no-archery row now has one gap, and that gap is what the question asked for: 15 - 8 = 7 campers.
  6. Check every line: 10 + 15 = 25 across the top row, 8 + 7 = 15 across the second, and 25 + 15 = 40 down the side. The table balances, so 7 campers like neither.

Example 2

A table of 120 herders records 45 who keep goats and own a horse, 15 who keep goats and own no horse, 24 who keep no goats but own a horse, and 36 who keep no goats and own no horse. Of the herders who keep goats, what percent own a horse? Is there an association?

  1. Find the row totals first. Goats: 45 + 15 = 60. No goats: 24 + 36 = 60. Together that is 120, which matches the grand total.
  2. The words "of the herders who keep goats" name the Goats row, so 60 is the total that goes underneath โ€” not 120.
  3. 45/60 = 0.75, and 0.75 x 100 = 75 %. So 75 % of the goat-keepers own a horse.
  4. For the comparison, do the same for the other row: 24/60 = 0.4, which is 40 %.
  5. 75 % against 40 % is a gap of 35 percentage points, far too wide to shrug at, so the table does suggest an association: horse-owning is more common among the herders who keep goats.
  6. Notice what the joint relative frequency would have said instead: 45/120 = 37.5 %. True, but an answer to a different question, and useless for comparing the two rows.

Example 3

In a table of 200 traders, 60 travel by wagon and trade in salt, and 90 traders in all trade in salt. What percent of all the traders trade in salt, and what percent of the salt traders travel by wagon?

  1. The first question says "of all the traders", so the grand total 200 goes underneath: that is a marginal relative frequency.
  2. 90/200 = 0.45, so 45 % of all the traders trade in salt.
  3. The second question says "of the salt traders", so the Salt column total 90 goes underneath instead: that is a conditional relative frequency.
  4. 60/90 = 0.666..., which is about 66.7 %.
  5. The same cell, 60, sat on top both times. Only the total underneath changed, and the answer moved from 45 % to 66.7 %, which is why naming the group before dividing matters so much.

Practice problems, with solutions

Three problems of increasing difficulty, each with the full working. In the game these are generated fresh every time; these three are fixed so this page always shows the same ones.

Problem 1

Difficulty 1 of 5

Every trader at Dice Landing was recorded twice over: by whether they travel by wagon, and by whether they trade in salt. Some entries have been rubbed off the slate. How many traders do not travel by wagon and do not trade in salt?

Answer: 2 traders

  1. Its row has to add across to 12, and the other entry in that row is 10.
  2. 12 - 10 = 2
  3. Check down the column instead: 2 + 5 = 7, which is exactly that column's total.
  4. So the answer is 2 traders.

Problem 2

Difficulty 3 of 5

Of the 50 traders counted at Dice Landing, 40 traders travel by wagon. Of those, 34 traders also trade in salt. Altogether 39 traders trade in salt. How many traders do not travel by wagon and do not trade in salt?

Answer: 5 traders

  1. Grand total 50; the Wagon row totals 40; the Wagon / Salt cell is 34; the Salt column totals 39.
  2. The No wagon row total is 50 - 40 = 10.
  3. The No wagon / Salt cell is 39 - 34 = 5.
  4. 10 - 5 = 5
  5. So the answer is 5 traders.

Problem 3

Difficulty 4 of 5

Every trader at Dice Landing was recorded twice over: by whether they travel by wagon, and by whether they trade in salt. What fraction of all the traders both travel by wagon and trade in salt? Give the answer as a fraction in lowest terms.

Answer: 1/10

  1. The cell where Wagon meets Salt holds 25.
  2. Everyone in the table comes to 250, so the relative frequency is 25/250.
  3. The greatest common factor of 25 and 250 is 25, so 25/250 = 1/10.

Common mistakes

  • Dividing by the grand total when the question said "of the campers who like archery". That gives a joint relative frequency, and it is always smaller than the conditional one the question wanted.
  • Comparing the raw counts in two cells instead of the rates. A row that holds more people holds more of everything, so the bigger count on its own says nothing about association.
  • Reading the table the other way round: "of the archers, what percent fish" and "of the fishers, what percent do archery" divide by different totals and are usually different numbers.
  • Treating a sentence like "10 of the archers also like fishing" as a column total. It describes a single cell, because it satisfies both descriptions at once.
  • Stopping at a percent without checking the line it came from. Each row of conditional relative frequencies should add to 100 %, and every row and column of counts should add to its total.

What you should be able to do

  • Complete a two-way table from a description using row and column totals.
  • Compute joint, marginal and conditional relative frequencies as fractions or percents.
  • Compare a conditional relative frequency across rows to decide whether there is an association.
  • Build a two-way table from survey results and read it critically.

Where this fits in the curriculum

Common Core

  • 8.SP.A.4

    Grade 8 โ€” Construct and interpret a two-way table of frequencies for two categorical variables, and use relative frequencies to describe association.

  • HSS-ID.B.5

    High school โ€” Summarise categorical data for two categories in two-way frequency tables, and interpret joint, marginal and conditional relative frequencies.

SAT

Learn these first