AP · Statistics · Describing Distributions

Categorical and Quantitative Variables

13 min readUpdated November 30, 2026FreeAP Statistics, Exploring One-Variable Data

A categorical variable sorts each individual into a group, such as blood type; a quantitative variable records a numerical amount you could sensibly average, such as height. You summarize one categorical variable with a frequency or relative frequency table and show it with a bar chart or a pie chart. To compare groups of different sizes, use relative frequencies, not counts.

Quick check

  1. What is 18 out of 60 written as a decimal and as a percent?Show answerHide answer

    0.300.30, or 30%, because 18÷60=0.3018 \div 60 = 0.30.

  2. A survey records each student's eye color. Are its values amounts or categories?Show answerHide answer

    Categories. Brown, blue and green are group labels, so eye color is a categorical variable.

Know these already? Jump to the practice questions

What you'll be able to do

  • Identify whether a variable is categorical or quantitative, including numbers used as labels.
  • Construct a frequency table and a relative frequency table for one categorical variable.
  • Interpret a bar chart or a pie chart, and explain when a pie chart cannot be used.
  • Compare groups of different sizes using relative frequencies, in context.

Key terms

Categorical variable

A variable whose values place each individual into one of several groups, or categories.

In plain English
The value is a label, such as "bus" or "type O".
Don't write
"categorical because the values are words"; zip codes are numbers and are still categorical.

Quantitative variable

A variable whose values are numbers that measure or count something, so an average makes sense.

In plain English
The value is an amount, usually with units.
Don't write
"quantitative because the values are numbers"; check that an average would mean something.

Relative frequency

A category's count (its frequency) divided by the total number of individuals.

In plain English
The category's share of the whole, as a decimal or a percent.
Don't write
A relative frequency above 1; a share of one whole cannot exceed it.

How do you tell a categorical variable from a quantitative one?

The individuals are the people or objects the data describe, and a variable is a characteristic recorded for each of them. To classify a variable, imagine averaging its values. An average homework time of 47 minutes means something, so homework time is quantitative. An "average favorite color" does not exist, so favorite color is categorical.

Numbers can still be categorical. Zip codes, jersey numbers and ID numbers are labels: the average of two zip codes is not a place. The recorded form also decides: age in years is quantitative, but an age group such as "18 to 24" is categorical.

Key idea

If an average of the values would mean something in context, the variable is quantitative; otherwise it is categorical.

Check yourself

A gym records each member's membership number and number of visits last month. Classify each variable.
Show answerHide answer

Membership number is categorical, because it is only a label. Number of visits is quantitative, because an average number of visits makes sense.

How do you build frequency and relative frequency tables?

A frequency table lists each category with its count. A relative frequency table lists each category's share of the total. Learn this:

relative frequency=count in the categorytotal number of individuals\text{relative frequency} = \frac{\text{count in the category}}{\text{total number of individuals}}

Here is a hypothetical survey of 40 students on how they travel to school.

Travel methodWalkBusCarBikeTotal
Frequency141412121010444040
Relative frequency0.350.350.300.300.250.250.100.101.001.00

The counts add to 40 and the relative frequencies add to 1. Rounded proportions may total 0.99 or 1.01; that is rounding, not an error.

Check yourself

In a hypothetical class of 36, 9 students have a part-time job. What is the relative frequency of having a job?
Show answerHide answer

936=0.25\dfrac{9}{36} = 0.25, so 25% of the class has a part-time job.

When should you use a bar chart or a pie chart?

A bar chart has one bar per category, with height equal to the count or the relative frequency. The bars have gaps between them because the categories are separate groups, and the vertical axis starts at 0 so the bars are not exaggerated. The figure "Bar chart of how 40 hypothetical students travel to school, as relative frequencies" shows the travel data.

A pie chart shows each category as a slice, with Learn this: angle=relative frequency×360∘\text{angle} = \text{relative frequency} \times 360^\circ. So "Walk" gets 0.35×360∘=126∘0.35 \times 360^\circ = 126^\circ.

A pie chart works only when the categories split one whole: each individual is in exactly one category, and every category is shown. If people can choose several answers, the percents add to more than 100%, so use a bar chart.

Check yourself

A survey lets each person tick every streaming service they use. Can you display the results with a pie chart?
Show answerHide answer

No. One person can be counted in several categories, so the percents can add to more than 100%. Use a bar chart.

Why compare relative frequencies instead of counts?

Counts grow with group size, so they mislead when groups differ in size. Suppose hypothetical School A has 72 walkers among 240 students and School B has 48 among 120. School A has more walkers, but the proportions are 72240=0.30\frac{72}{240} = 0.30 and 48120=0.40\frac{48}{120} = 0.40, so walking is more common at School B.

