Introduction
Every statistical investigation begins with the same question: what exactly are we measuring, and on what? A newspaper might report that "teenagers sleep too little," but a statistician immediately wants to know who was observed, what was recorded about each of them, and in what form. Until those questions are answered, no graph, average, or test can be chosen sensibly.
This tutorial introduces the single most important term in the AP Statistics vocabulary, the variable, together with its partner idea, the individual (or observational unit) that the variable describes. Every later topic in the course, from histograms to confidence intervals to regression lines, is built on the answers to these two questions.
Individuals, Variables, and Data Tables
Most data sets are organized in a table in which each row is one individual and each column is one variable. Consider a small survey of five students.
| Student | Grade level | Hours of sleep last night | Owns a car? |
|---|---|---|---|
| A | 10 | 7.5 | No |
| B | 11 | 6.0 | Yes |
| C | 12 | 8.0 | No |
| D | 10 | 5.5 | No |
| E | 11 | 7.0 | Yes |
Here the individuals are the five students, and there are three variables: grade level, hours of sleep, and car ownership. A single value, such as the 6.0 in the second row, is not a variable; it is one observation of the variable "hours of sleep" for student B. The variable is the whole column of possible and recorded values.
Worked Example: Identifying the Individual and the Variable
A county health department weighs every newborn delivered at its hospital during one week and records the birth weight in grams. Identify the individual, the variable, and the type of values recorded.
Individual. Each individual is one newborn baby. If 52 babies were delivered that week, the data set has 52 rows.
Variable. Birth weight, measured in grams. Typical recorded values might be 3,210 g or 2,890 g.
Type of values. Birth weight is a number on which arithmetic is meaningful: a baby weighing 3,200 g is 400 g heavier than one weighing 2,800 g, and the average weight of the 52 babies makes sense. This is a quantitative variable, a term defined carefully in the next tutorials.
Two Kinds of Variables
The first decision in any analysis is the type of variable, because it determines which graphs and summaries are appropriate.
Quantitative variable: takes numerical values for which it makes sense to add, subtract, and average (for example, height, income, hours of sleep).
A common source of confusion is that a categorical variable can be recorded with numbers. In the table above, grade level is recorded as 10, 11, or 12, yet averaging grade levels is not a meaningful summary of "how much grade" a group has; the numbers are simply labels for groups. A zip code, a jersey number, and a phone area code behave the same way. The test is not whether the entries look like numbers, but whether arithmetic on them has a meaning.
| Variable | Typical values | Type | Reason |
|---|---|---|---|
| Eye color | brown, blue, green | Categorical | Labels for groups |
| Zip code | 60614, 94110 | Categorical | Numbers used as labels; the average zip code means nothing |
| Number of siblings | 0, 1, 2, 3 | Quantitative | Counts; the average number of siblings is meaningful |
| Commute time (minutes) | 12.5, 40, 25 | Quantitative | Measurements with a meaningful scale |
Worked Example: Classifying Variables From a Study Description
Researchers at a university record the following for each of 200 randomly selected students: (a) the student's major, (b) the number of credit hours currently enrolled in, (c) whether the student lives on campus, and (d) the student's student-ID number. Classify each variable.
(a) Major places each student in a group such as Biology or History, so it is categorical.
(b) Credit hours is a count, and averages make sense (a mean of 14.3 credit hours is interpretable), so it is quantitative.
(c) Lives on campus has the values Yes and No, so it is categorical.
(d) Student-ID number is recorded with digits, but it only identifies each student. The average ID number carries no information, so it is categorical (in practice an identifier, not something to analyze).
The Investigative Question Decides the Variable
The same situation can produce different variables depending on what question is being asked. Suppose a school wants to understand how students get to class. If the question is "How do students usually travel to school?", the variable is the mode of transportation (walk, bus, car, bike), which is categorical. If the question is "How long does the trip take?", the variable is travel time in minutes, which is quantitative. The individuals are the same students in both cases; only the variable changed.
On the AP exam you will often be asked to identify the individuals and the variable in context. A complete answer names them in the words of the situation rather than with generic words such as "the data" or "the people."
Worked Example: Same Individuals, Different Variables
A park ranger records, for each of 40 hikers who finish a trail on Saturday, the hiker's age in years, whether the hiker brought a dog, and the time in minutes needed to complete the trail.
Individuals: the 40 hikers who finished the trail that Saturday.
Variables: age (quantitative, in years), brought a dog (categorical, Yes or No), and completion time (quantitative, in minutes).
Notice that the ranger collected three variables on the same 40 individuals. Whether to study age alone, the proportion with dogs, or the relationship between age and completion time is decided by the investigative question, not by the data table.
Common Mistakes
- Confusing a value with the variable. "Blue" is a value of the variable "eye color." "7.5 hours" is a value of the variable "hours of sleep."
- Calling a numerical code quantitative. Jersey numbers, zip codes, and ID numbers are labels. Ask whether arithmetic on them is meaningful.
- Naming the wrong individual. If a table reports one row per school with that school's average SAT score, the individual is a school, not a student, even though students took the test.
- Answering without context. Write "the variable is the number of hours each student slept last night," not "the variable is numerical."
Check Your Understanding
Try these without looking back.
- A table lists the city, the average July temperature in degrees Fahrenheit, and the state of 30 U.S. cities. Identify the individuals and classify each variable.
- Explain why the zip code of a customer is a categorical variable even though it is made of digits.
- A teacher records each student's score on a 50-point quiz. What is the individual, what is the variable, and what type of variable is it?
- Give an example of a situation where the same set of people could be used to study one categorical and one quantitative variable.
- A data set gives, for each of 12 hospitals, the percentage of patients readmitted within 30 days. Which is the individual: a patient or a hospital? Explain.