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
What is 18 out of 60 written as a decimal and as a percent?Show answerHide answer
, or 30%, because .
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
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:
Here is a hypothetical survey of 40 students on how they travel to school.
| Travel method | Walk | Bus | Car | Bike | Total |
|---|---|---|---|---|---|
| Frequency | |||||
| Relative frequency |
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
Show answerHide answer
, 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: . So "Walk" gets .
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
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 and , 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
Show answerHide answer
Town Q: , against in Town P, even though Town P has more such households.
Which method fits the question?
| The question shows | Use |
|---|---|
| Numbers that act as labels | Categorical |
| Each individual in exactly one category | Bar chart or pie chart |
| "Choose all that apply" | Bar chart only |
| Groups of different sizes | Proportions |
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.
Step 1: Test the variables recorded as words.
Make and color are names, so they are categorical.
WhyAn average color has no meaning.
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.
WhyThe 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.
Step 1: Calculate each proportion.
North: . South: .
WhyDividing by each college's own total puts both on the same scale.
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).
WhyA 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.
Step 1:
System A: .
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: . Another system: . The three add to 1. The slice angle is .
Answer: System A 0.44, system B 0.40 and another system 0.16; the "another system" slice is .
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
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
Show answerHide answer
Team Y: , against 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
- 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.
- 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: .
- 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 , and .
- B reports the percent, 15, as a count. C uses , the wrong category. D uses , the three given categories combined.
- 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 .
Marking points:
- Relative frequency: .
- Angle: .
- 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: . School Q: .
- 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.
- 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 .
Marking points:
- Each count is divided by 200, and the four relative frequencies add to 1.
- Summer has the largest share, and .
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.