Categorical vs quantitative variables (with examples)

By Jude Wallis · Published

A categorical (qualitative) variable records a label or group name, like eye color or zip code. A quantitative (numerical) variable records a number for a measured or counted quantity, like height or number of siblings. Quick test: if averaging the values means something, it is quantitative.

AP Statistics: Unit 1 (topics 1.2 Variables, 1.4 Graphical Representations for One Categorical Variable, 1.5 Graphical Representations for One Quantitative Variable). The categorical vs quantitative distinction, and the discrete vs continuous split for quantitative variables, are defined in Unit 1 topic 1.2 of the Fall 2026 AP Statistics course. Topics 1.4 and 1.5 cover the graphs that fit each type.

Categorical vs quantitative: the short answer

A categorical variable, also called a qualitative variable, records a label or group name. Eye color, home state, letter grade, and yes-or-no answers are all categorical. A quantitative variable, also called a numerical variable, records a number for a measured or counted quantity, and it usually comes with units. Height in centimeters, number of siblings, and test score are quantitative.

The AP course uses both names for each type, so treat "categorical" and "qualitative" as the same word, and "quantitative" and "numerical" as the same word. One quick test settles almost every case: does arithmetic on the values mean anything? If adding or averaging the values gives you something sensible, the variable is quantitative. If the values are only stand-ins for names, it is categorical.

The one test that decides it

When you are stuck, ask whether an average would mean anything. The average of a set of heights is a real, useful number, so height is quantitative. The average of a set of jersey numbers is not, because a jersey number is just a name written with digits, so jersey number is categorical.

This works because quantitative values measure how much or how many, while categorical values only tell you which group. You can add and average amounts. With categories you can only count and compare groups, and sometimes order them. So before you classify, picture yourself averaging the values: if the result is nonsense, you are looking at a category, not a quantity.

The zip code trap

The most common mistake is treating any variable made of numbers as quantitative. Plenty of numbers are really labels in disguise. A zip code looks numerical, but averaging two zip codes tells you nothing about location, and zip code 90210 is not "more" than 10001. It is an address label that happens to use digits, so zip code is categorical.

The same trap catches area codes, phone numbers, student ID numbers, jersey numbers, and the numeric codes a survey assigns to answers (say 1 for "yes" and 2 for "no"). None of these measure a quantity, so none of them are quantitative. When a variable is made of numbers, run the arithmetic test before you decide: ask whether the size of the number and its average actually mean something.

Discrete vs continuous quantitative variables

Once a variable is quantitative, the AP course splits it further into discrete and continuous. A discrete variable can take a countable number of values, often the result of counting whole things. The number of pets in a home, the number of text messages you send in a day, and the number of cars in a lot are discrete, because you count them and there is nothing between 3 and 4.

A continuous variable can take any value in an interval, and it usually comes from measuring rather than counting. Height, weight, time, and temperature are continuous, because between any two values there is always another possible value. In practice a scale rounds a continuous measurement to a few decimals, but the underlying quantity still varies smoothly, so it stays continuous.

One gray area is worth a note. Money is genuinely discrete, since a price is a finite number of whole cents, but the increments are so tiny that it is usually treated as continuous. Age is fundamentally continuous, since it measures elapsed time, but it is usually recorded in whole years, and most sources still classify it as continuous. On the AP exam, read the wording and follow the count-versus-measure logic.

Which graphs fit which type

The type of variable decides which graphs are allowed. For a single categorical variable you summarize counts in a frequency table and show them with a bar chart (also called a bar graph) or a pie chart. You can also show the same counts as proportions in a relative frequency table before you graph them. Each bar or slice stands for one category.

For a single quantitative variable you use a dotplot, a stem-and-leaf plot, a histogram, or a boxplot, because these graphs place values along a number line where distance means something. A histogram groups values into intervals; a bar chart never does, and its bars sit over separate categories with gaps between them. Choosing the wrong graph, such as a bar chart for quantitative data, is a graded error on the AP exam. The difference is spelled out in histograms vs bar graphs, and you can build both kinds from your own data in the descriptive statistics sandbox.

