Lesson 4 of 4 · Open
Numbers or categories
Why a postal code is not a number to calculate with.
A table about the team has two columns that hold only digits: age and postal code. With age, you can say who is ten years older. And with the postal code? Is 81667 bigger than 80331, and what would that mean? You can calculate something with both columns. It only makes sense with one of them.
Two kinds of variables
A variable, that is, a column of the table, is quantitative if its values are counts or measurements: age in years, weight in kg, price in euros, number of children. Calculating with such values makes sense. You can say how much bigger one value is, whether it is twice as big, or what it is on average.
A variable is categorical if its values are names for groups: favorite color, transport, hometown. Such values are called categories. You can count how many fall into each category. But you cannot calculate with them: red plus blue makes nothing, and bus is not twice as much as bike.
New terms
- quantitative variable
- its values are counts or measurements that make sense to calculate with
- categorical variable
- its values are categories, that is, names for groups
- category
- a name for a group, such as bus, red, or Augsburg. You can count who belongs to it
| Question | quantitative | categorical |
|---|---|---|
| What are the values? | counts, measurements | categories |
| Examples | age, weight, price | color, transport, hometown |
| Does calculating make sense? | yes | no |
| What can you do? | difference, double, average | count how many are in each |
Quick check
Variable: length of a phone call in min. Which kind is it?
Example
One row, three variables
In the team survey, Person 2 has: 41 years, bus, 9 km. For each variable you ask whether calculating makes sense.
- Age in years: 41. Someone who is 35 is 6 years younger. Quantitative.
- Distance in km: 9. A commute of 18 km is twice as long. Quantitative.
- Transport: bus. Counting how many take the bus works. Calculating does not. Categorical.
The test question
You cannot tell whether a variable is quantitative by whether there are digits. Ask instead: does the difference of two values make sense? Twice as much? A value on average? If so, the variable is quantitative. It also works the other way: if the cell says three instead of 3, the number of children is still quantitative.
Digits that count nothing
Example
Two postal codes
Two people on the team live in areas with the postal codes 80331 and 81667. What does calculating give you?
- Difference: 81667 − 80331 = 1336. 1336 of what? The number measures nothing.
- On average: a postal code in between belongs to some area or to none at all.
- The postal code names an area, just written in digits. Categorical.
- The same goes for phone numbers and house numbers: they name something, they count nothing.
Categories can have an order. With clothing sizes S, M, L, XL, M is bigger than S. They are still categories: the size does not say how much bigger M is, and M plus S makes no size. The variable stays categorical.
Typical mistake
Taking a variable for quantitative just because there are digits in the cells. Then you could add up the phone numbers on the team and work out an average phone number. Who would you be calling? What matters is not what the values look like, but whether calculating with them means anything.
Remember
Tasks
Task 1 · Sorting
A data table about apartments has these variables. Which kind is each one?
6 cards left
Task 2 · Choice
Refrigerators have an energy efficiency class from A to G. Which kind of variable is that?
Task 3 · Several right
A table about packages has the variables weight in kg and tracking number. Which are true?
Go deeper
Task 4 · Several right · optional
A survey collects transport and distance in km. Which questions can it sensibly answer?
Task 5 · Choice · optional
Which of these variables is quantitative?
Task 6 · Sorting · optional
Quantitative, or categories with or without an order? Sort each variable.
6 cards left