Variables and Variation

Statistics begins with a fundamental question: what are we measuring, and why does it change? A variable is any characteristic, number, or quantity that can be measured or counted and that differs across individuals or objects in a study. The word 'variable' itself signals the core idea — values vary from one case to the next. Before collecting a single data point, a statistician must identify what kinds of variables are involved, because the type of variable determines every subsequent choice: which graph to draw, which summary numbers to compute, and which inference procedure to apply. Variables fall into two grand families. Categorical variables (also called qualitative variables) place each individual into a group or category — for example, a student's favourite subject, a country's continent, or whether a patient recovered from an illness. Quantitative variables, by contrast, record numerical measurements on which arithmetic makes sense — for example, a student's height in centimetres, the number of goals scored in a match, or the temperature of a chemical reaction. Quantitative variables are further divided into discrete (counted values with gaps, such as the number of children in a family: 0, 1, 2, …) and continuous (measured values that can take any real number within a range, such as mass or time). Variation — the fact that measurements differ — is not noise to be eliminated but the engine that drives all statistical inquiry. Some variation is natural and expected (people genuinely differ in height). Some arises from measurement imprecision or experimental conditions. Understanding the sources of variation allows researchers to design better studies, build honest models, and draw conclusions that go beyond the particular data set at hand. This article explores the classification of variables and the origins of variation, equipping you with the conceptual foundations needed for every topic in statistics.

Key takeaways
  • Categorical Variables
  • Quantitative Variables: Discrete vs Continuous
  • The Variable Identification Test
  • Sources of Variation
  • Why Classification Matters

Categorical Variables

A categorical variable assigns each individual to one of a finite set of named groups. The categories may have a natural order — these are called ordinal variables (e.g., survey responses: Strongly Disagree, Disagree, Neutral, Agree, Strongly Agree) — or they may have no meaningful order, in which case they are nominal (e.g., blood type: A, B, AB, O). For categorical variables, the appropriate numerical summary is a count or relative frequency (proportion), and the standard display is a bar chart or pie chart. Arithmetic operations such as averaging category labels are meaningless.

Quantitative Variables: Discrete vs Continuous

A quantitative variable records a number where differences and, often, ratios carry meaning. Discrete quantitative variables take isolated values — usually counts — such as the number of defective items in a batch: possible values are 0, 1, 2, 3, … with no value between consecutive integers. Continuous quantitative variables can theoretically take any value in an interval; examples include the exact mass of a chemical sample or the time to complete a race. In practice, measurement instruments introduce rounding, so continuous data appear discrete, but the underlying quantity is treated as continuous for modelling purposes.

The Variable Identification Test

A quick decision rule: ask two questions. (1) Does it make sense to add, subtract, or average the values? If yes, the variable is quantitative. (2) Does the variable place individuals into named groups? If yes, it is categorical. Apply this to ambiguous cases — for instance, zip codes are strings of digits but are really categorical (nominal) labels; shoe sizes 6, 7, 8, … are ordered categories (ordinal) even though written as numbers, because the arithmetic gap between sizes is not guaranteed to be uniform. Context always determines classification.

Sources of Variation

Variation in data has several identifiable sources. (a) Natural or real variation: individuals genuinely differ — humans have different heights due to genetics and nutrition. This is signal, not error. (b) Induced variation: the experimenter deliberately changes a condition (e.g., different fertiliser doses) to see its effect on a response variable. (c) Measurement variation: every instrument has limited precision; repeated measurements of the same object will differ slightly. (d) Sampling variation: different random samples drawn from the same population will produce different statistics (e.g., different sample means x̄). Sampling variation is quantified by the standard error and is the foundation of inferential statistics. (e) Confounding variation: a lurking variable changes alongside both the explanatory and response variables, making causal conclusions unreliable without proper experimental design.

Why Classification Matters

Choosing a wrong variable type leads to invalid analysis. Computing the mean of nominal category codes (1 = Red, 2 = Blue, 3 = Green) produces a number (e.g., 1.8) with no real-world meaning. Conversely, treating a continuous measurement as categorical by making crude bins discards information and reduces statistical power. The correct classification also determines which measures of centre and spread apply: for categorical data we use mode and relative frequency; for quantitative data we use mean, median, variance, and standard deviation.

The Key Equation

s=∑i=1n(xi−xˉ)2n−1s = \sqrt{\frac{\displaystyle\sum_{i=1}^{n}(x_i - \bar{x})^2}{n - 1}}
  • s — Sample standard deviation (same units as the variable): Measures the typical amount by which individual values deviate from the sample mean; the primary numerical summary of variation for a quantitative variable.
  • x_i — Individual observation (same units as the variable): The measured value of the quantitative variable for the i-th individual in the sample.
  • \bar{x} — Sample mean (same units as the variable): The arithmetic average of all n observations; the balance point of the distribution.
  • n — Sample size (dimensionless (count)): The number of individuals in the sample. Dividing by n − 1 (not n) gives an unbiased estimate of the population variance.

Worked Example

Problem. A researcher records the following data for five students: Name (Alex, Bo, Cara, Dan, Eva), Favourite colour (Blue, Green, Blue, Red, Blue), Number of siblings (1, 0, 3, 1, 2), and Height in cm (162.4, 175.0, 158.3, 180.1, 169.2). (a) Classify each variable as categorical or quantitative, and if quantitative state whether discrete or continuous. (b) Calculate the sample standard deviation of the heights, showing all working.

xˉ=169.0 cm,s=317.304≈8.91 cm\bar{x} = 169.0\text{ cm},\quad s = \sqrt{\frac{317.30}{4}} \approx 8.91\text{ cm}

Answer. Categorical (nominal): Name, Favourite colour. Quantitative discrete: Number of siblings. Quantitative continuous: Height. Sample standard deviation of heights ≈ 8.91 cm.

Figure
Diagram
Variable Classification TreeVARIABLEAny measurable characteristicCATEGORICALPlaces into groupsQUANTITATIVENumerical measurementNominalNo order (colours)OrdinalOrdered (ratings)DiscreteCounted (siblings)ContinuousMeasured (height)Key question: Does averaging the values make sense?Yes → Quantitative | No → Categorical
Origins · 1 minKarl Pearson and how this was discovered
KP
Karl Pearson
1857–1936 · British

Karl Pearson founded much of modern mathematical statistics. He introduced the term 'standard deviation' in 1894, formalising the measurement of variation around a mean, and developed the Pearson correlation coefficient to measure the linear relationship between two quantitative variables. His chi-squared test (1900) provided a rigorous method for analysing categorical data — testing whether observed category frequencies differ significantly from expected frequencies. These tools directly underpin the study of variable types and variation. Pearson was so passionate about statistics that he founded the world's first university statistics department at University College London in 1911, and personally wrote, edited, and produced the journal Biometrika for decades — typesetting much of it himself.

  • Measures of Centre: Mean, Median, Mode — Once variables are classified, the appropriate measure of centre — mean for quantitative, mode for categorical — summarises where values cluster; understanding variable type determines which of these statistics is valid.
  • Measures of Spread: Range, IQR, Standard Deviation — The standard deviation formula introduced here quantifies variation in quantitative variables; this concept extends directly to the full study of spread, including variance and interquartile range.
  • Displaying Categorical Data: Bar Charts and Pie Charts — Correctly identifying a variable as categorical is a prerequisite for choosing bar charts or pie charts as the appropriate graphical display.
  • Sampling and Sampling Variability — Sampling variation — one of the key sources of variation introduced here — is the foundation of all inferential statistics, connecting data exploration to confidence intervals and hypothesis tests.