The Language of Variation:
Variables
Learn to identify, classify, and describe variables: the building blocks of every statistical study.
What Is a Variable?
A variable is any characteristic, number, or quantity that can be measured or counted and that varies from one individual to the next. Variables are the fundamental units we collect data about in statistics.
Individuals and Variables
Why Variables Matter
Correctly identifying and classifying variables determines which graphs, summaries, and statistical tests you can use. Choosing the wrong analysis for a variable type is one of the most common errors on the AP exam.
The Two Big Types: Categorical vs. Quantitative
Categorical Variables
A categorical variable places an individual into one of several groups or categories. The values are labels, not numbers you compute with.
Quantitative Variables
A quantitative variable takes numerical values for which arithmetic operations (addition, averaging) make sense. It records "how much" or "how many."
Key Distinction: Categorical vs. Quantitative
| Categorical | Quantitative | |
|---|---|---|
| Values | Labels / categories | Numbers with units |
| Arithmetic? | ✕ No meaningful mean | ✓ Mean, median, SD |
| Graphs | Bar chart, pie chart | Histogram, boxplot, stemplot |
| Summary | Counts and proportions | \(\bar{x}\), \(s\), five-number summary |
| Inference | \(\chi^2\) test, \(z\)-test for \(p\) | \(t\)-test, regression |
Explanatory vs. Response Variables
When studying the relationship between two variables, one is used to explain or predict changes in the other.
How to Classify a Variable
Example 1: School Survey
A researcher surveys 200 high school students, recording each student's grade level (9, 10, 11, 12) and number of extracurricular activities.
Example 2: Coffee & Heart Rate
An experiment measures the effect of daily coffee consumption (cups per day) on resting heart rate (bpm) for 50 adults.
Example 3: Tricky Numbers
A dataset records these variables about phone users: phone number, monthly data usage (GB), operating system, and customer satisfaction rating (1-5 stars).
Variables Lead to Distributions
Once you classify a variable, the next step is to describe its distribution: the pattern of values and how often each occurs.
Common Mistakes
Summary at a Glance
| Type | Subtype | Values | Example |
|---|---|---|---|
| Categorical | Nominal | Unordered labels | Blood type |
| Ordinal | Ordered labels | Movie rating | |
| Quantitative | Discrete | Countable numbers | # of pets |
| Continuous | Any value in range | Weight (kg) |
Worked practice: Practice Problems, Problem 4 — Applied
Work through this original lesson problem, then reveal the solution and illustrations.
A city transportation agency surveys 500 bus riders and records the following for each rider: (1) route number (e.g., 42, 17, 8), (2) total fare paid in dollars, (3) number of transfers made, (4) satisfaction rating (very dissatisfied, dissatisfied, neutral, satisfied, very satisfied), and (5) primary language spoken at home. The agency wants to summarize these data and present findings to the city council. (a) Classify each of the five variables as categorical or quantitative. For each, justify your classification in one sentence. (b) For the categorical variables, identify one appropriate graphical display and one appropriate numerical summary. (c) For the quantitative variables, identify one appropriate graphical display and one appropriate numerical summary. (d) The data analyst computes the mean route number and reports it as 22.3. Explain why this is problematic.
Show answer and explanation
Rubric (4 points): Part (a) — 1 point: Route number: categorical (nominal) — the numbers are labels for bus lines, not quantities. Total fare paid: quantitative (continuous) — dollar amounts for which arithmetic is meaningful. Number of transfers: quantitative (discrete) — a count of transfer events. Satisfaction rating: categorical (ordinal) — ordered categories but with non-uniform intervals. Primary language: categorical (nominal) — labels with no inherent ordering. Award 1 point for correctly classifying all five with justification. Partial credit (½ point) if four of five are correct. Part (b) — 1 point: For categorical variables (route number, satisfaction rating, primary language), appropriate graphical displays include bar charts, segmented bar charts, or pie charts. An appropriate numerical summary is the frequency count or relative frequency (proportion) for each category. The mode is also acceptable. Award 1 point for naming at least one correct graph and one correct summary. Part (c) — 1 point: For quantitative variables (total fare paid, number of transfers), appropriate graphical displays include histograms, dotplots, stemplots, or boxplots. Appropriate numerical summaries include mean, median, standard deviation, IQR, or range. Award 1 point for naming at least one correct graph and one correct numerical summary. Part (d) — 1 point: Route number is a categorical variable; the numbers are identifiers for different bus routes, not quantities. Computing the mean of these numbers produces a value (22.3) that does not correspond to any real route and has no interpretive meaning — you cannot say the 'average route' is 22.3. The appropriate summary for route number would be the mode (most popular route) or a frequency table. Award 1 point for explaining that route number is categorical and therefore the mean is not a meaningful summary.

Question 1 of 5
A researcher records the Social Security numbers of participants in a study. What type of variable is this?
Question 2 of 5
A dataset records commute time in minutes for 300 employees. Which best describes this variable?
Question 3 of 5
A study examines whether type of exercise (running, swimming, cycling) affects weight loss (kg). Which variable is the explanatory variable?
Question 4 of 5
A survey asks respondents to rate their agreement on a scale: Strongly Disagree, Disagree, Neutral, Agree, Strongly Agree. This variable is best classified as:
Question 5 of 5
Which of the following is not a valid reason for classifying a variable as quantitative?