Tutorials › AP Statistics › Common Mistakes Classifying Variable Types

Variables and investigative questions · Tutorial 17 of 1000

Common Mistakes Classifying Variable Types

Practice checking what each value represents so you can distinguish codes, observational units, and percentages recorded as quantities or categories.

Beginner 9 min read

What You'll Learn

  • Explain why a variable stored as numbers can still be categorical when the numbers are codes.
  • Distinguish the observational unit from the variable that describes it.
  • Decide whether a recorded percentage is a quantitative value, a category, or a summary of other data.
  • Classify percentage ranges as ordered categories rather than exact measurements.
  • Write a complete classification with the unit, variable, type, and a brief justification.

Three Errors That Start With Reading Values Too Quickly

In Context-Specific Variables in School and Social Surveys, you practiced identifying the unit and classifying variables in context. This tutorial reviews three mistakes that can happen even when a data table looks simple: treating numerical codes as measurements, naming a variable when asked for the observational unit (or vice versa), and assuming every percentage must be either categorical or quantitative without checking what it represents.

The main question is not “Does this value look like a number?” It is “What does this value mean for one case?” A number might measure an amount, label a category, or summarize a group. Those roles are different. Likewise, “student” might name an observational unit, while “grade level” names a variable recorded for each student.

Key check: For each data field, name what one case represents, state what characteristic is recorded for that case, and ask what the recorded values mean. Classify the variable from its meaning and recording rule—not from its column heading or the appearance of its values.

Mistake 1: Treating Numerical Codes as Quantitative Data

A data table may store categories as numbers. For example, a community center might use 1 for swimming, 2 for basketball, and 3 for dance in a column called “program.” Those values are codes for activity categories. They do not measure how much activity a participant does, and the difference \(3-1=2\) has no meaningful interpretation as an amount of activity.

This is the arithmetic-meaning test from Spotting Numerical Variables That Are Really Categorical. Ask whether a difference between two values represents a meaningful difference in amount. If the answer is no because the numbers merely identify groups, the variable is categorical. Arithmetic operations on the codes, such as calculating their mean, will not describe a meaningful average category.

Some codes do have an order, while others do not. If 1 means “beginner,” 2 means “intermediate,” and 3 means “advanced,” the categories have a meaningful order. The variable is ordinal categorical, but the gaps between adjacent categories are not established as equal amounts. If 1 means “swimming,” 2 means “basketball,” and 3 means “dance,” there is no natural order, so the variable is nominal categorical.

Worked Example: The Average of Activity Codes

A fictional recreation survey records each participant’s preferred activity using codes: 1 for swimming, 2 for basketball, and 3 for dance. The first five responses are 1, 1, 2, 3, and 3. Is the variable quantitative? What would the mean code be, and would it describe an average preference?

Unit and variable: Each case represents one survey respondent. The variable is the activity that respondent prefers, stored as a numerical code.

Classification: The variable is nominal categorical. The numbers identify activity names; they do not measure an amount and have no natural order.

Arithmetic check: The mean of the stored codes would be \( (1+1+2+3+3)/5=10/5=2 \). The result is code 2, which happens to stand for basketball. But this does not establish that the group’s average preference is basketball: changing the arbitrary codes to 10, 20, and 30 would change the mean code without changing anyone’s preference. The mean of these codes is therefore not a meaningful summary of the categorical variable.

Useful summary instead: Count the categories: two respondents chose swimming, one chose basketball, and two chose dance. These counts describe the recorded preferences without treating the labels as measurements.

Mistake 2: Confusing the Observational Unit With a Variable

The observational unit is what one case or row represents. A variable is a characteristic recorded for each such case. The unit answers “Who or what is being described?” The variable answers “What information is recorded about that case?” These questions are connected, but their answers are not interchangeable.

For instance, if one row represents one bus route, the observational unit is a bus route. “Route length in miles” could be a quantitative variable, and “whether the route serves a hospital” could be a categorical variable. Calling “route length” the observational unit is an error: it is a characteristic of each route, not the entity represented by one case.

A question can mention a person or group that is not the unit. A survey might ask students to report how many books their household owns. If the data contain one row per responding student, the unit is one responding student; household book count is a variable recorded for that student’s household. As covered in Identifying the Observational Unit, use the data structure and the description of a case to determine what each row represents.

