01 / 21

The Language of Variation:
Variables

Learn to identify, classify, and describe variables: the building blocks of every statistical study.

AP Statistics

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

Individuals
The objects described by a dataset: people, animals, companies, cities, or things.
Variables
The characteristics recorded about each individual: height, species, revenue, population.

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.

1
Shapes your graph choice: bar chart vs. histogram vs. scatterplot.
2
Guides your summary statistics: mean and standard deviation vs. counts and proportions.
3
Determines your inference method: \( t \)-test vs. \( \chi^2 \) test vs. regression.

The Two Big Types: Categorical vs. Quantitative

Variable Categorical Quantitative Nominal Ordinal Discrete Continuous color, zip code letter grade, rank # of pets, goals height, time

Categorical Variables

A categorical variable places an individual into one of several groups or categories. The values are labels, not numbers you compute with.

Nominal
Categories with no natural order: eye color, blood type, country of birth.
Ordinal
Categories with a meaningful order, but gaps between levels are not uniform: letter grades (A, B, C), satisfaction ratings.

Quantitative Variables

A quantitative variable takes numerical values for which arithmetic operations (addition, averaging) make sense. It records "how much" or "how many."

Discrete
Countable values, often whole numbers: number of siblings, AP exams taken, goals scored.
Continuous
Can take any value in an interval: height (\( 67.3 \) in), temperature (\( 98.6^\circ \text{F} \)), time (\( 4.32 \) sec).

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.

Explanatory (\(x\))
The variable we think explains or causes change. Also called the independent variable or predictor.
Response (\(y\))
The variable that measures the outcome. Also called the dependent variable.

How to Classify a Variable

1
Identify the individual. Who or what is being measured?
2
Look at the values. Are they labels/categories or numbers with units?
3
Apply the arithmetic test. Can you find a meaningful average? If yes: quantitative. If no: categorical.
4
Refine the classification. Is it nominal/ordinal? Discrete/continuous?
5
Assign roles if two variables. Which is explanatory and which is response?

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.

Grade Level
Categorical (ordinal): The numbers label ordered groups, but the "average grade level" is not a meaningful measure.
# of Activities
Quantitative (discrete): You can count them, average them (\(\bar{x} = 2.4\)), and compute a standard deviation.

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.

Cups of Coffee per Day (\(x\))
Heart Rate (bpm) (\(y\))
0 1 2 3 4 60 70 80 90 100

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).

Phone Number
Categorical (nominal): a label, not a quantity.
Data Usage
Quantitative (continuous): measured in GB.
Operating System
Categorical (nominal): iOS, Android, etc.
Satisfaction (1-5)
Categorical (ordinal): ordered ranks, but gaps between stars are not necessarily equal.

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.

Categorical Distribution
Described by the count or proportion of individuals in each category. Displayed with a bar chart or pie chart.
Quantitative Distribution
Described by shape, center, spread, and outliers (SOCS). Displayed with a histogram, dotplot, or boxplot.

Common Mistakes

✕ Treating Numbers as Quantitative
Zip codes, jersey numbers, and phone numbers are categorical: their digits are labels, not quantities.
✕ Ignoring Ordinal Order
Letter grades (A, B, C) have a natural order. Treating them as purely nominal loses information about ranking.
✕ Computing Mean of Categories
Averaging Likert-scale ratings (1-5) as if they were truly numeric can be misleading: the gaps between levels may not be equal.

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.

Illustrative transit-reader record fields with nominal, quantitative and ordinal classifications. Self-reported information is distinguished from measured data.

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?