A proportion puts every group on the same 0-to-1 scale. For graphs, compare relative frequency bar charts, not count bar charts.

A full comparison names the groups and the variable, uses a comparative word and quotes both values: "A greater proportion of students walk to school at School B (0.40) than at School A (0.30)."

Examiner's eye

Marks are lost when a comparison uses counts for groups of different sizes, or gives no values. Quote both proportions in context.

Check yourself

In hypothetical Town P, 45 of 300 households have no car; in Town Q, 30 of 150 do. Which town has the greater proportion without a car?
Show answerHide answer

Town Q: 30150=0.20\frac{30}{150} = 0.20, against 45300=0.15\frac{45}{300} = 0.15 in Town P, even though Town P has more such households.

Which method fits the question?

The question showsUse
Numbers that act as labelsCategorical
Each individual in exactly one categoryBar chart or pie chart
"Choose all that apply"Bar chart only
Groups of different sizesProportions

Worked example 1: Classifying variables

Question: A hypothetical data set on 50 used cars records each car's make, mileage (in miles), color, number of previous owners and the seller's zip code. Which of these variables are quantitative?

  • A) Mileage only
  • B) Mileage and number of previous owners
  • C) Mileage, number of previous owners and zip code
  • D) Make, color and zip code

What tells you the method

"which are quantitative" means classify all five with the averaging test.

  1. Step 1: Test the variables recorded as words.

    Make and color are names, so they are categorical.

    Why

    An average color has no meaning.

  2. Step 2: Test the variables recorded as numbers.

    An average mileage or an average number of previous owners means something, so both are quantitative. Zip code labels a place, so it is categorical.

    Why

    The average of two zip codes is not a location.

Check it

Three variables are categorical and two quantitative. C falls for the number-label trap, A misses the owners, and D lists the categorical variables.

Answer

B) Mileage and number of previous owners.

Worked example 2: Comparing groups of different sizes

Question: A hypothetical survey asks students at two colleges where they live. At North College, 270 of 600 students live on campus. At South College, 125 of 250 do. (a) Calculate the proportion living on campus at each college. (b) Compare the colleges in context.

What tells you the method

The colleges have different sizes, 600 and 250, so compare proportions, not counts.

  1. Step 1: Calculate each proportion.

    North: 270600=0.45\frac{270}{600} = 0.45. South: 125250=0.50\frac{125}{250} = 0.50.

    Why

    Dividing by each college's own total puts both on the same scale.

  2. Step 2: Write the comparison.

    A greater proportion of students live on campus at South College (0.50) than at North College (0.45), even though North has more on-campus students (270 against 125).

    Why

    A complete comparison has a comparative word, both values and the context.

Check it

Half of 250 is 125, which matches 0.50.

Answer

(a) North College 0.45 and South College 0.50. (b) A greater proportion of South College students live on campus, 0.50 compared with 0.45.

Your turn

Question: In a hypothetical survey, 125 phone owners name their phone's operating system: 55 use system A, 50 use system B and 20 use another system. Find each relative frequency and the angle of the "another system" slice in a pie chart.

  1. Step 1:

    System A: 55125=0.44\frac{55}{125} = 0.44.

  2. Step 2: Your go: find the other two relative frequencies, then the angle.

    Finish before you open the solution.

Show the full solutionHide the solution

System B: 50125=0.40\frac{50}{125} = 0.40. Another system: 20125=0.16\frac{20}{125} = 0.16. The three add to 1. The slice angle is 0.16×360∘=57.6∘0.16 \times 360^\circ = 57.6^\circ.

Answer: System A 0.44, system B 0.40 and another system 0.16; the "another system" slice is 57.6∘57.6^\circ.

Traps

Trap

Thinking a variable is quantitative whenever its values are numbers.

It seems right because the data look like numbers. But codes and labels such as zip codes cannot be sensibly averaged, so they are categorical.

Check yourself

A hospital codes blood type as 1 = O, 2 = A, 3 = B and 4 = AB. Is the coded variable categorical or quantitative?
Show answerHide answer

Categorical. The codes are labels, and an "average blood type" of 2.3 means nothing.

Trap

Comparing counts when the groups have different sizes.

It seems right because a bigger count looks like "more". But a larger group gives larger counts even when the characteristic is rarer in it, so compare proportions.

Check yourself

Team X has 12 left-handers out of 60 players, and Team Y has 9 out of 30. Which team has the greater proportion of left-handers?
Show answerHide answer

Team Y: 930=0.30\frac{9}{30} = 0.30, against 1260=0.20\frac{12}{60} = 0.20 for Team X.