Worked Example: A Table About Community Gardens

A fictional city inventory has one row for each of 12 community gardens. Its columns record neighborhood, number of plots, and whether the garden has a tool shed. Name the unit and classify the three variables.

Observational unit: One case is one community garden. There are 12 gardens represented; “12” is the number of units, not a variable type.

Variables: Neighborhood is categorical because it names a group or location. Number of plots is quantitative and discrete because it counts plots for each garden. Tool-shed status is categorical, with values such as “yes” and “no.”

Check the wording: “Community garden” names the observational unit. “Number of plots for each community garden” names a variable. A complete statement might be: “For each of the 12 community gardens, the data record its neighborhood, plot count, and tool-shed status.” This separates the cases from the characteristics recorded about them.

If a question asks you to “identify the variable,” do not answer only “the students” or “the schools.” If it asks for the unit, do not answer only “attendance” or “favorite activity.” Name both when helpful: “For each responding student (unit), the variable is the number of books in the student’s household.”

Mistake 3: Classifying Percentages Without Checking Their Role

A percentage is not automatically categorical just because it is written with a percent sign. Nor is every number printed as a percentage automatically a quantitative variable. As with other values, the classification depends on what one recorded value represents and how it was obtained.

If a data set records each student’s attendance rate as an exact percentage from 0% to 100%, the variable is quantitative. Differences have a meaningful interpretation: a difference of 5 percentage points separates two attendance rates by five points on that scale. For example, 90% minus 85% is a difference of 5 percentage points. Be clear that this is a difference in rates, not a difference of “5 percent” relative to the first rate.

If students instead select a response such as “below 70%,” “70% to below 90%,” or “90% or higher,” the variable is categorical. The responses are percentage-range groups, not exact rates. Because these categories have a meaningful order, this variable is ordinal categorical. In Matching Variable Type to the Right Graph or Summary, you learned to match a display or summary to the variable type; identifying whether a rate is exact or grouped helps you make that choice.

A third possibility is that percentages are summaries of another variable rather than values recorded for each unit. For instance, a report could give the percentage of survey respondents choosing each favorite activity. The original variable—favorite activity—is categorical. Its percentages summarize the distribution of that categorical variable; they do not turn favorite activity into a quantitative variable. Keep the recorded characteristic separate from a summary calculated from its responses.

Three roles for a percentage: An exact percentage recorded for each unit can be quantitative. A selected percentage range can be ordinal categorical. A percentage calculated to summarize how many units fall in a category is a summary of categorical data, not a new quantitative response for each original unit.

Work Through Percentage Examples

Worked Example: Exact Attendance Rates

A fictional school data set has one row per student and records each student’s attendance rate for the term as an exact percentage. Three rates are 75%, 80%, and 95%. Identify the unit and variable type. Calculate the mean rate for these three students and interpret it.

Unit and variable: The unit is one student. The variable is that student’s attendance rate for the term, recorded as an exact percentage. It is quantitative because the values measure rates, and differences between rates are meaningful.

Mean calculation: \( \bar{x}=(75+80+95)/3=250/3=83.3\% \), rounded to one decimal place.

Interpretation: The mean attendance rate for these three students is about 83.3%. This is a numerical summary of their quantitative attendance-rate values. It is not a category, even though the values use percent signs.

Units of difference: The difference between 80% and 75% is 5 percentage points. Describing this difference as five percentage points makes the comparison clear.

Worked Example: Percentage Ranges as Categories

A fictional questionnaire asks each household to choose one range for the share of its weekly food budget spent on meals eaten away from home: “less than 10%,” “10% to less than 25%,” or “25% or more.” Identify the unit and classify the recorded variable.

Unit: One case is one responding household, because each row represents a household that gives one response.

Variable and type: The variable is the selected range for the share of the household’s food budget spent on meals away from home. It is ordinal categorical. The response identifies one of three ordered groups; it does not give the household’s exact percentage.

Why the percent sign does not settle the classification: Although every category refers to percentages, the recorded values are ranges. A response of “25% or more” does not specify whether the value is 25%, 32%, or 60%. Treating the range labels as exact quantitative measurements would claim more information than the questionnaire collected.

Worked Example: Percentages Summarizing Favorite Choices

