Bivariate data and two-way frequency tables
Learn to handle bivariate data and two-way frequency tables in Year 12 General Mathematics for Queensland (QCAA). When a council surveys residents on where they live and whether they back a new bikeway, every answer comes as a pair. Sorting those pairs into a neat table of counts is the first step to seeing what the survey really says.
You will practise telling categorical data from numerical data, filling in a table from a list or a short description, finding missing entries from totals, and working out row, column and grand-total percentages without mixing up the denominator. These tables lead straight into the next idea: using percentages to decide whether two categorical variables are associated.
Theory
Bivariate data records two variables for each individual. This Year 12 General Mathematics guide for Queensland students shows how to sort categorical data into a two-way frequency table, complete row and column totals, and calculate row, column and grand-total percentages.
Bivariate data comes from recording two variables for every individual in a group, such as each student's year level and how they get to school. Each variable can be categorical (the values are groups or labels, like “bus” or “car”) or numerical (the values are counts or measurements, like a height in centimetres).
When both variables are categorical, the data is summarised in a two-way frequency table. The categories of one variable label the rows, the categories of the other label the columns, and each cell holds the number of individuals who fall into both categories at once.
A row total adds across a row and a column total adds down a column. The row totals and the column totals both add to the grand total, the size of the whole group. Counts can then be turned into row percentages, column percentages or percentages of the grand total.
Every percentage in a two-way table is a cell count divided by a total:
The totals always balance, which gives a quick check on any completed table:
How to build and use a two-way frequency table
- Name the two categorical variables and list the categories of each.
- Draw the table: one variable's categories across the top, the other's down the side, plus a Total row and a Total column.
- Fill the cells by tallying, or from the information given. If you are given percentages, turn each into a count first: count \(=\) percentage \(\times\) the total of its group (for example, \(45\%\) of \(160\) is \(72\)). For a missing entry, use a row or column that has only one gap.
- Add each row and each column, then check that both sets of totals give the grand total.
- Convert to a percentage by dividing the cell by the total of the group named in the question, then multiplying by \(100\%\).
Count the variables recorded for each student, then look at the type of each value.
| \(\text{2 variables per student}\) | \(\Rightarrow\) | \(\text{bivariate}\) |
| \(\text{age group: labels}\) | \(\Rightarrow\) | \(\text{categorical}\) |
| \(\text{stood up: yes/no}\) | \(\Rightarrow\) | \(\text{categorical}\) |
| \(\text{cells}\) | \(=\) | \(3 \times 2\) |
| \(\text{cells}\) | \(=\) | \(6\) |
(a) Yes, it is bivariate. (b) Both variables are categorical. (c) The table needs 6 cells.
| Walks daily | Does not | Total | |
|---|---|---|---|
| Owns a dog | 54 | ? | 80 |
| No dog | ? | 70 | ? |
| Total | ? | ? | 180 |
Start with a row or column that has only one gap.
| \(\text{dog, does not}\) | \(=\) | \(80-54\) |
| \(\text{dog, does not}\) | \(=\) | \(26\) |
| \(\text{no dog total}\) | \(=\) | \(180-80\) |
| \(\text{no dog total}\) | \(=\) | \(100\) |
| \(\text{no dog, walks}\) | \(=\) | \(100-70\) |
| \(\text{no dog, walks}\) | \(=\) | \(30\) |
| \(\text{walks total}\) | \(=\) | \(54+30\) |
| \(\text{walks total}\) | \(=\) | \(84\) |
| \(\text{does not total}\) | \(=\) | \(26+70\) |
| \(\text{does not total}\) | \(=\) | \(96\) |
| \(\text{check: } 84+96\) | \(=\) | \(180\) |
| Walks daily | Does not | Total | |
|---|---|---|---|
| Owns a dog | 54 | 26 | 80 |
| No dog | 30 | 70 | 100 |
| Total | 84 | 96 | 180 |
Place the four given numbers, then fill each gap from a row or column total.
| \(\text{from elsewhere}\) | \(=\) | \(320-180\) |
| \(\text{from elsewhere}\) | \(=\) | \(140\) |
| \(\text{elsewhere, garden}\) | \(=\) | \(200-95\) |
| \(\text{elsewhere, garden}\) | \(=\) | \(105\) |
| \(\text{local, no garden}\) | \(=\) | \(180-95\) |
| \(\text{local, no garden}\) | \(=\) | \(85\) |
| \(\text{elsewhere, no garden}\) | \(=\) | \(140-105\) |
| \(\text{elsewhere, no garden}\) | \(=\) | \(35\) |
| Garden displays | No garden displays | Total | |
|---|---|---|---|
| Local | 95 | 85 | 180 |
| From elsewhere | 105 | 35 | 140 |
| Total | 200 | 120 | 320 |
35 visitors from elsewhere did not go to the garden displays.
| Tank | No tank | Total | |
|---|---|---|---|
| Owner | 168 | 72 | 240 |
| Renter | 33 | 77 | 110 |
| Total | 201 | 149 | 350 |
The cell is chosen by the question; the total is the group the question is “out of”.
| \(\text{(a) owners}\) | \(=\) | \(\dfrac{168}{240}\times 100\%\) |
| \(\) | \(=\) | \(0.7\times 100\%\) |
| \(\) | \(=\) | \(70\%\) |
| \(\text{(b) tank households}\) | \(=\) | \(\dfrac{33}{201}\times 100\%\) |
| \(\) | \(\approx\) | \(16.4\%\) |
| \(\text{(c) all households}\) | \(=\) | \(\dfrac{33}{350}\times 100\%\) |
| \(\) | \(\approx\) | \(9.4\%\) |
(a) 70% is a row percentage. (b) 16.4% is a column percentage. (c) 9.4% is a percentage of the grand total.
Common pitfalls
Frequently asked questions
What is bivariate data?
Bivariate data is data where two variables are recorded for each individual, for example each student's year level and their usual way of travelling to school. Having both values for the same individual lets you look for a relationship between the two variables.
What is a two-way frequency table?
It is a table that counts how many individuals fall into each combination of two categorical variables. One variable labels the rows, the other labels the columns, and the totals are shown in an extra row and column.
How do you calculate a row percentage?
Divide the cell count by the total of its own row and multiply by 100%. For example, if 42 of the 90 people in a row chose the beach, the row percentage is 42 divided by 90 times 100%, about 46.7%.
What is the difference between a row percentage and a column percentage?
A row percentage compares a cell with its row total, so each row adds to 100%. A column percentage compares the cell with its column total, so each column adds to 100%. The question tells you which group the percentage is out of.
How do you find a missing value in a two-way table?
Find a row or column with only one unknown entry. Subtract the known entries from that row or column total. Repeat until the table is full, then check that the row totals and column totals both add to the grand total.