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.

A scatter plot connecting biological data with a DNA strand and health signal.
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

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.

SECTION 2

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.

SECTION 3

Visual Explanation — The Variable Classification Hierarchy

VARIABLEQUALITATIVEQUANTITATIVENominal= ≠ onlyOrdinal= ≠ < >Interval= ≠ < > + −Ratio= ≠ < > + − × ÷Blood typeSex, GenotypeTumor stagePain scale, ECOGTemp (°C)Calendar yearWeight (kg)BP (mmHg), AgeIncreasing Information Content →NominalOrdinalIntervalRatio
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.

SECTION 4

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),wherefisanyone−to−one(bijective)mappingx′ = 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),wherefisanystrictlymonotonicallyincreasingfunctionx′ = 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,wherea>0x′ = 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,wherea>0x′ = 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.

SECTION 5

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.

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

Summary of permissible statistics and regression models by scale of measurement

Decision Flowchart: Classifying a VariableIs the variable numeric?NoYesDo categories have order?NoYesNOMINALORDINALCountable or continuous?CountCont.DISCRETETrue zero?NoYesINTERVALRATIOe.g., Blood typee.g., Pain scoree.g., # of eventse.g., Temp (°C)e.g., Weight (kg)Tip: Always ask three questions — (1) Numeric? (2) Ordered? (3) True zero?
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.

SECTION 6

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. 1

    Step 1 — Treatment Group

    Treatment 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. 2

    Step 2 — NYHA Heart Failure Class

    NYHA 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. 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. 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. 5

    Step 5 — Number of Adverse Events

    The 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

SECTION 7

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.

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.

Common variable-classification errors in biostatistical analyses

✦

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.

SECTION 8

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.

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

How variable classification maps onto the GLM framework and advanced biostatistical 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.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

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.
Show answer
Insurance type is a nominal variable—the numeric codes are arbitrary labels with no inherent ordering or equal spacing. The mean of 2.1 has no real-world interpretation because the code assignments could be rearranged (e.g., Private = 4, Uninsured = 1) and the mean would change. Any one-to-one relabeling is admissible for nominal data, so the mean is not invariant under permissible transformations. The appropriate summary is the mode (the most common category) along with frequency counts and percentages for each category.

Question 2: BASIC 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.
Show answer
With five ordered values {2, 4, 6, 7, 9}, the median is the third value = 6. The first quartile (Q₁) is the median of {2, 4} = 3, and the third quartile (Q₃) is the median of {7, 9} = 8, giving an IQR of 5 (8 − 3). While a VAS is often treated as approximately continuous in practice, its ordinal nature means that the spacing between consecutive scores may not represent equal increments of pain perception. Reporting a mean of 5.6 implies that the difference between scores 2 and 4 is exactly the same as between 7 and 9, an assumption that has not been validated.

Question 3: INTERMEDIATE

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.
Show answer
(a) Zip code is a nominal variable; the digits are identifiers for geographic regions, not quantities. (b) First, the model would interpret zip code numerically, assuming that a one-unit increase in zip code corresponds to a constant change in asthma prevalence—which is nonsensical (zip 10001 is not 'one unit greater' than 10000 in any meaningful dimension). Second, the estimated regression coefficient would be uninterpretable and could mask genuine geographic variation, leading to biased effect estimates and misleading predictions. (c) The analyst should either include zip code as a set of dummy (indicator) variables if the number of zip codes is small, use multilevel/hierarchical models with zip code as a random effect, or derive meaningful geographic features (e.g., median household income, PM₂.₅ levels) that are themselves continuous ratio-level variables.

Question 4: APPLIED

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.
Show answer
(a) Overall survival is a ratio-level continuous variable (time, with a true zero); it is also subject to right-censoring. Best overall response is an ordinal variable (PD < SD < PR < CR). Number of dose reductions is a ratio-level discrete count variable. (b) For overall survival: median survival time with 95 % CI and Kaplan–Meier curves. For best response: frequency table with n (%) per category, plus median category. For dose reductions: mean ± SD (or median and range if skewed). (c) Overall survival → Cox proportional-hazards model (semi-parametric, handles censoring). Best response → proportional-odds ordinal logistic regression model. Dose reductions → Poisson or negative-binomial regression, depending on whether overdispersion is present.

Question 5: CRITICAL 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?
Show answer
The colleague's claim rests on the assumption that aggregating multiple ordinal items produces a variable whose composite scores behave approximately as if they were interval-level—a position that is widely adopted in psychometrics but remains debated in measurement theory. Conditions under which the practice may be defensible: (1) The items form a unidimensional construct with high internal consistency (Cronbach's α ≥ 0.70), suggesting that they measure the same latent trait. (2) Confirmatory factor analysis supports a single-factor model with adequate fit. (3) The composite score has a roughly symmetric, unimodal distribution, meeting the normality assumption of the t-test at least approximately. (4) Sensitivity analyses using nonparametric methods (Wilcoxon) yield substantively identical conclusions. Checks required: The researcher should report Cronbach's α, the factor loadings, a histogram or Q–Q plot of the composite score, and results from a parallel nonparametric analysis. If the composite is heavily skewed or has low reliability, treating it as interval is unjustified, and ordinal methods should be used instead. This example illustrates that variable classification can sometimes be a pragmatic judgment informed by empirical evidence, not merely a rigid a priori rule.

SUMMARY

Summary

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