BIOSTATISTICS • STUDY DESIGN & DATA

Classifying Variables & Scales — Classify variables (categorical, ordinal, continuous) and scales

Understanding measurement scales is the foundation for choosing valid statistical methods in biomedical research.

Historical Context & Motivation

Long before modern biostatistics coalesced into a formal discipline, scientists grappled with a deceptively simple question: how should we represent observations numerically so that mathematical operations on those numbers remain meaningful? Early epidemiologists cataloguing causes of death, for example, assigned numeric codes to disease categories—yet averaging those codes would have been nonsensical. The need for a principled framework to distinguish types of data became apparent as quantitative methods spread from the physical sciences into medicine and the social sciences during the nineteenth and early twentieth centuries.

1830s
Quetelet's "Average Man"
Adolphe Quetelet applied the normal distribution to human body measurements, implicitly treating height and chest circumference as continuous variables and highlighting the importance of measurement type in statistical analysis.
1900
Pearson's Chi-Square Test
Karl Pearson introduced the chi-square goodness-of-fit test, which was explicitly designed for frequency data arising from categorical variables, drawing a practical line between techniques for counted versus measured data.
1946
Stevens' Scales of Measurement
Psychologist S. S. Stevens published his landmark paper "On the Theory of Scales of Measurement" in Science, proposing the four-level taxonomy—nominal, ordinal, interval, ratio—that remains the standard classification taught today.
1970s–1980s
Biostatistical Method Proliferation
The growth of clinical trials and epidemiologic cohort studies demanded careful variable classification so that analysts could match each variable to an appropriate model—logistic regression for binary outcomes, proportional-hazards models for time-to-event data, and mixed-effects models for repeated continuous measures.
2000s–Present
Big Data & Electronic Health Records
As datasets grew to millions of observations drawn from diverse sources, the importance of metadata—explicitly tagging each variable's type and scale—became critical for reproducible analyses and automated pipelines in bioinformatics and precision medicine.

The central question that Stevens' framework addresses—and that every biostatistician confronts at the start of an analysis—is: What mathematical operations are permissible on a given set of numbers? The answer depends entirely on how those numbers were generated—whether they label categories, encode ranks, mark intervals on an arbitrary scale, or represent true quantities with a meaningful zero. Misidentifying a variable's type can lead to invalid summary statistics, inappropriate hypothesis tests, and ultimately flawed clinical conclusions.

Core Principles & Definitions

Before diving into specific categories, it is essential to understand two broad axes of classification. The first axis distinguishes variables by data type—whether the variable's values are qualitative labels or quantitative numbers. The second axis is scale of measurement, which determines the permissible mathematical relationships among values. These two axes are complementary: data type tells you what you are measuring, while scale of measurement tells you how precisely you can interpret the numbers.

1

Categorical (Nominal) Variables

Values represent unordered group labels with no inherent ranking. Examples: blood type (A, B, AB, O), sex assigned at birth, ICD-10 diagnosis codes. The only meaningful operation is testing for equality (=, ≠).
2

Ordinal Variables

Values possess a natural rank order, but the distances between ranks are not guaranteed to be equal. Examples: pain severity (none < mild < moderate < severe), tumor stage (I–IV), Likert-scale responses. You may compare with < and >, but arithmetic means can be misleading.
3

Continuous (Interval/Ratio) Variables

Values are numeric with meaningful, equal intervals. If a true zero exists, the variable is ratio-level (weight, blood pressure); without a true zero, it is interval-level (temperature in °C). Full arithmetic—addition, subtraction, means, standard deviations—is valid.
4

Discrete vs. Continuous Numeric

Even within quantitative data, a distinction arises: discrete variables take on countable values (number of hospitalizations, parity), while continuous variables can assume any value within a range (serum glucose, BMI). This distinction affects distributional assumptions and choice of probability model.
KEY TAKEAWAY
Think of variable classification like a toolbox. A wrench (mean, standard deviation) is designed for ratio-level bolts—using it on a nominal-level screw strips the head. Similarly, computing an average of coded diagnoses is as nonsensical as averaging zip codes. Matching the statistical tool to the variable's scale is the single most important step before any analysis.

Visual Explanation — The Variable Classification Hierarchy

The hierarchy of variable types. Qualitative variables split into nominal and ordinal; quantitative variables split into interval and ratio. As you move from left to right along the bottom bar, permissible mathematical operations increase, reflecting greater information content.