In a fictional survey, 24 respondents each choose one preferred type of community event. Eighteen choose outdoor events. A summary reports the percentage who chose outdoor events. What is the original variable, and what does the reported percentage mean?

Unit and original variable: The unit is one responding person. The variable is that person’s preferred type of event, which is categorical because each response names an event category.

Calculate the summary: The proportion choosing outdoor events is \(18/24=0.75\). As a percentage, \(0.75 \times 100\%=75\%\). Thus, 75% of the 24 respondents chose outdoor events.

Interpretation: The 75% is a summary of the categorical preference variable for this group of respondents. It is not an individual respondent’s value for the “preferred event” variable, and it does not change that variable from categorical to quantitative.

Keep the levels straight: The respondents are the observational units, preferred event is the variable recorded for each respondent, and 75% is a summary calculated across those responses. Naming all three prevents a common mix-up.

A Reliable Classification Routine

When a table or question includes digits, units, or percentages, use a brief routine before deciding on a graph or summary. It combines the checks you practiced in What Is a Variable in Statistics, Categorical Versus Quantitative Variables, and Reading a Data Table: Rows, Columns, and Cases.

1
Name the observational unit.
Ask what one row or case represents: a person, household, school, garden, or another specific entity.
2
Name the variable.
State the characteristic recorded for each unit, with useful details such as a time frame or units.
3
Interpret the values.
Decide whether they measure or count an amount, identify categories, or summarize multiple cases.
4
Justify the classification.
For codes, explain that the numbers label groups. For percentages, say whether they are exact rates, selected ranges, or summaries.

This routine is useful when a column heading is vague. “Rate,” “score,” “code,” and “percent” do not tell you enough by themselves. Find out what one value stands for and how it was recorded. If needed, describe the variable more precisely before assigning its type.

Common Mistakes and AP Exam Tips

  • Calling every digit quantitative. A full-credit explanation identifies what the digits mean. If they are labels, say they are codes for categories and that differences between codes do not measure meaningful amounts.
  • Calculating an average of category codes. The calculation may be arithmetically possible but statistically meaningless. Use counts or proportions for categories, as in Matching Variable Type to the Right Graph or Summary.
  • Answering a unit question with a variable. “Attendance rate” is a variable; “one student” may be the unit. State the entity represented by one case separately from the characteristic recorded about it.
  • Assuming a percent sign makes a value quantitative. Check the response format. An exact rate can be quantitative, but a selected percentage band is categorical.
  • Treating a percentage summary as a new individual-level variable. State which responses the percentage summarizes and the group it describes. Do not confuse a category’s share of all responses with each respondent’s recorded category.
  • Giving a label without a reason. Instead of writing only “categorical,” explain that values name groups; instead of writing only “quantitative,” explain that they record an amount or rate with meaningful numerical differences.

A strong AP response is concise but specific: “For each responding household, the recorded food-budget percentage range is an ordinal categorical variable because the response is one of three ordered bands, not an exact percentage.” That sentence names the unit, variable, type, and reason. For numerical codes, replace the final explanation with: “The values are identifiers for categories, not measured amounts.” For a reported percentage, say whether it is recorded per unit or calculated as a summary.

Key takeaway: Do not classify by appearance alone. Identify the unit, name the variable, and interpret what each value represents. Codes can label categories, exact percentages can be quantitative, percentage ranges can be ordinal categories, and percentages can also summarize categorical responses.

Check Your Understanding

For each situation, identify the observational unit and variable type, then explain what the values represent.

  1. A library stores 1 for fiction, 2 for nonfiction, and 3 for poetry as each borrower’s preferred section. Is the variable quantitative or categorical? Explain why averaging its codes would or would not be meaningful.
  2. A table has one row for each neighborhood and records the number of public benches in that neighborhood. Identify the unit and the variable.
  3. Each patient’s exact change in body temperature, measured in degrees over one day, is recorded as a percentage. What additional information would you need before deciding whether the percentage is a meaningful quantitative measure?
  4. Each household chooses “under 20%,” “20% to under 40%,” or “40% or more” for the share of income spent on transportation. Classify the response variable and explain the role of the percent ranges.
  5. A survey summary says that 42% of respondents selected walking as their preferred way to commute. What is the original variable, and what does 42% summarize?