Variables in Statistics
A visual field guide to the characteristics we record: what kind of information a variable carries, what role it plays, which units belong to it, and how one careless classification can change an entire analysis.
The hidden grammar of every data set
Variables in Statistics are the characteristics recorded on observational units. A student can be an observational unit; grade level, commute time, and preferred study location can be variables recorded for that student. A smartphone can be an observational unit; operating system, battery capacity, and repair count can be variables recorded for that phone. The word variable reminds us that the characteristic may take different values from one unit to another.
Topic 1.1 established the population, sample, observational units, data, parameter, statistic, variability, and investigative question. Topic 1.2 moves one layer deeper. It asks whether a recorded characteristic is categorical or quantitative, whether a quantitative variable is discrete or continuous, whether a variable is explanatory or response, and whether its labels, units, and coding preserve the intended meaning.
A variable is never classified safely by appearance alone. A column containing 1, 2, and 3 could represent counts, ordered ratings, school buildings, or arbitrary category codes. The same printed values can carry completely different statistical meaning. Correct classification comes from the definition of the variable, the question being asked, and the way values were obtained.
What Topic 1.2 officially requires
The official AP Statistics framework places Topic 1.2 in Unit 1, Exploring One-Variable Data and Collecting Data. Its stated skill is Statistical Practice 2.A: identify information needed to answer a question or solve a problem. The official learning objectives ask students to identify observational units, variables, parameters, and statistics, then identify categorical and quantitative variables and distinguish discrete from continuous quantitative variables.
What must be recognized
An observational unit is the item or individual from which a datum is collected. A variable is a characteristic that may change from one observational unit to another. A parameter summarizes a population variable numerically; a statistic summarizes a sample variable numerically.
How variables are divided
A categorical variable takes category names or group labels. A quantitative variable takes numerical values for measured or counted quantities and generally has units. Quantitative variables may be discrete or continuous.
This chapter also develops explanatory and response roles, units, measurement levels, and coding. Those ideas support later AP Statistics topics in data collection, experimental design, two-variable analysis, and regression. They are included here because a student who can classify only by “categorical or quantitative” still may not understand what a variable means or how it should be used.
The anatomy of a variable
Variables in Statistics begin with observational units. Before classifying a column, identify what one row represents. If each row represents a student, “hours of sleep” is measured on students. If each row represents a night, “hours of sleep” is measured on nights. If each row represents a student-night combination, the data contain repeated measurements, and the unit is more complex.
One row, four questions
A variable needs more than a short name
A column named time is ambiguous. It might mean clock time of arrival, elapsed waiting time, calendar date, time zone, or a binary indicator for “morning versus afternoon.” A useful variable definition might be: “Elapsed minutes from joining the service queue until an employee begins assisting the customer, measured by the ticket system and rounded to the nearest tenth of a minute.” That definition identifies the quantity, starting and ending events, unit, instrument, and precision.
Values, labels, and missing states
A variable’s possible entries may include substantive values and special states. A survey item may contain “yes,” “no,” “not sure,” “not applicable,” and missing. These are not interchangeable. “Not applicable” can be a legitimate category, while missing means the value was not recorded or is unavailable. Treating both as zero can create a false measurement.
Photographs, sounds, videos, and text can be data
The official framework explicitly recognizes that data are not limited to neat numbers and category labels. A photograph can be recorded directly or converted into variables such as detected object count, brightness, or classification label. An audio file can become duration, peak frequency, or speaker category. A written response can be kept as text or coded into themes. The variable is the characteristic extracted or defined for analysis, not merely the file format.
Categorical variables
A categorical variable, also called a qualitative variable, places an observational unit into a category. The values identify group membership, type, status, or label. Examples include blood type, transportation mode, device operating system, voting preference, product category, and whether a customer renewed a subscription.
Variables in Statistics are categorical when arithmetic on their values does not express the intended meaning. If bus is coded 1, bicycle 2, and walking 3, the average of 1, 2, and 3 is not an “average transportation mode.” The numbers are labels. Their numerical appearance does not make the variable quantitative.
Unordered categories
Categories differ by name but have no inherent ranking. Examples: eye color, region, browser type, and blood group.
Ordered categories
Categories have a meaningful order, but the distance between levels is not established. Examples: poor, fair, good, very good, excellent.
Two categories
A special categorical variable with two possible categories, such as pass/fail, present/absent, or renewed/did not renew.
Category values should be mutually understandable
Good categories are clearly defined. Ideally, each observational unit can be placed in one category for the variable, and the categories cover all meaningful possibilities. A question asking “What is your employment status?” with only “employed” and “unemployed” may fail to represent students, retirees, people unable to work, or people outside the labor force. The category system should match the purpose of the study.
Ordered categories are not automatically quantitative
A satisfaction variable with categories “very dissatisfied,” “dissatisfied,” “neutral,” “satisfied,” and “very satisfied” has order, but the gap between adjacent categories is not known to be equal. Coding the levels 1 through 5 does not prove that the psychological distance from 1 to 2 equals the distance from 4 to 5. In an AP Statistics classification question, the original single-item response is generally categorical and ordinal.
Identifiers are categorical even when made of digits
Student ID, telephone number, postal code, jersey number, room number, and account number usually identify rather than measure. Adding two postal codes or averaging two telephone numbers has no contextual meaning. They are categorical identifiers. An identifier may be unique to each unit, which makes it unsuitable for summarizing category frequencies unless the identifier itself is needed for matching records.
Quantitative variables
A quantitative variable, also called a numerical variable, records a counted or measured quantity. Its values have numerical magnitude, and differences or ratios may have contextual meaning. Examples include age in years, commute time in minutes, number of absences, monthly electricity use in kilowatt-hours, package mass in grams, and annual household income in dollars.
Variables in Statistics are quantitative because arithmetic can answer meaningful questions. If one package has mass 500 grams and another 450 grams, the difference is 50 grams. If a household used 900 kilowatt-hours and another used 600, the first used 300 more. The calculation has a unit and an interpretation.
Measured versus counted quantities
How many?
Counts arise from enumerating events or objects: number of children, defects, visits, goals, or messages. They commonly take nonnegative integer values.
How much?
Measurements arise from a scale or instrument: height, time, temperature, mass, distance, or concentration. They can theoretically vary throughout an interval.
Quantitative values require context and units
The value 42 means almost nothing by itself. It could be 42 students, 42 seconds, 42 degrees Celsius, 42 dollars, or a coded category. A complete description includes the variable name and unit: “waiting time, 42 minutes” or “weekly exercise sessions, 4 sessions.” Units make arithmetic interpretable and expose impossible comparisons.
A number can be transformed without losing quantitative meaning
Age in months and age in years describe the same underlying quantity at different scales. Temperature in Celsius and Fahrenheit preserves differences through a linear conversion, though zero has a different interpretation. Income can be stated in dollars or thousands of dollars. The transformed values remain quantitative because the underlying characteristic is measured numerically.
Grouped quantitative data become categorical
If exact ages are recorded, age is quantitative. If ages are reported only as “under 18,” “18–34,” “35–49,” and “50 or older,” the stored variable is an ordered categorical variable. Grouping reduces precision. The underlying characteristic remains age, but the analyzed variable contains age groups, not exact ages.
Discrete and continuous variables
After identifying a quantitative variable, decide whether its possible values are discrete or continuous. The official distinction concerns the set of values the variable can take, not whether a particular data table happens to show decimals.
Discrete quantitative variables
A discrete quantitative variable has a countable set of possible values. The set may be finite, such as the number of correct answers on a 40-question test, or countably infinite, such as the number of customer arrivals before closing if no fixed upper bound is imposed. Counts are usually discrete because values such as 2.4 children or 7.6 defective bulbs are not possible for a single unit under the stated definition.
Continuous quantitative variables
A continuous quantitative variable can take any value within an interval in principle. Height, elapsed time, mass, temperature, distance, speed, and volume are common examples. A digital instrument rounds the recorded result, but the underlying quantity remains continuous. A stopwatch showing 12.47 seconds does not imply that times between 12.47 and 12.48 are impossible; the device simply did not record more precision.
Discrete question
Can the possible values be listed one after another without missing permissible intermediate values? For number of text messages, the values 0, 1, 2, 3, and so on are countable.
Continuous question
Between two possible values, could another value also be possible in principle? Between 10.2 and 10.3 seconds, many additional times are possible.
Decimal does not mean continuous
A discrete variable can be displayed with decimals. A rating score calculated as the mean of ten item responses may take values such as 3.4 or 4.1 but still have a finite set determined by the scoring rule. Currency recorded to the nearest cent has discrete recorded values, although many statistical models treat money as approximately continuous because the increments are extremely fine relative to the scale of interest.
Whole number does not mean discrete
Height rounded to the nearest centimeter appears as whole numbers, but height is a continuous underlying measurement. Age recorded in completed years takes integer values in the data, yet exact age is continuous. A careful answer can distinguish the underlying variable from the recorded version: exact age is continuous; age in completed whole years is discretized by the recording rule.
The instrument does not create the phenomenon
Variables in Statistics should be classified using the conceptual measurement and study purpose. Rounding limits recorded precision. It does not usually turn a naturally continuous quantity into a count. Nevertheless, when a question explicitly asks about the stored values, state the recording rule and explain the distinction.
Explanatory and response variables
Variable type describes what values a variable takes. Variable role describes how the variable is used in an investigative question. A variable can be categorical and explanatory, quantitative and explanatory, categorical and response, or quantitative and response.
Explanatory variable
An explanatory variable is used to explain, predict, group, or account for changes in another variable. It is sometimes called a predictor or independent variable, although “independent variable” can be misleading outside designed experiments. Examples include assigned fertilizer type, study method, daily exercise minutes, or vehicle weight when these are used to explain an outcome.
Response variable
A response variable is the outcome measured or predicted. It is sometimes called the dependent or outcome variable. Examples include plant growth, examination score, blood pressure change, or fuel efficiency, depending on the question.
Explanatory
The variable used to define groups or make a prediction.
Relationship
The study examines how the response differs or changes.
Response
The outcome being explained, compared, or predicted.
Conclusion
The design determines whether association or causation is justified.
The investigative question assigns the role
Suppose a study records sleep duration and mathematics score. If the question asks whether sleep duration predicts mathematics score, sleep is explanatory and score is response. If a different question asks whether academic stress predicts sleep duration, sleep becomes the response. Roles are not permanent properties of the variable name.
Explanatory does not automatically mean causal
In an observational study, an explanatory variable may be associated with a response without causing it. Students who sleep more may differ in workload, health, schedule, or other variables. Random assignment in a well-designed experiment is the major tool for supporting cause-and-effect conclusions. Until design is considered, use language such as “is associated with,” “helps predict,” or “tends to differ.”
Some studies have no explanatory-response structure
A one-variable question such as “What is the distribution of commute times among students at this school?” has one quantitative variable and no explanatory variable. A study may also explore two variables symmetrically, such as whether handedness and preferred keyboard layout are associated. Do not force explanatory and response labels when the purpose does not establish direction.
Units of measurement
A unit of measurement tells what one numerical step represents. Minutes, kilograms, centimeters, dollars, percentage points, kilowatt-hours, beats per minute, and degrees Celsius are units. Counts may use contextual units such as visits, defects, children, or goals.
Attach units to the variable, not only the final answer
Define “commute time in minutes,” not simply “commute time.” Define “distance traveled in kilometers,” not only “distance.” If a data table mixes minutes and hours without conversion, calculations can be wrong even when every arithmetic step is performed correctly.
Units determine the meaning of differences
If one runner’s time is 54 seconds and another’s is 61 seconds, the difference is 7 seconds. If annual income is recorded in thousands of dollars, a difference of 7 means $7,000, not $7. Interpretation requires the scale used in the data.
Rates contain compound units
Speed may be kilometers per hour, medication dosage milligrams per kilogram, population density people per square kilometer, and batting average hits per at-bat. A rate is quantitative, but its numerator and denominator must be specified. “Use” is vague; “monthly electricity use in kilowatt-hours” is measurable.
Dimensionless quantities still need interpretation
Proportions, correlations, standardized scores, and some indices may not carry physical units. A proportion can be expressed as 0.62, 62%, or 62 per 100. A standardized score reports distance in standard-deviation units. “Unitless” does not mean “contextless.”
Precision belongs to the measurement process
A scale reporting to the nearest gram and a laboratory balance reporting to the nearest 0.001 gram do not provide the same precision. Recording unnecessary zeros can falsely imply precision. The variable definition should identify the instrument or rounding rule when that detail matters.
Levels of measurement
Many introductory statistics texts describe four levels of measurement: nominal, ordinal, interval, and ratio. These labels can clarify which comparisons are meaningful, but they should not replace the AP Statistics classification of categorical versus quantitative and discrete versus continuous. Context and the planned analysis still matter.
| Level | Main meaning | Typical example | Meaningful operation |
|---|---|---|---|
| Nominal | Names or unordered categories | Blood type | Same/different; counts and proportions |
| Ordinal | Ordered categories without known equal gaps | Satisfaction level | Order, median category, cumulative proportions |
| Interval | Quantitative scale with meaningful differences but no absolute zero | Temperature in °C | Addition and subtraction of differences |
| Ratio | Quantitative scale with meaningful differences and a meaningful zero | Mass in grams | Differences and ratios |
Nominal and ordinal are categorical
Nominal categories have no inherent order. Ordinal categories have order, but the spacing is not established. A race finishing position of first, second, or third indicates order; it does not tell how many seconds separate competitors. The rank variable is ordinal categorical even though the labels use numbers.
Interval and ratio are quantitative
On an interval scale, equal numerical differences have consistent meaning, but zero is not an absence of the quantity. Zero degrees Celsius is not “no temperature,” so 20°C is not twice as hot as 10°C in a physical ratio sense. On a ratio scale, zero represents absence of the measured quantity under the definition, so 20 kilograms is twice 10 kilograms.
Not every example fits perfectly
Real data can blur textbook boundaries. Calendar year differences are meaningful, but the zero point is conventional. Test scores may be counts of correct answers, scaled scores, or latent-trait estimates. A summed rating scale may be analyzed approximately as quantitative under a documented scoring system, even though each individual item is ordinal. State the recording rule and avoid claiming more precision than the scale supports.
Coding categorical data
Coding converts category labels into a consistent stored form. Good coding improves data entry, storage, analysis, and privacy while preserving meaning. Poor coding can make a categorical variable look quantitative, combine distinct states, or create artificial missing values.
Create a codebook
A codebook names each variable, defines its observational unit, lists allowed values, explains codes, states units, identifies missing-value rules, and records how derived variables were created. For example, transport_mode might allow 1 = walk, 2 = bicycle, 3 = school bus, 4 = private vehicle, 5 = public transit, and 9 = other. The codebook should make clear that the numbers are labels.
Use stable and mutually exclusive categories
If “car” and “private vehicle” both appear, respondents or data-entry staff may classify the same observation differently. If categories change during collection, early and late records may not be comparable. Categories should be clear enough that the same rule produces the same code.
Keep missing, unknown, and not applicable separate
Blank, refused, unknown, and not applicable can represent different states. Using 0 for missing is dangerous when 0 is a valid value. A person can have zero children; coding missing number of children as 0 falsely states that the person has none. Use a dedicated missing marker supported by the software and preserve a reason code when useful.
Binary 0/1 coding
A binary variable is often coded 0 and 1. This is convenient because the mean of a correctly coded 0/1 variable equals the sample proportion coded 1. However, the coding direction must be documented. If 1 = renewed and 0 = did not renew, the mean estimates the renewal proportion. Reversing the codes changes the interpretation.
Dummy or indicator variables
For a variable with several categories, software may create one indicator column per category or omit one category as a reference. For transport mode, walk might be 1 for walkers and 0 otherwise. This is a software representation of a categorical variable, not evidence that transport mode became a measured quantity.
Text cleaning is part of coding
“New York,” “new york,” “NY,” and “N.Y.” may refer to the same category. Leading spaces, spelling variants, and capitalization can create false categories. Cleaning rules should be documented rather than silently guessed. Free-text responses may need a reproducible coding rubric and, for subjective coding, agreement checks among coders.
From raw labels to an analyzable variable
Variable classification decision tree
Use the following sequence whenever a study asks you to identify or classify a variable. The order prevents the most common mistake: deciding from the visible values before reading the definition.
Unit
Identify what one row represents.
Meaning
State the characteristic and recording rule.
Type
Label or group? Count or measurement?
Role
How does it answer the question?
Question 1: Is the value a category label or a numerical quantity?
If it identifies a group or status and arithmetic is not meaningful, classify it as categorical. If it counts or measures and numerical differences have contextual meaning, classify it as quantitative.
Question 2: If quantitative, are the possible values countable?
If the possible values can be listed as separated points, classify as discrete. If any value in an interval is possible in principle, classify as continuous. State rounding if the recorded form differs from the underlying quantity.
Question 3: What role does the question assign?
If the variable defines groups, predicts, or explains, it is explanatory. If it is the outcome being compared or predicted, it is response. If the study is purely descriptive, neither role may be needed.
Question 4: What unit, scale, and coding preserve meaning?
State measurement units for quantitative variables and allowed categories for categorical variables. If codes are used, translate them back to labels. Optionally classify nominal, ordinal, interval, or ratio when that language clarifies valid comparisons.
“The variable is numerical because the values are 1, 2, and 3.”
“The variable is transportation mode, a nominal categorical variable. The digits 1, 2, and 3 are codes for labels, so arithmetic on them is not meaningful.”
Complete worked cases
School commute study
A school records each selected student’s primary transportation mode, one-way commute time in minutes, number of transfers, grade level, and whether the student arrived late. The question asks whether commute time and transportation mode help explain late arrival.
Clinical blood-pressure trial
Adults are randomly assigned to a low-sodium plan or usual diet. Systolic blood pressure change after eight weeks is recorded in mmHg.
Streaming-service records
For each account, analysts record plan type, number of viewing sessions in June, total viewing time in hours, and renewal status.
Weather station archive
Each row is a station-day. Variables include station ID, calendar date, daily maximum temperature in °C, rainfall in millimeters, and weather alert level coded 0, 1, 2, or 3.
Book survey
Each sampled reader reports preferred format, number of books completed last month, typical reading minutes per day, and satisfaction on a five-level scale.
Manufacturing inspection
Each produced bottle is classified by cap color, measured fill volume in milliliters, counted number of label defects, and marked pass/fail. The study asks whether production line predicts fill volume.
Plant-growth experiment
Seedlings are assigned one of three light treatments. Researchers record final height in centimeters and number of new leaves.
Music listening log
Each row represents a listening session and records genre, duration in seconds, number of skipped tracks, and device type. The question is whether device type is associated with session duration.
Common classification errors
Classifying from digits alone
A numeric code can label a category. Translate codes before deciding.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Calling every whole-number variable discrete
Rounded height can appear as whole numbers while the underlying quantity is continuous.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Calling every decimal variable continuous
A calculated rating can have decimals but only a finite set of possible values.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Confusing the observational unit with the variable
“Students” are units; “student height” is a variable.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Naming a topic instead of a variable
“Health” is broad. “Resting heart rate in beats per minute” is a variable.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Omitting units
“Time = 12” is incomplete. State seconds, minutes, hours, or another unit.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Treating ordinal gaps as equal without justification
The order good to excellent is meaningful; the distance is not automatically one fixed unit.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Assuming explanatory means causal
Prediction or grouping does not establish cause without suitable design.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Assigning roles without reading the question
The same variable can be response in one question and explanatory in another.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Combining missing with zero
Zero may be a real measurement; missing means no valid value was recorded.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Using overlapping categories
Age groups 10–20 and 20–30 both contain age 20 unless boundaries are defined.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Using categories that do not cover the population
A response list may omit a necessary “other” or “not applicable” option.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Treating an identifier as a measurement
Account number and postal code identify units; arithmetic summaries are meaningless.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Ignoring the recorded form
Exact age is continuous, but age group is categorical. Analyze what was actually stored.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Forcing explanatory and response labels
A descriptive one-variable study may not have either role.
Variables in Statistics correction: state the observational unit, exact definition, allowed values, and study purpose before choosing a label.
Original Variables in Statistics exercises
For each exercise, identify as many of the following as the information allows: observational unit, variable, categorical or quantitative type, discrete or continuous subtype, explanatory or response role, units, measurement level, and coding issue. Explain every classification in context.
Variables in Statistics Exercise 1
A school records each student’s grade level as 9, 10, 11, or 12. Classify the variable and explain whether the digits make it quantitative.
Variables in Statistics Exercise 2
A nurse records body temperature in degrees Celsius. Identify the variable type, subtype, unit, and measurement level.
Variables in Statistics Exercise 3
A teacher records the number of absent students each day. Identify the observational unit and classify the variable.
Variables in Statistics Exercise 4
A survey stores 1 = bus, 2 = car, 3 = walk, 4 = bicycle. Is the variable quantitative?
Variables in Statistics Exercise 5
A study records package mass to the nearest gram. Is mass discrete or continuous? Explain the role of rounding.
Variables in Statistics Exercise 6
A website records number of pages viewed per visit. Classify the variable.
Variables in Statistics Exercise 7
A customer selects poor, fair, good, very good, or excellent. Classify the variable and level.
Variables in Statistics Exercise 8
A researcher records exact age in years, including decimals. Classify it.
Variables in Statistics Exercise 9
A data set stores age group as under 18, 18–34, 35–49, and 50+. Classify the stored variable.
Variables in Statistics Exercise 10
An experiment assigns fertilizer A, B, or C and measures plant height after six weeks. Identify explanatory and response variables with types.
Variables in Statistics Exercise 11
An observational study asks whether daily screen time predicts sleep duration. Identify roles and explain the causal limitation.
Variables in Statistics Exercise 12
A study describes the distribution of household size in a city. Is there an explanatory variable?
Variables in Statistics Exercise 13
A runner’s bib number is 418. Is bib number quantitative?
Variables in Statistics Exercise 14
A variable contains 0 = no and 1 = yes for whether a customer renewed. Identify its type and explain the mean.
Variables in Statistics Exercise 15
A table uses -99 for missing income. What problem can arise?
Variables in Statistics Exercise 16
A variable records rainfall in millimeters. Classify it and state a possible value issue.
Variables in Statistics Exercise 17
A hospital data set has one row per patient visit, not one row per patient. What is the observational unit?
Variables in Statistics Exercise 18
A variable called score ranges from 0 to 100. Can you classify it without more information?
Variables in Statistics Exercise 19
A survey asks employment status with categories employed, unemployed, student, retired, and other. What type is it?
Variables in Statistics Exercise 20
A study records finishing place 1st through 20th. Is it quantitative?
Variables in Statistics Exercise 21
A thermometer reports Kelvin temperature. Identify the measurement level.
Variables in Statistics Exercise 22
A researcher records calendar year of graduation. Discuss its level.
Variables in Statistics Exercise 23
A school records distance from home to school in kilometers. Classify it.
Variables in Statistics Exercise 24
A data set records number of siblings. Classify it and state the possible values.
Variables in Statistics Exercise 25
A survey records a single Likert response from 1 strongly disagree to 5 strongly agree. Is it quantitative?
Variables in Statistics Exercise 26
Ten Likert items are summed to create a 10–50 scale. How should it be described?
Variables in Statistics Exercise 27
A store records product color and price. Which can be averaged?
Variables in Statistics Exercise 28
A study asks whether vehicle weight predicts fuel efficiency. Identify roles, types, and units that should be recorded.
Variables in Statistics Exercise 29
A study asks whether region is associated with preferred news source. Are explanatory and response roles required?
Variables in Statistics Exercise 30
A student says number of pets is continuous because there is no stated maximum. Correct the claim.
Variables in Statistics Exercise 31
A student says time is discrete because the stopwatch shows hundredths. Correct the claim.
Variables in Statistics Exercise 32
A codebook says sex: 1 male, 2 female, 9 missing. What should be improved?
Variables in Statistics Exercise 33
Categories for age are 0–10, 10–20, and 20–30. Identify the problem.
Variables in Statistics Exercise 34
A survey asks primary language but allows respondents to select every language used. Is primary language the correct variable name?
Variables in Statistics Exercise 35
A data set uses blank for both no response and not applicable. Why is this weak coding?
Variables in Statistics Exercise 36
A school studies the relationship between class size and average test score across classrooms. Identify the observational unit.
Variables in Statistics Exercise 37
A wildlife camera records species label and image brightness. Classify both.
Variables in Statistics Exercise 38
A text response is coded into positive, neutral, or negative sentiment. Classify the coded variable.
Variables in Statistics Exercise 39
A researcher measures reaction time and whether the answer was correct. Classify both variables.
Variables in Statistics Exercise 40
Write a complete variable definition for daily study time.
Complete solutions
Complete Solution 1
Grade level is ordinal categorical. The values indicate ordered categories, not measured numerical distances. The difference from grade 9 to 10 does not represent the same kind of measurable quantity as a difference in height or time.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 2
Body temperature is quantitative, continuous in principle, measured in degrees Celsius, and commonly described as interval level because differences are meaningful but 0°C is not an absence of temperature.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 3
The observational unit is a school day or class-day, depending on the data. Number absent is a discrete quantitative count measured in students.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 4
No. Transportation mode is nominal categorical. The digits are category codes, so averages and numerical differences among the codes have no transportation meaning.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 5
Underlying package mass is continuous quantitative. Recording to the nearest gram discretizes the displayed values but does not make the physical quantity a count.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 6
Number of pages viewed is discrete quantitative because it is a count of pages and takes countable nonnegative integer values.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 7
The rating is categorical and ordinal. Categories have an order, but equal spacing between adjacent labels is not established.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 8
Exact age is continuous quantitative and uses years as the unit. It is generally ratio level because a meaningful zero can be defined at birth and ratios of durations can be interpreted carefully.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 9
The stored age-group variable is ordinal categorical. The underlying age characteristic is quantitative, but grouping replaced exact values with ordered labels.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 10
Fertilizer treatment is a nominal categorical explanatory variable. Height after six weeks is a continuous quantitative response variable measured in a length unit such as centimeters.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 11
Screen time is a quantitative explanatory variable; sleep duration is a quantitative response variable. Because the study is observational, association or prediction does not alone establish that screen time causes changes in sleep.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 12
No. Household size is a discrete quantitative variable in a one-variable descriptive study. There is no required explanatory-response pairing.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 13
No. Bib number is a nominal categorical identifier. It identifies a runner and has no meaningful arithmetic scale.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 14
Renewal status is binary categorical. With 1 = yes, the sample mean of the 0/1 codes equals the sample proportion who renewed.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 15
Software may treat -99 as a real quantitative income, distorting means and graphs. Missing values should be declared using a documented missing-value rule rather than mixed with valid amounts.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 16
Rainfall is continuous quantitative and measured in millimeters. A recorded 0 is a valid no-rain measurement, so it must not be confused with missing.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 17
The observational unit is a patient visit. The same patient may contribute multiple units, so visits and patients must not be counted as identical concepts.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 18
Not completely. It could be number correct, percentage correct, a scaled index, or a category code. The scoring definition is needed to determine type, subtype, units, and interpretation.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 19
Employment status is nominal categorical. The list may need clear rules because some people can fit more than one label, such as employed students.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 20
Finishing place is ordinal categorical. The ranking gives order but not the time gaps between finishers.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 21
Kelvin temperature is quantitative, continuous, and ratio level because zero Kelvin has an absolute physical interpretation and ratios are meaningful within the scale.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 22
Graduation year is quantitative/time-indexed for many analyses; differences in years are meaningful, but the zero point is conventional, so it is commonly treated as interval rather than ratio.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 23
Distance is continuous quantitative, measured in kilometers, and ratio level because zero means no distance under the definition and ratios can be meaningful.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 24
Number of siblings is discrete quantitative. Typical possible values are 0, 1, 2, 3, and so on; negative and fractional siblings are not valid for the count definition.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 25
The item is ordinarily treated as ordinal categorical because numbers code ordered labels and equal distances are not guaranteed.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 26
The summed score is a derived quantitative score with a finite discrete set of possible values. Its interpretation and any approximate interval treatment should be justified by the scoring design.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 27
Price is quantitative and can be averaged when the unit is consistent. Product color is nominal categorical and cannot be meaningfully averaged.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 28
Vehicle weight is a continuous quantitative explanatory variable, perhaps in kilograms. Fuel efficiency is a continuous quantitative response variable, perhaps in kilometers per liter or miles per gallon.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 29
Both variables are categorical. The question is symmetric association, so roles are not inherently required, though a researcher may designate region as explanatory for presentation.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 30
Number of pets is discrete. A discrete variable can have an unbounded or countably infinite set of possible values; it does not need a fixed maximum.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 31
Elapsed time is continuous in principle. The stopwatch rounds or truncates to hundredths; the recording precision does not eliminate possible intermediate times.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 32
The codebook should define the construct and allowed categories inclusively for the study purpose, distinguish missing from substantive categories, and ensure software treats 9 as missing rather than a category or numerical value.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 33
The boundaries overlap at 10 and 20. Use explicit rules such as 0≤age<10, 10≤age<20, and 20≤age≤30, or labels that state inclusive endpoints.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 34
No. Multiple selections measure languages used, not one primary language. The variable design and name must agree; either request one primary language or create separate indicators for each language used.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 35
No response and not applicable have different meanings. Combining them prevents the analyst from distinguishing missing information from a legitimate inapplicable condition.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 36
The observational unit is a classroom. Class size and average score are classroom-level quantitative variables, not individual-student measurements in this data set.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 37
Species label is nominal categorical. Image brightness is quantitative, usually continuous or a finely discretized numerical measurement depending on the image representation.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 38
Sentiment category is ordinal categorical if positive, neutral, and negative are treated as ordered. The original text is raw unstructured data; the coding creates a categorical analytical variable.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 39
Reaction time is continuous quantitative, commonly measured in milliseconds. Correctness is binary categorical.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Complete Solution 40
One acceptable definition is: total elapsed minutes a student reports spending on school-related study outside scheduled class between 12:00 a.m. and 11:59 p.m. on the selected day, rounded to the nearest five minutes.
Method: identify the row unit, translate any codes, decide whether arithmetic measures the characteristic, then use the study question to assign any explanatory-response role.
Mini assessment
Electric-bicycle commuting study
A city samples 240 employed residents who commute at least three days per week. For each resident, the city records primary commute mode coded 1 = private car, 2 = public transit, 3 = bicycle, 4 = electric bicycle, 5 = walking; one-way commute distance in kilometers; typical one-way commute time in minutes; number of late arrivals to work during the previous 20 workdays; satisfaction with commute as very dissatisfied, dissatisfied, neutral, satisfied, or very satisfied; and whether the resident would consider switching to an electric bicycle. The city asks whether commute distance and current commute mode help predict willingness to switch.
Questions
- Identify the observational unit.
- Classify primary commute mode and explain the role of the numeric codes.
- Classify commute distance and commute time, including units and subtype.
- Classify late-arrival count.
- Classify commute satisfaction and state its level.
- Identify explanatory and response variables for the city’s stated question.
- Explain why explanatory does not prove causal influence here.
- Suggest a code for willingness to switch and explain how its sample mean would be interpreted.
- Name one coding or definition detail that should be documented.
Model solution
The observational unit is an employed resident who meets the commuting eligibility rule. Primary commute mode is nominal categorical; digits 1–5 are labels. Distance and time are continuous quantitative variables measured in kilometers and minutes. Late arrivals is a discrete quantitative count. Satisfaction is ordinal categorical. Distance and current mode are explanatory for the stated prediction question; willingness to switch is a binary categorical response. Because residents were observed rather than randomly assigned commute modes, the results can show association or predictive usefulness, not prove that a mode causes willingness. The response may be coded 1 = would consider switching and 0 = would not; its sample mean is then the sample proportion willing to consider switching. The codebook should define “primary,” “typical,” the 20-workday counting window, missing responses, and whether “not sure” is permitted.
Variables in Statistics glossary
| Term | Meaning |
|---|---|
| Observational unit | The item, person, event, or combined entity represented by one observation or row. |
| Variable | A characteristic that may take different values across observational units. |
| Categorical variable | A variable whose values are category names, group labels, or statuses. |
| Nominal variable | A categorical variable with no inherent category order. |
| Ordinal variable | A categorical variable with ordered categories but no established equal spacing. |
| Binary variable | A categorical variable with two categories. |
| Quantitative variable | A variable that records a counted or measured numerical quantity. |
| Discrete variable | A quantitative variable with countable possible values. |
| Continuous variable | A quantitative variable that can take any value in an interval in principle. |
| Explanatory variable | A variable used to define groups, explain variation, or predict a response. |
| Response variable | The outcome measured, compared, or predicted. |
| Unit of measurement | The scale attached to a quantitative value, such as minutes or kilograms. |
| Nominal level | Classification into unordered categories. |
| Ordinal level | Classification into ordered categories. |
| Interval level | A quantitative scale with meaningful equal differences but no absolute zero. |
| Ratio level | A quantitative scale with meaningful differences and meaningful zero. |
| Codebook | Documentation of variable names, definitions, codes, units, allowed values, and missing rules. |
| Indicator variable | A 0/1 variable showing whether an observation belongs to a category or satisfies a condition. |
| Missing value | A state indicating that a valid value is unavailable or was not recorded. |
| Derived variable | A variable calculated or recoded from one or more original variables. |
Frequently asked questions
What is the simplest definition of a variable?
A variable is a characteristic recorded for observational units that can take different values.
What is the main difference between categorical and quantitative variables?
Categorical variables place units into groups or labels. Quantitative variables count or measure numerical amounts for which arithmetic has contextual meaning.
Can a categorical variable contain numbers?
Yes. Numbers may be category codes or identifiers. Their appearance does not make the variable quantitative.
Is a yes/no variable quantitative because it can be coded 0 and 1?
No. The underlying variable is binary categorical. The 0/1 coding is a useful representation.
Why does the mean of a 0/1 variable equal a proportion?
The sum counts the observations coded 1, and dividing by sample size gives the fraction in that category.
Are ordinal variables categorical?
Yes. They have ordered categories, but equal numerical gaps are not guaranteed.
Is every count discrete?
Counts are generally discrete because their possible values are countable. The exact definition should still be checked.
Is every measurement continuous?
Most physical measurements are continuous in principle, though instruments record limited precision. Some numerical scores are constructed discretely.
Does a decimal make a variable continuous?
No. Decimal display does not determine possible values. A finite scoring rule can produce decimal values.
Does a whole number make a variable discrete?
No. A continuous quantity such as height can be rounded to whole units.
Is age discrete or continuous?
Exact age is continuous. Age in completed years is a discretized recorded version. Age groups are ordinal categorical.
Is income discrete or continuous?
Recorded currency is technically discrete to its smallest unit, but income is often treated as approximately continuous at practical scales. State the recording precision.
What is an explanatory variable?
It is a variable used to define groups, explain variation, or predict another variable.
What is a response variable?
It is the outcome being measured, compared, explained, or predicted.
Does explanatory mean causal?
No. Causal claims depend on study design, especially random assignment in experiments.
Can a study have two response variables?
Yes. A study can record multiple outcomes, but each analysis should state which response is being examined.
Can the same variable change roles?
Yes. Roles depend on the investigative question, not the variable name alone.
Does every study have explanatory and response variables?
No. One-variable descriptive studies and symmetric association questions may not require directional roles.
Why are units important?
Units make values and differences interpretable and prevent invalid combinations of incompatible scales.
What is the difference between nominal and ordinal?
Nominal categories are unordered; ordinal categories have a meaningful order.
What is the difference between interval and ratio?
Both support meaningful differences. Ratio scales also have a meaningful zero that permits ratio interpretations.
Are levels of measurement central on the AP Statistics exam?
The course primarily emphasizes contextual categorical/quantitative and discrete/continuous distinctions. Measurement levels are a helpful extension, not a substitute for those core classifications.
What is a codebook?
It is documentation describing variables, values, units, labels, missing rules, and derived calculations.
Why should missing not be coded as zero?
Zero may be a valid value. Treating missing as zero creates false observations and can distort summaries.
What is the difference between missing and not applicable?
Missing means no valid value was obtained. Not applicable means the question does not logically apply to that unit.
Can text be a variable?
Yes. Text can be stored directly or transformed into variables such as topic, sentiment, length, or category using documented rules.
Is postal code quantitative?
Usually no. It is a categorical geographic identifier; arithmetic differences do not measure geographic distance.
Is rank quantitative?
Rank is usually ordinal categorical because it gives order but not the magnitude of differences.
How should I answer a variable-classification question?
Name the observational unit, exact variable, type, subtype if quantitative, role if relevant, units or categories, and a contextual justification.
What comes after Topic 1.2?
Topic 1.3 studies frequency tables, relative frequencies, percentages, ratios, and numerical summaries for one categorical variable.
Variables in Statistics concept recap
- Variables in Statistics begin with a clearly identified observational unit.
- Variables in Statistics must be defined by meaning, not by the appearance of their stored values.
- Variables in Statistics are categorical when values are labels, groups, or statuses.
- Variables in Statistics are quantitative when values measure or count numerical amounts.
- Variables in Statistics can be discrete even when the possible set has no fixed upper limit.
- Variables in Statistics can be continuous even when an instrument rounds every observation.
- Variables in Statistics use explanatory and response labels only when the question establishes those roles.
- Variables in Statistics do not support causal language merely because one variable is called explanatory.
- Variables in Statistics need units whenever a numerical scale represents a measured or counted quantity.
- Variables in Statistics can be nominal or ordinal when categories are unordered or ordered.
- Variables in Statistics can be interval or ratio when numerical scales support meaningful differences.
- Variables in Statistics remain categorical when category labels are replaced by numeric codes.
- Variables in Statistics require a codebook so labels, missing values, and units remain interpretable.
- Variables in Statistics should keep zero separate from missing unless zero truly represents the recorded value.
- Variables in Statistics may change type when exact measurements are grouped into categories.
- Variables in Statistics may change role when the investigative question changes.
- Variables in Statistics should be classified from the recording rule, not from a short column name.
- Variables in Statistics can be derived from photographs, sounds, videos, and text.
- Variables in Statistics are easier to analyze when categories are clear and consistently coded.
- Variables in Statistics answers should always reconnect the classification to the study context.