The diagram above captures the essential logic of Stevens' taxonomy. At the leftmost position, nominal variables carry the least quantitative information—numbers serve only as labels, and the sole permissible comparison is equality. Moving rightward, ordinal variables add the concept of rank, so that 'greater than' and 'less than' become meaningful. Interval variables introduce equal spacing between units, which permits addition and subtraction—but ratios are undefined because the zero point is arbitrary (0 °C does not mean 'no temperature'). Finally, ratio variables possess a true zero, enabling multiplication, division, and meaningful statements such as '80 kg is twice 40 kg.' In biostatistics, most physiological measurements—blood pressure, serum creatinine, body mass index—are ratio-level, while survey instruments and staging systems are typically ordinal.

Mathematical Properties of Scales

Stevens formalized each scale by the class of admissible transformations—those mathematical transformations that preserve the information content of the scale. This framework provides a rigorous criterion for deciding which statistics are meaningful at each level. If a summary statistic changes its interpretation under an admissible transformation, it is not a valid descriptor for that scale.

NOMINAL SCALE — ADMISSIBLE TRANSFORMATION
x′ = f(x), where f is any one-to-one (bijective) mapping
Because any relabeling that preserves distinct categories is permissible, the only meaningful statistic is the mode. Proportions and frequency counts are valid summaries. Appropriate test: chi-square or Fisher's exact test.
ORDINAL SCALE — ADMISSIBLE TRANSFORMATION
x′ = f(x), where f is any strictly monotonically increasing function
Monotonic transformations preserve rank order but may stretch or compress intervals. Valid summary: median, percentiles, interquartile range. Appropriate tests: Wilcoxon rank-sum, Kruskal–Wallis, Spearman's ρ.
INTERVAL SCALE — ADMISSIBLE TRANSFORMATION
x′ = ax + b, where a > 0
Positive linear (affine) transformations preserve equal intervals. The arithmetic mean and standard deviation are valid. However, ratios of values are not meaningful (20 °C is not 'twice as hot' as 10 °C). Appropriate tests: t-test, ANOVA, Pearson's r.
RATIO SCALE — ADMISSIBLE TRANSFORMATION
x′ = ax, where a > 0
Only multiplication by a positive constant is permitted (unit conversion). All arithmetic operations—including geometric mean, coefficient of variation, and ratios—are valid. This is the most information-rich scale.
⚠️ Why This Matters Clinically
Consider the ECOG performance status scale (0–5). If you compute a mean ECOG of 2.3 across a cohort and then apply the monotonic relabeling {0→1, 1→3, 2→6, 3→10, 4→15, 5→21}, the new mean is dramatically different—proof that the arithmetic mean is not a valid summary for ordinal data. A median, however, would remain at the same rank position under both labelings.

Detailed Breakdown — Matching Variables to Appropriate Statistics

In biostatistical practice, the classification of a variable directly determines every downstream analytic choice: the descriptive statistics used in Table 1 of a clinical paper, the regression model selected, and even how missing data should be imputed. The following table and diagram provide a practical reference for these decisions.

Summary of permissible statistics and regression models by scale of measurement
ScaleCentral TendencySpreadRegression ModelBiomedical Example
NominalModeDiversity index, entropyLogistic (binary); Multinomial logisticDisease status (present/absent), Blood type
OrdinalMedianIQR, rangeOrdinal logistic (proportional odds)Cancer stage (I–IV), Likert pain score
IntervalMean, MedianSD, variance, IQRLinear regressionTemperature (°C), IQ score
RatioMean, Geometric mean, MedianSD, CV, IQRLinear, Log-linear, Poisson, Cox PHBMI, Serum creatinine, Survival time
A decision flowchart for classifying any variable encountered in a biostatistical dataset. Start at the top and follow the branches by answering simple yes/no questions about the variable's properties.

The flowchart above distills the classification process into three sequential questions. First, determine whether values are numeric. If they are not, the variable is qualitative and may be nominal (no inherent order) or ordinal (ordered categories). If values are numeric, determine whether they are counts of discrete events or measurements along a continuous scale. For continuous numeric variables, the final question—whether a true, non-arbitrary zero exists—separates interval from ratio scales. In practice, most physiological and laboratory measurements in biomedicine are ratio-level, while patient-reported outcomes, staging systems, and quality-of-life indices are ordinal.

