← MATH 380 MathScape 0 MATH380

Categorical and Quantitative Variables

14 min read

Jump to a section

Quick Reference

Textbook: Moore, McCabe, and Craig, Introduction to the Practice of Statistics (IPS), 9th edition. Location: Chapter 1 (Looking at Data: Distributions), Section 1.1 (Data), subsection “Categorical and quantitative variables.” Pages: Page numbers pending faculty verification. Role in the course: First sorting decision of the term. Every display, summary, and inference choice later in the course branches on whether a variable is categorical or quantitative.


Try This First

📋 A two-minute warmup before any definition (click to open)

A survey records six facts about each student in a class. Sort these six into two piles, “you would describe a typical value with a category name” and “you would describe a typical value with a number you could average.”

  1. Eye color
  2. Number of siblings
  3. ZIP code
  4. Height in centimeters
  5. Class standing (first year, sophomore, junior, senior)
  6. Resting heart rate in beats per minute
Compare your two piles

Category-name pile: eye color, ZIP code, class standing.

Number-you-could-average pile: number of siblings, height, resting heart rate.

The tricky one is ZIP code. It is written with digits, yet averaging two ZIP codes produces a meaningless result. Hold onto that puzzle. The section below explains why a string of digits is not automatically a quantitative variable.

A statistics problem starts with a data table. Each row is one individual, and each column is one variable recorded for that individual. Before any graph or average, one decision shapes everything that follows: is the column a label that sorts each individual into a group, or a measured amount that supports arithmetic? That single fork is the subject of this skill.

The reason the fork matters is practical. A category column is summarized by counting how many individuals fall in each group, and it is displayed with a bar graph or a pie chart. A measured column is summarized by a center and a spread, and it is displayed with a histogram or a stemplot. Choosing the wrong pile leads to a meaningless summary, such as the average of a set of ZIP codes.


Prerequisite Hub

Builds on

Skill Why it comes first
Individuals and Variables A variable is the column recorded for each individual. The type question only makes sense once the variable is identified.
Proportions and Percentages Categorical data are reported as counts and the percentage of individuals in each group.

Unlocks

Skill What this enables
Displaying Categorical Data: Bar and Pie The correct display for a categorical variable.
Histograms The correct display for a quantitative variable.
Stemplots A second display for a small quantitative data set.
Distribution of a Variable The pattern of values a variable takes, described differently for each type.

Cross-course prerequisites: none.

Prerequisite Map


Quick Reference

Property Value
Chapter.Section IPS 1.1
Course MATH380
Difficulty Introductory
Time ~20 minutes

The Two Types at a Glance

Categorical variable Quantitative variable
What a value is A group or category A numerical measurement
Typical examples Eye color, sex, brand, class standing Height, age, count of siblings, heart rate
Summarized by Counts and percentages in each group Center and spread (mean, median, range)
Displayed with Bar graph, pie chart Histogram, stemplot
Sound check Does averaging the values make sense? If no, categorical Does averaging the values make sense? If yes, quantitative

Official Definitions

Categorical variable.

A categorical variable places an individual into one of several groups or categories.

Source: Moore, McCabe, Craig, IPS 9th edition, Section 1.1 (Data); corroborated by IPS summary sources (a categorical variable places an individual in a group or category).

Quantitative variable.

A quantitative variable takes numerical values for which arithmetic operations such as adding and averaging make sense. The values of a quantitative variable are usually recorded in a unit of measurement such as seconds or kilograms.

Source: Moore, McCabe, Craig, IPS 9th edition, Section 1.1 (Data); corroborated by IPS summary sources (a quantitative variable is a measurement of numerical value).

Read the two definitions side by side. The categorical definition turns on the word “groups.” The quantitative definition turns on the words “arithmetic” and “unit of measurement.” The decisive test is built into the second definition: a variable is quantitative when adding and averaging its values produce a result that means something. That is why ZIP codes, although written with digits, are categorical. The average of two ZIP codes is not a place.

There is no theorem in this section. The two definitions are the entire toolkit, and the skill is applying the arithmetic test correctly to columns that try to disguise their type.


Worked Examples

Example 1: Sorting the columns of a data table

A fitness study records the following for each participant.

Variable Sample value
Membership ID 4417
Sex Female
Age in years 34
Preferred workout Cycling
Resting heart rate (bpm) 62
Shirt size Medium

Predict first. Before reading on, predict how many of the six columns are quantitative. Write your number down.

