Tutorials › Introduction to Statistics › A Workshop in Classifying Data and Writing Questions

Variables, Data Types and Questions · Tutorial 25 of 996

A Workshop in Classifying Data and Writing Questions

Work through realistic scenarios to connect each statistical question to its individuals, variables, data types, and possible values.

Beginner 10 min read

What You'll Learn

  • Identify the observational unit that each row of a data set describes.
  • Classify recorded variables as categorical or quantitative, including ordered ratings and counts.
  • Check that possible values agree with how a variable and its scope are defined.
  • Translate a broad topic into a precise question naming who, what, and when.
  • Distinguish questions about one variable from questions comparing or relating variables.
  • Recognize when a question invites an unsupported causal conclusion.

From a Scenario to a Usable Statistical Question

A familiar topic is not yet a statistical question. “Student travel” might lead to a question about travel mode, trip duration, or changes in travel over time. Each choice calls for different recorded information. A useful way to make a question precise is to work through the scenario: identify what one record represents, name the variables, check what values those variables can take, and then write the question so its scope is clear.

This workshop applies those decisions to campus, health, and survey situations. The aim is not to choose a sampling design or analyze a large data set. It is to make sure that a question and the data it would require fit together.

Definition: An individual (or observational unit) is the object described by one record in a data set. A variable is a characteristic recorded for each individual; its observed value is what the data set reports for that individual. A categorical variable records a group or label, while a quantitative variable records a number for which arithmetic has a meaningful interpretation.

Counts and measurements are both quantitative, but their possible values differ: a count is usually a whole number, while a measurement may include fractions. Categories may be unordered, such as travel modes, or ordered, such as ratings from “poor” to “excellent.” The type of a variable depends on what its values mean, not merely on how they are written.

A Practical Classification Routine

For each scenario, answer the following in order. This keeps the question connected to the data rather than relying on a broad topic label.

1
Name the individual.
Ask what one row or record describes: a student, a clinic visit, a household, or something else.
2
Name each variable and its meaning.
State what is recorded and, where needed, how it is defined or measured.
3
Classify the values.
Decide whether they are categories or meaningful numbers; then check what values are possible under the stated definitions.
4
Write the statistical question.
Specify who is described, what variable or variables are of interest, and the relevant time or setting. Make clear whether the question describes one variable or compares variables.

The value check is a small but important justification. A question about a count, for example, implies a set of possible values. If the scenario excludes anyone with a count of zero, writing zero as a possible value contradicts the stated scope. Similarly, a question about a measurement needs a defined quantity and unit; “amount” alone does not specify what is recorded.

Worked Example: Campus Travel on a Specified Day

Hypothetical scenario. A campus office records one entry for each student attending a particular Monday class. For that day, it records the student’s main travel mode to campus and the number of minutes the trip took. A few hypothetical records are shown below.

IndividualMain travel modeTrip duration (minutes)
Student ABus32
Student BWalk14
Student CBicycle21

Individuals. Each individual is one student attending that class on the specified Monday. The records describe students, not trips in general or campus buildings.

Variables and types. Main travel mode is categorical: possible values include bus, walking, and bicycle. Trip duration is quantitative and measured in minutes. It is a measurement, so values such as 14, 21, and 32 minutes are plausible; a decimal value could also be recorded if duration were measured precisely enough.

Question. “What travel modes did students attending this Monday class use to get to campus, and how long did their trips take?” This is a clear descriptive question about two variables, with individuals and time specified. If only travel mode is of interest, a narrower question is: “Which travel mode was most common among students attending this Monday class?”

The second question asks about a category, not a numerical average. Averaging labels such as “bus” and “walk” has no meaningful interpretation. By contrast, a summary of trip durations in minutes would retain the measurement’s units.

Worked Example: Library Entries and a Scope Check

Hypothetical scenario. Suppose a short campus questionnaire is given to students who entered the campus library at least once during a specified week. It asks each student how many separate times they entered the library that week. For this question, an entry means crossing into the library on a separate occasion, not remaining inside for a longer visit.

Individual. One individual is one included student. The scope is important: the question concerns students who entered the library during that week, not every student at the campus.

Variable and type. The variable is the number of separate library entries during the week. It is a quantitative count. Because inclusion requires at least one entry, its possible values are positive whole numbers: 1, 2, 3, and so on. In particular, 0 is not a possible value under this stated scope.

The link from wording to possible values can be written explicitly:

$$ \text{included student} \longrightarrow \text{number of entries during the week} \in \{1,2,3,\ldots\} $$

Question. “How many separate times did students who entered the campus library during the specified week enter it that week?” This names the individuals, variable, and time period. A more focused version could ask for the typical number of entries, but the intended summary should be stated if that is the goal.

Check with hypothetical records. If three included students report 1, 3, and 8 entries, their arithmetic mean is calculated as

$$ \bar{x} = \frac{1+3+8}{3} = \frac{12}{3} = 4 \text{ entries per included student} $$

The arithmetic is consistent with the records, and the unit is entries per student. This calculation describes only these three hypothetical records; it does not, by itself, establish what is typical for a broader group.

Health Questions: Keep the Record and the Claim Aligned

Health scenarios often combine a measured outcome with a reported characteristic. Naming both variables makes it possible to see whether a question is descriptive, comparative, or framed as a causal claim. The wording of the question should not promise more than the recorded information can support.

