17  Quantitative variable

Discrete or continuous?

A quantitative variable is a function that maps an element of a population to a numerical value (Chapter 16). Working with quantitative variables feels natural, as it aligns with the standard mathematics and physics covered throughout secondary education. Difficulties typically arise when dealing with qualitative variables (Chapter 18)—specifically, confusing qualitative variables with quantitative ones, conflating discrete variables with qualitative ones, or inappropriately applying quantitative tools to qualitative data. These distinctions are addressed in the next section (Chapter 18).

The fundamental distinction rests on the two main categories of numbers: discrete and continuous (Chapter 3). Consequently, there are two corresponding types of quantitative variables based on whether the codomain contains discrete values (such as integers) or continuous values.

The divide between discrete and continuous variables becomes critical when studying probability distributions, statistical inference, and model fitting, primarily because the underlying mathematical machinery required to analyze them differs significantly (Chapter 3)—a topic deferred again to a future version.

In basic descriptive statistics, whether a variable is discrete or continuous rarely alters the computation of summary statistics such as the mean (Chapter 21) or variance (Chapter 23).

Formal

A quantitative variable in statistics is a characteristic of an individual unit in a population that takes on numerical values across observations1.

Quantitative variables are classified into two main types:

  • A quantitative variable is discrete if its set of possible values is countable, typically consisting of isolated points on a number line (Chapter 3).

  • A quantitative variable is continuous if its set of possible values forms an unbroken interval of real numbers. It can take on any value within that interval, constrained only by the precision of the measuring instrument (e.g., the height of a student measured at 1.65 m).

Examples

Below are examples of discrete and continuous variables across different fields. In practice, the underlying population must be defined for these measurement to hold.

Zoological2 metrics:

  • Continuous: weight, height, snout-to-vent length, personal income, grade point average, total surface area of an apartment owned, total land area owned.
  • Discrete: number of offspring, number of limbs, number of cows owned.

Botanical metrics:

  • Continuous: diameter at breast height (dbh), plant height, wood hardness.
  • Discrete: life stage defined by the number of nodes in maize, number of trifoliates in soybean.

Landscape metrics:

  • Continuous: population density, elevation, landscape connectivity, distance to the nearest habitat patch.
  • Discrete: number of individuals in a fragment, number of females in a population.

Tips and warnings

  • A useful rule of thumb: a variable is quantitative if applying standard arithmetic operations (Chapter 1) to its values yields a meaningful result.

  • Quantitative variables are frequently transformed; common transformations include log scaling (Chapter 12), square root transformations, and centering (subtracting each value by the mean).

  • Beware of “fake” quantitative variables. Identifiers such as ZIP codes or phone numbers consist of digits, but they are not quantitative. Adding or averaging two ZIP codes (e.g., Tana 101 and Ambalavao 303) produces no meaningful mathematical interpretation; the numbers serve merely as convenient categorical labels.

  • While discrete quantitative variables consist of integers, qualitative variables has the property of being discrete in the sense that their categories can be indexed by integers. But qualitative variable are not discrete variable.

  • A quantitative variable can take positive, negative, or zero values; sign does not affect whether a variable is discrete or continuous. Because discrete variables are often used for counting, they are frequently non-negative.

  • In taxonomy, count variables (such as the number of floral parts) are sometimes used to classify species. In this context, the population of interest consists of species rather than individual organisms.

Semantic/Terminology/Notation

  • The statistical term discrete is unrelated to the French term “être discret”.

  • Terminology varies across disciplines. Continuous variables are called real numbers (\(\mathbb{R}\)) in mathematics, called numeric in data science, and float or double data types in computer programming.


  1. See Chapter 16 for the formal definition of a variable as a function↩︎

  2. human included↩︎