Why the variable type matters

Naming the type is not busywork; it decides everything you do next. The type picks your graph, as you just saw. It also picks your summary numbers: for a quantitative variable you report center and spread with a mean and standard deviation or a median and interquartile range, while for a categorical variable you report counts and proportions.

Later units follow the same split. Inference for proportions in Unit 3 is built on categorical variables, and inference for means in Unit 4 is built on quantitative ones. Get the type right at the start and the correct tools line up behind it.

Classifying variables on the AP exam

Topic 1.2 asks you to identify the type of a variable and, if it is quantitative, whether it is discrete or continuous. Work in two steps. First decide categorical or quantitative with the arithmetic test. Then, only for quantitative variables, decide discrete (counted) or continuous (measured).

Watch for two traps. Numbers that are labels, like zip codes and ID numbers, are categorical no matter how they look. Ordered categories, like small, medium, and large or a letter grade, are still categorical even though they have a natural order, because the labels are not measured amounts you can average. For the full unit context, see Unit 1: exploring one-variable data.

Classify each variable as categorical or quantitative

A student survey records six variables for each person: (a) home zip code, (b) number of siblings, (c) t-shirt size (S, M, or L), (d) height in inches, (e) phone area code, (f) daily high temperature in degrees Fahrenheit. Classify each as categorical or quantitative.

  1. Apply the arithmetic test to each variable: does adding or averaging the values mean anything?

  2. (a) Zip code: the digits form an address label, and an average zip code is meaningless, so it is categorical.

  3. (b) Number of siblings: this counts a quantity, and an average number of siblings is meaningful, so it is quantitative.

  4. (c) T-shirt size: S, M, and L are group labels. They have an order but are not measured amounts, so it is categorical.

  5. (d) Height in inches: this measures a quantity, and an average height is meaningful, so it is quantitative.

  6. (e) Area code: like a zip code, it is a numeric label with no meaningful average, so it is categorical.

  7. (f) Daily high temperature: this measures a quantity on a scale, and an average temperature is meaningful, so it is quantitative.

Categorical: zip code, t-shirt size, area code. Quantitative: number of siblings, height, daily high temperature. The two numeric labels (zip code, area code) are categorical because averaging them means nothing.

Sort quantitative variables into discrete and continuous

Four variables are all quantitative. Label each as discrete or continuous: (a) number of text messages sent in a day, (b) time spent on homework in hours, (c) number of cars in a parking lot, (d) weight of a backpack in kilograms.

  1. Ask whether each variable is counted (discrete) or measured on a continuous scale (continuous).

  2. (a) Text messages sent: you count whole messages, and nothing sits between 40 and 41, so it is discrete.

  3. (b) Time on homework: time is measured and can take any value in an interval, such as 1.75 hours, so it is continuous.

  4. (c) Number of cars: you count whole cars, so it is discrete.

  5. (d) Weight of a backpack: weight is measured and varies smoothly, such as 3.42 kilograms, so it is continuous.

Discrete (counted): number of text messages, number of cars. Continuous (measured): time on homework, weight of the backpack.

Frequently asked questions

Are variables made of numbers always quantitative?

No. Some numbers are really labels. Zip codes, area codes, phone numbers, student IDs, and jersey numbers are made of digits but measure nothing, so they are categorical. The test is whether averaging the values means anything; if it does not, the variable is categorical.

Are ordered categories like small, medium, and large quantitative?

No. Ordered categories, including t-shirt sizes and letter grades, are still categorical. They have a natural order, but the labels are not measured amounts you can add or average, which is what makes a variable quantitative.

Which graphs go with each type of variable?

Use a bar chart or pie chart for one categorical variable, since each bar or slice is a category. Use a dotplot, stem-and-leaf plot, histogram, or boxplot for one quantitative variable, since these place values along a number line where distance means something.