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
Questionquantitativecategorical
What are the values?counts, measurementscategories
Examplesage, weight, pricecolor, transport, hometown
Does calculating make sense?yesno
What can you do?difference, double, averagecount 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.

  1. Age in years: 41. Someone who is 35 is 6 years younger. Quantitative.
  2. Distance in km: 9. A commute of 18 km is twice as long. Quantitative.
  3. 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?

  1. Difference: 81667 − 80331 = 1336. 1336 of what? The number measures nothing.
  2. On average: a postal code in between belongs to some area or to none at all.
  3. The postal code names an area, just written in digits. Categorical.
  4. 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

A variable is quantitative if its values are counts or measurements that make sense to calculate with. Otherwise it is categorical: its values are categories, even if they are made of digits.

Tasks

Three tasks complete the lesson. The order does not matter, the text above stays where it is.

Task 1 · Sorting

A data table about apartments has these variables. Which kind is each one?

Drag every card into its group, or tap the group.

6 cards left

Base rent in euros

Task 2 · Choice

Refrigerators have an energy efficiency class from A to G. Which kind of variable is that?

One answer is right.

Task 3 · Several right

A table about packages has the variables weight in kg and tracking number. Which are true?

Several answers are right. Pick all of them.

Go deeper

Three more tasks, optional. They do not count for completing the lesson.

Task 4 · Several right · optional

A survey collects transport and distance in km. Which questions can it sensibly answer?

Several answers are right. Pick all of them.

Task 5 · Choice · optional

Which of these variables is quantitative?

One answer is right.

Task 6 · Sorting · optional

Quantitative, or categories with or without an order? Sort each variable.

Drag every card into its group, or tap the group.

6 cards left

Coffee size: small, medium, large

Back to the chapter