Now apply the arithmetic test to each column.

Check against your prediction. Two columns are quantitative: age and resting heart rate. The other four are categorical. If you predicted a larger number, the most likely cause is counting Membership ID as quantitative because it looks numeric. The arithmetic test catches that trap.

Example 2: A column of numbers that is not quantitative

A neighborhood dataset stores a column named “House number” with values 312, 318, 401, 407. A classmate proposes computing the average house number to find the “center of the street.”

Predict first. Does the average house number measure anything on the street?

Work it out. The average of 312, 318, 401, and 407 is

$$\bar{x} = \frac{312 + 318 + 401 + 407}{4} = \frac{1438}{4} = 359.5.$$

The arithmetic runs without error, yet 359.5 is not a meaningful midpoint of these houses. House numbers are labels assigned to locations, often skipping values and restarting across a cross street. The fact that the computer returns a number does not make the column quantitative.

Conclusion. “House number” is a categorical variable encoded with digits. The arithmetic test is about whether the result is meaningful, not whether the calculator accepts the input.

Example 3: Counts versus categories

A pediatric clinic records, for each family, the variable “number of children.” Recorded values include 0, 1, 2, 3, and 4.

Predict first. Is a count quantitative or categorical?

Work it out. A count answers “how many,” and arithmetic on counts is meaningful. The average number of children per family,

$$\bar{x} = \frac{0 + 1 + 2 + 3 + 4 + 2 + 1}{7} = \frac{13}{7} \approx 1.86,$$

describes a typical family size, even though no single family has 1.86 children. The unit here is “children,” a counting unit.

Conclusion. “Number of children” is quantitative. It is a discrete quantitative variable, meaning its values are whole-number counts, but it is quantitative because averaging produces a meaningful summary. A count is the most common quantitative variable that beginners mistake for categorical.


Common Misconceptions

Common misconception

any column written with digits is quantitative. The deciding test is the arithmetic in the definition, not the appearance of the values. ZIP codes, phone numbers, membership IDs, and house numbers are all written with digits, yet averaging them produces nothing meaningful. Each one places an individual into a group (a postal region, a phone line, a member account), so each one is categorical. Apply the arithmetic test, not an eyeball test.

Common misconception

a categorical variable becomes quantitative once its categories are coded as numbers. Researchers often record Female as 0 and Male as 1 to store data in a spreadsheet. The codes 0 and 1 are storage labels for groups, not measured amounts. The average of the codes, such as 0.6, does not measure a quantity, it reflects the proportion in one group. Coding a category as a number does not change its type. Predict-then-check: predict what the “average sex code” of 0.6 would mean, then confirm that it only restates the percentage of one group, not a measurement.

Common misconception

an ordered categorical variable is quantitative because its categories can be ranked. Class standing (first year, sophomore, junior, senior) and shirt size (Small, Medium, Large) have a natural order, which tempts beginners to treat them as numbers. Order alone does not supply a unit of measurement or equal spacing. The gap from Small to Medium is not a measured amount the way three centimeters is. An ordered category is still categorical. The course later treats such ordered categories with their own displays, not with a mean.


Practice Problems

Level 1 Name the Type

Classify each variable as categorical or quantitative.

(a) Favorite ice cream flavor (b) Weight of a backpack in kilograms (c) Country of birth

Thought Process

For each one, ask whether a typical value is a group name or a measured amount, then apply the arithmetic test: would averaging the values mean anything?

Show Answer

(a) Categorical. A flavor is a group name; averaging flavors is meaningless.

(b) Quantitative. Kilograms are a unit of measurement, and an average backpack weight is meaningful.

(c) Categorical. A country is a group, not a measured amount.

Level 2 The Digit Trap

A college dataset includes a column “Student ID number” with values such as 882041 and 882065. A classmate says the column is quantitative because every value is a number. Decide whether the classmate is correct and justify your answer.

Thought Process

Run the arithmetic test. Would the average of two student ID numbers identify anything meaningful, or is each ID just a label for one student?

Show Answer

The classmate is incorrect. A student ID number places each individual into a unique account, so it is a label, not a measured amount. The average of two IDs, such as 882053, identifies no student and measures nothing. By the arithmetic test in the definition, the column is categorical even though it is written with digits.

Level 3 Choosing the Right Summary

A researcher has two columns: “Blood type” (O, A, B, AB) and “Systolic blood pressure” in mmHg. Which summary is appropriate for each column?

