Categorical and Quantitative Variables
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.”
- Eye color
- Number of siblings
- ZIP code
- Height in centimeters
- Class standing (first year, sophomore, junior, senior)
- 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.
- Membership ID. Written with digits, but the average of two IDs identifies no participant. Adding IDs is meaningless. Categorical.
- Sex. Values are group names (Female, Male, and any other recorded categories). No arithmetic. Categorical.
- Age in years. The average age of the participants is a sensible summary, and years are a unit of measurement. Quantitative.
- Preferred workout. Values name a group (Cycling, Running, Swimming). Categorical.
- Resting heart rate. Beats per minute is a unit, and an average heart rate is meaningful. Quantitative.
- Shirt size. Small, Medium, Large are group names, not numbers. Categorical.
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
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.
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.
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
Classify each variable as categorical or quantitative.
(a) Favorite ice cream flavor (b) Weight of a backpack in kilograms (c) Country of birth
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.
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.
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.
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
Mental Model
The two-question filter.
For any column, ask two questions in order.
- Is each value a group name or a measured amount?
- 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:
- Individuals and Variables names the rows and columns this skill classifies.
- Proportions and Percentages supplies the counts-and-percentages summary used for categorical data.
Looking ahead:
- Displaying Categorical Data: Bar and Pie and Histograms are the displays selected by the type decision.
- Distribution of a Variable describes the pattern of values, with a different description for each type.
Real-world connections:
- A survey platform must decide, for each question, whether responses are categories to be counted or amounts to be averaged.
- A spreadsheet that codes categories as numbers (0 and 1) hides the type, which is a common source of wrong summaries in reports.
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