Lesson 2 of 8 · 14 min

Two-way frequency tables

Organise two categorical variables in a two-way frequency table, find its row and column sums, fill in missing values, and calculate percentages of the right total.

What you will be able to do

  • Construct a two-way frequency table from raw data.
  • Calculate row sums, column sums and the grand total, and use them to find missing values.
  • Calculate a count as a percentage of its row total, its column total or the grand total.

A Brisbane school surveyed 200 senior students, recording each student's year level and where they do most of their study: at home, in a public library, or at school.

A list of 200 pairs like Year 11, home hides any pattern. A two-way frequency table counts how many students fall into each combination of categories, with one variable across the top and the other down the side.

The row sums (right) and column sums (bottom) are shaded. The grand total, 200, sits in the corner: it is the sum of the row sums and also the sum of the column sums.

Definition

Row sums, column sums and the grand total

  • A row sum adds the counts across a row: 66+30+24=12066 + 30 + 24 = 120 Year 11 students.
  • A column sum adds the counts down a column: 66+28=9466 + 28 = 94 students study at home.
  • The grand total is the number of individuals: 120+80=200120 + 80 = 200, and also 94+66+40=20094 + 66 + 40 = 200.

If the row sums and the column sums don't give the same grand total, a count is wrong somewhere.

Worked example

Build a two-way frequency table from raw data

  • Simple familiar

Twenty senior students were asked their year level and where they do most of their study: home (H), library (L) or school (S). Their responses were

11H, 12L, 11H, 11S, 12H, 11L, 12L, 11H, 12S, 11H, 12L, 11L, 11H, 12H, 11S, 12L, 11H, 12S, 11L, 12H.

Construct a two-way frequency table with row and column sums.

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Put one variable's categories down the side and the other's across the top, with Total row and column.

  2. Tally each individual into exactly one cell.

  3. Add across for row sums and down for column sums.

  4. Check both routes give the same grand total, equal to the number surveyed.

Watch out for

  • Skipping a response or counting one twice. Cross each response off as you tally it.

Because every row and every column has to add up, you can find a missing count from the others. A missing cell is its row sum minus the other cells in that row — or its column sum minus the other cells in that column.

Part of a two-way frequency table from a survey of Year 11 students is shown. Find the value of aa.

Year levelBusCarWalk or cycleTotal
Year 1142aa1895

Worked example

Complete a two-way table and find a percentage

  • Complex familiar
  • Technology active

A survey of 160 visitors to a Sunshine Coast beach recorded where each visitor lives and their main activity at the beach.

Home stateSwimmingSurfingWalkingTotal
Queensland38aa2795
Interstatebb12ccdd
Total7042ee160

(a) Find the values of aa, bb, cc, dd and ee.

(b) What percentage of interstate visitors were mainly surfing? Give your answer correct to one decimal place.

6 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Start with a row or column that has only one missing value.

  2. Use each answer to unlock the next row or column.

  3. Check with a row or column you haven't used.

  4. For a percentage, divide by the total of the group named after "percentage of".

Watch out for

  • Dividing 12 by the Surfing total (42) instead of the interstate total (65). That gives the percentage of surfers who live interstate — a different question.

Counts tell you how many. Percentages let you compare. Each count in a two-way table can be written as a percentage of three different totals — and each one answers a different question.

Three percentages for the same cell: the 66 Year 11 students who study at home.
QuestionDivide byPercentage
What percentage of all the students surveyed are Year 11s who study at home?the grand total, 20066200×100%=33%\frac{66}{200} \times 100\% = 33\%
What percentage of Year 11 students study at home?the Year 11 row sum, 12066120×100%=55%\frac{66}{120} \times 100\% = 55\%
What percentage of students who study at home are in Year 11?the Home column sum, 946694×100%≈70.2%\frac{66}{94} \times 100\% \approx 70.2\%

Tip

Read the words after "percentage of"

"What percentage of Year 11 students …" means divide by the number of Year 11 students. The group named after of is the total you divide by.

Use the study location table. What percentage of Year 12 students study in a library?

in \%

Use the study location table. Which calculation gives the percentage of the students who study at school that are in Year 12?

Choose one answer

Common mistake

Dividing by the wrong total

Most lost marks in two-way tables come from dividing by the wrong total. Before you calculate, say the group out loud — "of the Year 12 students", "of the students who study at home" — and find that group's total in the table.

Summary

  • A two-way frequency table counts the individuals in each combination of the categories of two categorical variables.

  • Row sums add across, column sums add down, and both lead to the same grand total.

  • A missing count is its row (or column) sum minus the other counts in that row (or column).

  • A count can be a percentage of the grand total, its row sum or its column sum. The words after "percentage of" tell you which.

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 2 of 80% read

Save your progress with a free account