Worked Example: Blood Pressure and Medication Status

Hypothetical scenario. A clinic exercise records one visit for each adult patient seen during a specified month. For each visit, the record includes the patient’s systolic blood pressure in millimeters of mercury (mmHg) and whether the patient reports currently taking a named blood-pressure medication. The values below are invented for practice.

IndividualReported medication statusSystolic blood pressure (mmHg)
Visit AYes128
Visit BNo136
Visit CYes142

Individuals. Each record represents one adult patient’s visit in the specified month. If the data were instead organized as one record per patient over several visits, the individual and the interpretation of repeated measurements would need to be clarified.

Variables and types. Reported medication status is categorical, with values Yes and No. Systolic blood pressure is quantitative, measured in mmHg. Plausible readings are numerical measurements; they should not be confused with medication categories.

Question. “What is the difference in average systolic blood pressure between adult patients who report currently taking the named medication and those who do not, among visits recorded during this month?” The question identifies both variables, the comparison, the unit of measurement, and the setting and time.

The wording asks about a difference between groups; it does not assert that the medication caused any difference. A recorded comparison alone does not establish that taking the medication produced the observed blood pressure. Other factors could differ between the groups, and the question as written does not describe an intervention.

Survey Questions and Response Values

A survey item is not fully specified by its general subject. The wording and response options determine the variable being recorded. For instance, asking someone to choose one rating category creates an ordered categorical response; asking for a number of hours creates a quantitative response. Both could concern the same broad idea, such as sleep, but they are different variables.

Worked Example: A Campus Survey About Sleep

Hypothetical scenario. A student-life questionnaire asks each respondent, “On how many hours did you sleep last night?” Responses are entered in hours, allowing values such as 6, 7.5, or 8. The questionnaire also asks, “How would you rate your sleep quality last night?” with response options Poor, Fair, Good, and Excellent.

Individuals. Each individual is one respondent completing the questionnaire. The two answers belong to the same person but are separate recorded variables.

Variables and types. Hours of sleep is quantitative and measured in hours. Sleep-quality rating is categorical and ordered: the response options have a natural order, but the gaps between “Poor,” “Fair,” “Good,” and “Excellent” are not specified as equal numerical amounts.

Questions. A precise descriptive question for the first item is: “How many hours of sleep did respondents report getting last night?” For the rating item, it is: “How did respondents rate their sleep quality last night?” Each question names the relevant group, variable, and time period. A question about whether the two responses vary together would need to name both variables rather than treating “sleep” as if it were one measurement.

This example also shows why a response option is not the same thing as the variable. “Good” is one observed value of the sleep-quality variable; the variable is the full set of ratings recorded across respondents.

Justifying a Question Before Collecting Data

A question is workable when its wording points to records that could answer it. One compact way to justify it is to trace the path from question to data: who contributes a record, what is recorded for that record, and what range or set of responses is allowed. The library example makes this explicit: the inclusion wording rules out zero entries, while the count definition rules out fractional entries. If either detail changed, the expected values would change too.

For a question involving two variables, check that both appear in the records for the same clearly defined individual. In the health example, medication status and blood pressure are recorded for each visit. That makes a comparison of the two groups meaningful to pose. It does not justify a causal statement, because recording two variables together does not show that one produced the other.

When the wording seems broad, narrow it by answering these questions in ordinary language:

  • What does one record describe?
  • Which characteristic or characteristics will be recorded?
  • What values could each variable take, given the definitions and scope?
  • What time, setting, or event does the question refer to?
  • Does the question describe one variable, compare groups, or ask about a relationship?

These checks do not require a complicated analysis. They prevent a more basic error: gathering one kind of information and then discovering that it cannot answer the question that was intended.

Common Mistakes

  • Using the topic as the question. “Campus health” does not say who is described or what is recorded. Name the individuals, variables, and time period.
  • Confusing individuals with variables. In the clinic scenario, the individuals are patient visits; blood pressure and medication status are variables recorded for those visits.
  • Calling every number quantitative. A number used only as a label is categorical. Ask whether arithmetic on the values has a meaningful interpretation.
  • Allowing impossible values. If the stated scope includes only students who entered the library that week, a count of zero entries contradicts that scope. The possible counts begin at 1.
  • Treating ordered ratings as measurements with equal intervals. An ordered scale has a sequence, but that alone does not make differences between adjacent response categories equal.
  • Turning a comparison into a causal claim. A question comparing blood pressure by reported medication status asks about a difference; it does not show that medication caused the difference.
Key takeaway: A precise statistical question has a clearly defined individual, one or more named variables, and a stated time or setting. Check that each variable’s possible values genuinely fit the wording and scope before relying on the question.

Check Your Understanding

For each scenario, identify the individual, classify the variable or variables, check the possible values, and propose a precise statistical question.

  1. A campus office records each student’s number of visits to a tutoring center during a specified month. What values are possible if the records include all enrolled students, whether or not they visited?
  2. A health questionnaire asks each adult respondent whether they have had a headache today and how many hours they slept last night. Classify both variables and name the individual.
  3. A survey asks respondents to rate campus dining as Poor, Fair, Good, or Excellent. Why is this an ordered categorical variable rather than a measurement with equal intervals?
  4. Rewrite “Do students exercise?” as a more precise statistical question by specifying who, what, and when.
  5. Why does finding a difference in an outcome between two reported health groups not, by itself, show that group membership caused the difference?