(A) Report a mean for both columns.

(B) Report counts and percentages for blood type; report a mean and spread for blood pressure.

(C) Report counts and percentages for both columns.

(D) Report a mean for blood type; report counts for blood pressure.

Thought Process

First type each variable. Blood type names a group, so it is categorical. Systolic blood pressure has a unit (mmHg) and a meaningful average, so it is quantitative. Then match each type to its summary: categorical to counts and percentages, quantitative to center and spread.

Show Answer

Answer: (B).

  • Blood type is categorical. It is summarized by counting how many individuals have each type and the percentage in each group. A “mean blood type” is meaningless, which rules out (A) and (D).
  • Systolic blood pressure is quantitative. It is summarized by a center and a spread. Reducing it to counts only, as in (C), discards the measurement information.

Option (B) matches each variable to the summary its type supports.

Level 4 Coded Categories

A spreadsheet stores “Owns a car” as 1 for yes and 0 for no for 10 people, with seven 1s and three 0s. Someone computes the average of the column and gets 0.7, then claims this proves the variable is quantitative. Evaluate the claim and state what 0.7 actually describes.

Thought Process

The values 1 and 0 are codes for two groups, yes and no. Decide whether the codes measure an amount or simply label a category, then interpret what the average of 0 and 1 codes represents.

Show Answer

The claim is wrong. “Owns a car” is a categorical variable with two groups, coded for storage. The codes 0 and 1 are labels, not measured amounts, so coding does not change the type.

The number 0.7 is the average of the codes:

$$\frac{\overbrace{1 + 1 + 1 + 1 + 1 + 1 + 1}^{\text{seven 1s}} + \overbrace{0 + 0 + 0}^{\text{three 0s}}}{10} = \frac{7}{10} = 0.7.$$

This equals the proportion of people who own a car, that is, 70 percent. It is a percentage of a category, not a measurement of a quantity. The average of a 0/1 code recovers a proportion, which is exactly how categorical data are summarized.

Level 5 The Hard Cases

For each variable, classify it as categorical or quantitative, and explain the one feature that settles the decision.

(a) Customer satisfaction rating on a 1-to-5 scale, where 1 means very dissatisfied and 5 means very satisfied (b) Year a coin was minted (for example, 1998) (c) Temperature of a city on a given day, in degrees Celsius (d) Jersey number worn by a basketball player

Thought Process

Each item is designed to test the arithmetic test against a tempting surface feature. For ratings, weigh order against equal spacing. For mint year and jersey number, weigh the digit appearance against whether averaging measures anything. For temperature, confirm a true unit of measurement.

Show Answer

(a) Categorical (ordered). The scale has a clear order, but the gap from 1 to 2 is not guaranteed to be the same measured amount as the gap from 4 to 5, so there is no true unit. Order without equal spacing keeps it categorical. The settling feature is the absence of a measured unit.

(b) Quantitative. A mint year is measured in years, a genuine unit on a time scale, and differences such as “20 years apart” are meaningful. The settling feature is the meaningful difference between two years. (Note that years as a label for grouping, like “minted in the 1990s,” would shift the use toward categorical, so the recorded use matters.)

(c) Quantitative. Degrees Celsius is a unit of measurement, and differences in temperature are meaningful. The settling feature is the genuine measurement unit.

(d) Categorical. A jersey number identifies a player on a roster; the average jersey number names no player and measures nothing. The settling feature is that the arithmetic test fails.


Mental Model

The two-question filter.

For any column, ask two questions in order.

  1. Is each value a group name or a measured amount?
  2. Would adding and averaging the values produce a result that means something?

A measured amount that passes the arithmetic test is quantitative. A group name, even one written with digits, is categorical. The second question is the safety net: it catches ID numbers, ZIP codes, and coded categories that the first question alone might let slip through.


Mastery Checklist

Novice (Level 1-2):

Competent (Level 3-4):

Proficient (Level 5):


Connections

Looking back:

Looking ahead:

Real-world connections:


Resources

Resource Where it points
IPS 9th edition, Section 1.1 (Data) Moore, McCabe, Craig, IPS 9e, Chapter 1, Section 1.1. The primary source for both definitions in this skill.
OpenStax Introductory Statistics 2e, 1.1 Definitions of Statistics, Probability, and Key Terms openstax.org. Free open companion treatment of variable types.


Last updated: 2026-06-16