Worked Example — Classifying Variables in a Clinical Dataset

Consider a randomized controlled trial studying the effect of a new antihypertensive drug. The case report form collects the following variables for each participant: (a) treatment group (Drug A vs. Placebo), (b) NYHA heart failure class (I–IV), (c) systolic blood pressure in mmHg, (d) body temperature in °F, and (e) number of adverse events during the study. Let us classify each variable and identify the appropriate summary statistics.

Classifying Five Variables from a Clinical Trial
1
Step 1 — Treatment GroupTreatment group has two categories—Drug A and Placebo—with no inherent ranking. It is a nominal (categorical) variable. We summarize it with frequencies and proportions (e.g., 52 % Drug A, 48 % Placebo), and the appropriate comparison test is chi-square or Fisher's exact.
Classification: Nominal → Summary: n (%), Test: χ²
2
Step 2 — NYHA Heart Failure ClassNYHA class takes values I, II, III, IV. These represent progressively worse functional limitation, so there is a clear ordering. However, the difference in severity between Class I and Class II is not necessarily the same as between Class III and Class IV. This variable is ordinal. We report it as median with interquartile range and compare groups using the Wilcoxon rank-sum test.
Classification: Ordinal → Summary: Median (IQR), Test: Wilcoxon
3
Step 3 — Systolic Blood Pressure (mmHg)Blood pressure is measured on a continuous scale with equal intervals, and a reading of 0 mmHg represents a true zero (no pressure). The variable is ratio-level and continuous. We can compute means, standard deviations, and coefficients of variation. If normally distributed, we use a two-sample t-test; otherwise, a Wilcoxon test.
Classification: Ratio (continuous) → Summary: Mean ± SD, Test: t-test or Wilcoxon
4
Step 4 — Body Temperature (°F)Temperature in Fahrenheit (or Celsius) has equal intervals, but 0 °F does not mean 'no thermal energy'—the zero is arbitrary. Technically this is interval-level. In practice, however, we still compute means and standard deviations because those are valid operations on interval data. What we cannot do is say '100 °F is twice as hot as 50 °F.'
Classification: Interval (continuous) → Summary: Mean ± SD, Test: t-test
5
Step 5 — Number of Adverse EventsThe count of adverse events takes integer values 0, 1, 2, 3, …, and zero genuinely means no events occurred. It is a ratio-level discrete variable. We summarize it with mean ± SD (or median and range if skewed) and model it with Poisson or negative-binomial regression.
Classification: Ratio (discrete count) → Summary: Mean ± SD or Median (range), Model: Poisson regression

Common Pitfalls & Practical Tips

Even experienced analysts sometimes misclassify variables, leading to subtle but consequential errors. The table below catalogs the most frequent pitfalls alongside corrective strategies.

Common variable-classification errors in biostatistical analyses
PitfallWhy It's WrongCorrect Approach
Averaging Likert scores (e.g., 1–5 satisfaction)Likert items are ordinal; the gap between 'agree' and 'strongly agree' is not guaranteed to equal the gap between 'disagree' and 'neutral.'Report median and IQR. If averaging a multi-item composite, validate the summated scale psychometrically first.
Treating coded diagnoses as quantitative (e.g., ICD codes)ICD codes are nominal identifiers; numeric operations are meaningless.Use frequency tables, chi-square tests, or clustering on categorical similarity.
Dichotomizing a continuous variable (e.g., 'high' vs. 'low' BMI)Dichotomization discards information and reduces statistical power by up to one-third.Keep the variable continuous in regression models; use splines if non-linearity is suspected.
Confusing discrete counts with continuous measuresModeling counts with linear regression can yield negative predicted values and heteroscedastic residuals.Use Poisson or negative-binomial regression; check for overdispersion.
Treating interval data as ratio (e.g., stating '30 °C is twice as warm as 15 °C')The zero point in Celsius is arbitrary; converting to Fahrenheit changes the ratio.Convert to Kelvin (ratio scale) if ratios are needed; otherwise, report differences, not ratios.
KEY TAKEAWAY
A useful mnemonic to remember the hierarchy is "NOIR"Nominal, Ordinal, Interval, Ratio. Think of it like building a house: each higher level includes everything below it plus something new. Ratio includes all interval properties plus a true zero; interval includes all ordinal properties plus equal spacing; ordinal includes nominal identification plus order.