What's examined

This topic belongs to exploring one-variable data on the AP® Statistics exam, which has a multiple-choice section and a free-response section. Multiple-choice items may ask you to classify a variable or read a bar chart. In free response it can sit inside a longer question that asks you to identify variables, construct a relative frequency table or compare groups in context. Expect the command words Identify, Calculate, Construct and Compare.

Practice questions

  1. Recall Which of the following is a quantitative variable?
    • A) A student's favorite subject
    • B) A runner's bib number in a race
    • C) The area code of a phone number
    • D) The time, in minutes, a student spends on homework
Show answer

Answer: D) The time, in minutes, a student spends on homework.

Marking points:

  • An average homework time makes sense, so time is quantitative.
  • A is a category. B and C are numbers used as labels, so they are categorical.
  1. Recall In a hypothetical poll of 250 adults, 85 prefer reading books on paper. What is the relative frequency of preferring paper?
Show answer

Answer: The relative frequency is 0.34.

Marking points:

  • Divide the count by the total: 85250=0.34\frac{85}{250} = 0.34.
  1. Apply A relative frequency table for 60 people has four categories. Three entries are 0.15, 0.40 and 0.30; the fourth is missing. How many people are in the fourth category?
    • A) 9
    • B) 15
    • C) 24
    • D) 51
Show answer

Answer: A) 9

Marking points:

  • The missing relative frequency is 1−(0.15+0.40+0.30)=0.151 - (0.15 + 0.40 + 0.30) = 0.15, and 0.15×60=90.15 \times 60 = 9.
  • B reports the percent, 15, as a count. C uses 0.40×600.40 \times 60, the wrong category. D uses 0.85×600.85 \times 60, the three given categories combined.
  1. Apply In a hypothetical survey of 160 commuters, 42 cycle to work. Calculate the angle of the "cycle" slice in a pie chart of commuting method.
Show answer

Answer: The slice is 94.5∘94.5^\circ.

Marking points:

  • Relative frequency: 42160=0.2625\frac{42}{160} = 0.2625.
  • Angle: 0.2625×360∘=94.5∘0.2625 \times 360^\circ = 94.5^\circ.
  1. Exam-style In a hypothetical survey, 84 of 240 seniors at School P and 63 of 150 seniors at School Q plan to major in science or engineering. Which statement is best supported?
    • A) School P shows more interest, because 84 is more than 63.
    • B) A greater proportion of School P seniors plan such a major, 0.56 compared with 0.26.
    • C) A greater proportion of School Q seniors plan such a major, 0.42 compared with 0.35.
    • D) The schools cannot be compared, because their class sizes differ.
Show answer

Answer: C) A greater proportion of School Q seniors plan such a major, 0.42 compared with 0.35.

Marking points:

  • School P: 84240=0.35\frac{84}{240} = 0.35. School Q: 63150=0.42\frac{63}{150} = 0.42.
  • A compares counts from groups of different sizes. B divides each count by the other school's total. D misses that proportions make the groups comparable.
  1. Exam-style A hypothetical survey asks 200 people for their favorite season: spring 46, summer 74, fall 52 and winter 28. (a) Construct the relative frequency table. (b) Name the season with the largest pie chart slice and calculate its angle.
Show answer

Answer: (a) Spring 0.23, summer 0.37, fall 0.26 and winter 0.14. (b) Summer, with a slice of 133.2∘133.2^\circ.

Marking points:

  • Each count is divided by 200, and the four relative frequencies add to 1.
  • Summer has the largest share, and 0.37×360∘=133.2∘0.37 \times 360^\circ = 133.2^\circ.

Key points

Recall, then reveal

Say the main points from memory first, then check them.

Show key pointsHide key points
  • Ask whether averaging the values makes sense: yes means quantitative, no means categorical, even for number labels such as zip codes.
  • A relative frequency is a category's count divided by the total, and all of them together add to 1.
  • A bar chart has separated bars on an axis starting at 0; a pie chart needs categories that split one whole, with angle equal to relative frequency times 360 degrees.
  • To compare groups of different sizes, use proportions and quote both values in context.

Figures

Bar chart with four separated bars for travel method: Walk 0.35, Bus 0.30, Car 0.25 and Bike 0.10, on a relative frequency axis that starts at 0. (open full size in a new tab)
Bar chart of how 40 hypothetical students travel to school, as relative frequencies

Keep learning

Explore AP Statistics tutoring →

View the full Statistics syllabus →

More in this unit

Exploring One-Variable Data

All Describing Distributions notes

Part of Novark's AP Statistics notes