Three Things That Are Easy to Confuse
A statistical investigation may begin with a sentence, such as “How many hours did each student sleep last night?” A data table may then contain a column headed “Hours of sleep,” with entries such as 7, 6.5, and 8. It is tempting to treat the sentence, the column, and one entry as if they were the same thing. They are connected, but they play different roles.
Keeping those roles separate helps prevent mistakes when describing data or deciding what a question is asking. The distinction is especially useful when a survey prompt is phrased as a question, when someone names one answer instead of the characteristic being recorded, or when a column contains numbers that are really labels.
For example, “How many hours did each student sleep last night?” is a question. “Hours of sleep last night” is the variable. If a particular student reports 7 hours, then 7 hours is a response value for that student. The variable is not the question’s wording and is not any one student’s answer; it is the characteristic whose values are recorded across the students.
From Question to Variable to Values
A useful way to check the distinction is to identify three parts of the situation: who is being described, what characteristic is recorded for each one, and what values were observed. The statistical question gives a purpose for collecting and examining those values. It does not itself become a column of data.
Suppose a school asks, “How long does each student’s trip to school take?” The individuals are students, the variable is each student’s travel time to school, and possible response values are 12 minutes, 25 minutes, or 40 minutes. If the school is interested in the typical travel time, the question concerns the distribution of that one variable. The question refers to the data; it is not one of the data values.
This can be expressed as a simple mapping. For each individual \(i\), the data-recording process assigns a value \(x_i\) of the stated variable:
The variable names the same kind of characteristic for every individual; \(x_i\) is the value for one particular individual. The question describes what we want to learn from the collected values. If we replace the variable with one response value, we lose the information that different individuals can have different values.
Worked Example: Is the Survey Prompt the Variable?
In a hypothetical survey, 5 students are asked, “How many hours did you sleep last night?” Their recorded answers are 7, 6, 8, 5.5, and 7.5 hours. Identify the statistical question, variable, individuals, and response values.
Question. The prompt asks each student how many hours they slept last night. Across the students, the investigation could ask, “How many hours did these students sleep last night, and how do their answers vary?”
Individuals. The individuals are the 5 students who answered the survey.
Variable. The variable is the number of hours each student slept the previous night. It is quantitative because the recorded values are amounts of time, and differences such as 7 hours minus 5.5 hours have a meaningful interpretation.
Response values. The values are 7, 6, 8, 5.5, and 7.5 hours. The value 6 hours is the response for one student; it is not the variable.
Check. “How many hours did you sleep?” is the wording used to obtain information. “Hours of sleep last night” names the characteristic recorded for each student. These are related but not interchangeable.
A Response Is One Value, Not the Whole Variable
A variable is defined across the individuals in a data set, even if a small data set happens to contain repeated values. One value can be observed for several individuals, but that does not make the value itself the variable. For instance, if three patients each report 30 minutes of exercise, the variable remains each patient’s exercise duration; 30 minutes is a response value appearing in three records.
The same distinction applies to categorical data. If a survey records a student’s preferred mode of travel, “bus” may be one student’s response. The variable is the preferred mode of travel for each student. A list containing only the response “bus” does not name the variable, just as a single numerical observation does not name a quantitative variable.
A common wording test is to ask whether the proposed variable can be applied to every individual in the data set, with a value recorded for each one. “Favorite subject” can be applied to each student. “Mathematics” is a possible value of that variable. This test is more reliable than asking whether a phrase looks like a question or a label.
Worked Example: One Answer Versus the Variable
A hypothetical class survey asks each of 6 students, “Which form of transportation did you use to get to campus today?” The answers are bus, bicycle, bus, walking, car, and walking. A student summarizing the data writes, “The variable is bus.” Diagnose and correct the statement.
The statement confuses one response category with the variable. “Bus” is a value recorded for the first and third students; it is not a characteristic that can describe all 6 students in the same way.
The variable is form of transportation used to get to campus today. It is categorical because its values are categories such as bus, bicycle, walking, and car. The individuals are the 6 students, and the six listed answers are their response values.
The statistical question might ask which forms of transportation these students used or how the answers were distributed across the class. That question concerns the variable, while the answers supply its observed values. Naming the variable clearly makes it possible to understand what every entry in the data column represents.
When a Number Is a Code, Not a Measurement
A value can look numerical without measuring an amount. A number is a quantitative measurement only when its numerical size and arithmetic differences carry meaning for the characteristic being recorded. Some numbers are assigned to identify people, places, or categories. In those cases, calculations on the numbers do not describe meaningful amounts.
For example, suppose a hypothetical clinic records a patient’s appointment location using codes 1, 2, and 3 for the North, Central, and South offices. The variable is appointment location, a categorical characteristic. The code 2 means Central office; it does not mean that the office is twice as far away as office 1 or that the difference between codes 1 and 2 is the same kind of difference as between 2 and 3.
To classify a numbered column, ask what the digits stand for and whether arithmetic on them answers a meaningful question. If the numbers are labels, identify the underlying categories rather than treating the digits as measurements. This distinction is consistent with the earlier material on Identifiers, Categories, and Numbers: A Classification Clinic.
Worked Example: A Numbered Category Is Still Categorical
A hypothetical recreation program records each participant’s preferred activity with a code: 1 = swimming, 2 = hiking, and 3 = cycling. For 5 participants, the recorded codes are 2, 1, 3, 2, and 2. Classify the variable and explain why the code values should not be interpreted as measurements.
Individuals. The individuals are the 5 participants.
Variable. The variable is preferred activity. It is categorical because each response places a participant in an activity group.
Values. The recorded codes are 2, 1, 3, 2, and 2. Interpreting the codebook, the responses are hiking, swimming, cycling, hiking, and hiking.
Why not quantitative? The code 3 does not indicate a greater amount of preferred activity than code 1, and a mean code of 2.0 would not measure a meaningful average preference. The digits are labels for categories. A clear table should either display the category names or state the codebook alongside the coded values.
A Short Check for Correct Identification
The distinctions can be justified by looking at what changes when we move from one part of the description to another. The survey wording tells us what was asked. The variable tells us what characteristic is recorded repeatedly. The response value tells us what was recorded for one individual. A code tells us which category or individual is represented, not necessarily how much of something there is.
State what one row of the data represents, such as one student or one clinic visit.
Describe what is recorded for each individual. This is the variable, not the prompt or a single answer.
State what one recorded value means for one individual, using the variable’s units or category labels.
If entries are digits, determine whether arithmetic describes amounts or whether the digits merely encode categories or identities.
This check also helps identify imprecise descriptions. “The question is age” mixes a prompt with a characteristic: a question might ask, “How old are you?” and the variable is age in years. “The variable is 18” substitutes one person’s response for the characteristic. “The average office code is 2” may calculate correctly as arithmetic, but if the codes are office labels, the result does not summarize a meaningful measured quantity.
Common Mistakes and Why the Distinction Matters
A frequent mistake is to copy the full survey question into a column heading and then call that wording the variable. The correction is to state the characteristic concisely, including the relevant time or unit when needed. For example, instead of “How many cups of coffee did you drink yesterday?” use “Number of cups of coffee consumed yesterday.” The prompt and variable refer to the same information, but the latter describes what is recorded for each individual.
Another mistake is to report one response as though it described the whole data set. “The variable is walking” should be corrected to “The variable is transportation mode; walking is one observed category.” Likewise, if one student’s response is 7.5 hours, the variable is hours of sleep, not 7.5.
A third mistake is to treat any column of digits as quantitative. A participant ID of 1042 is not an amount of participation, and an office code of 2 is not a measurement of location. The number’s format alone does not determine the data type; what it means does. Misclassifying codes can lead to meaningless averages or comparisons and can obscure the actual categories in the data.
Check Your Understanding
For each situation, identify the question or prompt, variable, individual, and response value where appropriate. Explain whether any numerical entries are measurements or codes.
- A survey asks each of 20 students, “How many minutes did you spend reading yesterday?” One student answers 35. What are the variable and that student’s response value?
- A data table records preferred lunch option as 1 for soup, 2 for salad, and 3 for a sandwich. Is the variable quantitative or categorical? Explain what the number 2 means.
- Explain why “cycling” is not the variable when a data set records each participant’s mode of travel.
- A table contains patient identification numbers and waiting times in minutes. Which column contains identifiers, and which records a quantitative measurement?
- Rewrite “The variable is 8 hours” as a precise description that distinguishes the variable from one observed response.