Connections to Advanced Biostatistical Methods

Variable classification extends its influence well beyond descriptive statistics. As you advance in biostatistics, the measurement scale of your outcome variable will determine your entire modeling strategy. The table below previews how Stevens' scales map onto the generalized linear model (GLM) framework and beyond, providing a bridge to courses in regression analysis, survival analysis, and longitudinal data analysis.

How variable classification maps onto the GLM framework and advanced biostatistical models
Outcome Variable TypeGLM Family / LinkAdvanced Extension
Binary nominal (e.g., disease yes/no)Binomial / logitMixed-effects logistic regression; GEE with logit link for clustered data
Multinomial (≥ 3 unordered categories)Multinomial logit (not strictly GLM)Random-effects multinomial models; competing-risks survival analysis
Ordinal (ordered categories)Cumulative logit (proportional odds)Partial proportional odds; Bayesian ordinal models
Count (discrete ratio)Poisson / log or NB / logZero-inflated Poisson; hurdle models; mixed-effects count models
Continuous ratio (e.g., BMI)Gaussian / identityLinear mixed-effects models; quantile regression; GAMs
Time-to-event (continuous ratio, censored)Cox PH (semi-parametric)Frailty models; accelerated failure time; joint longitudinal-survival models

Notice how each row in the table is anchored by the measurement scale of the outcome. This underscores a central lesson: correct variable classification is not merely a definitional exercise—it is the gateway to every modeling decision in biostatistics. As you encounter more complex study designs involving repeated measures, hierarchical structures, or competing risks, the same classification logic will guide you in choosing the appropriate likelihood, link function, and variance structure.

Practice Problems

PROBLEM 1CONCEPTUAL
A researcher records each patient's insurance type (Private, Medicare, Medicaid, Uninsured). She then assigns numeric codes 1, 2, 3, 4 and computes a mean of 2.1. Is this mean interpretable? Explain why or why not by referencing the variable's measurement scale.
PROBLEM 2BASIC CALCULATION
Five patients rate their postoperative pain on a 0–10 visual analog scale. The scores are: 2, 4, 6, 7, 9. Treating the VAS as ordinal, calculate the median and interquartile range. Then explain why reporting a mean of 5.6 might be misleading.
PROBLEM 3INTERMEDIATE
A public-health dataset contains the variable 'zip code.' A data analyst includes zip code as a continuous predictor in a linear regression model predicting asthma prevalence. (a) What is the measurement scale of zip code? (b) Identify two specific statistical consequences of this misclassification. (c) Suggest a correct modeling strategy.
PROBLEM 4APPLIED
You are designing the analysis plan for a phase III oncology trial. The primary endpoint is overall survival (time from randomization to death). Secondary endpoints include best overall tumor response (complete response, partial response, stable disease, progressive disease) and the number of dose reductions. For each of the three endpoints, (a) classify the variable type and scale, (b) state the appropriate summary statistic(s), and (c) name the statistical model you would use for the primary comparison.
PROBLEM 5CRITICAL THINKING
A colleague argues that summing four 5-point Likert items into a composite score (range 4–20) effectively creates an interval-level variable, justifying the use of t-tests and linear regression. Critically evaluate this claim. Under what conditions, if any, would you accept this practice? What evidence or checks would you require?

Summary

Every biostatistical analysis begins with a deceptively simple question: what kind of data do I have? Variables are first classified as qualitative (categorical) or quantitative (numeric). Qualitative variables may be nominal (unordered labels like blood type) or ordinal (ranked categories like tumor stage). Quantitative variables may be discrete counts or continuous measures, and are further stratified by Stevens' four scales of measurement: nominal, ordinal, interval, and ratio, remembered by the mnemonic NOIR.

The scale determines which mathematical operations are valid: nominal permits only equality checks; ordinal adds ordering; interval adds arithmetic of differences; ratio adds meaningful ratios and a true zero. This hierarchy directly dictates the choice of descriptive statistics (mode → median → mean), hypothesis tests (chi-square → Wilcoxon → t-test), and regression models (logistic → ordinal logistic → linear). Misclassification leads to invalid results—such as averaging nominal codes or dichotomizing continuous measures—so always begin your analysis by explicitly classifying each variable using the three-question flowchart: Is it numeric? Is there order? Is there a true zero?

Varsity Tutors • Biostatistics • Classifying Variables & Scales