18 Qualitative variable
Tsisy idiran’ny qualité!
This chapter builds directly on the preceding material: a qualitative variable is defined simply as any variable that is NOT quantitative (Chapter 17)
There is an inherent paradox in how we understand and use qualitative variables. On one hand, the human brain has a natural propensity to categorize the world: male or female, good or bad, species classifications, or the establishment of national borders. We naturally think in qualitative terms. On the other hand, the foundational tools of mathematics and statistics are built around numbers and arithmetic operations. This creates friction, as it is not immediately obvious what statistical operations apply when observations are non-numerical.
Categorical variables with clear-cut boundaries—such as sex, eye color, or species—rarely cause confusion. Ambiguity arises primarily when qualitative variables are derived from underlying quantitative variables. This fuzziness occurs for two reasons: researchers often lose sight of the original quantitative measurement, and the boundaries used to define the categories are inherently arbitrary. Consider the categories infant, juvenile, and adult: while the underlying variable is continuous age, there is no single universal rule for where one stage ends and the next begins1. Similarly, classifying locations into low, intermediate, or high elevation relies on continuous altitude, yet the specific cutoffs chosen are largely contextual.
A final common misconception is confusing qualitative variables with assessments of quality. In statistical practice, “qualitative” refers strictly to membership in a category, not value judgments. Replacing the term qualitative variable with categorical variable clears up this confusion2.
Formal
A qualitative variable in statistics is a characteristic of an individual unit in a population that takes on non-numerical values across observations3.
Qualitative variables are divided into three main types: nominal, ordinal, and binary.
- A nominal variable consists of categories with no inherent ordering (e.g., eye color, species, or country of origin).
- An ordinal variable possesses a natural sequence or rank among its categories (e.g., infant, juvenile, adult). Note that many ordinal variables are created by binning an underlying continuous quantitative variable (Chapter 17).
- A binary variable is a special case of a qualitative variable that contains exactly two mutually exclusive categories (e.g., yes/no, true/false, or 0/1) (Chapter 33).
Examples
Below are examples illustrating the distinct categories of qualitative variables:
Nominal variables:
Nationality (e.g., Malagasy, English, Kenyan)
Political affiliation (e.g. TGV, TIM, AREMA, MONIMA)
Eye color (e.g., blue, brown, green)
Species name (e.g., Lemur catta, Panthera leo)
ZIP code (e.g., 101, 102, 303)
Notice that while ZIP codes consist of numbers, a ZIP code is a nominal variable rather than a quantitative one. Applying arithmetic operations to ZIP codes yields no mathematical meaning; the numbers serve merely as categorical labels.
Ordinal variables with implicit ordering:
- Education level (e.g., High School, Bachelor’s, Master’s, PhD)
- Customer satisfaction (e.g., Very Dissatisfied, Dissatisfied, Neutral, Satisfied, Very Satisfied)
- Egg size classification (e.g., Small, Medium, Large, Extra Large)
In these cases, ratings or sizes are assigned to discrete categories without measuring an exact underlying numerical continuum. Even if numeric codes are assigned to the categories (such as 1, 2, 3, 4), computing a standard arithmetic average remains conceptually invalid. However, the sequence preserves rank: a rating of 3 reflects higher satisfaction than a 2, and 2 reflects higher satisfaction than a 1.
Ordinal variables derived from an underlying quantitative continuum:
- Age group (e.g., child, teenager, adult, senior; derived from age)
- Income bracket (e.g., low, medium, high; derived from salary)
- Academic grade category (e.g., fail, pass, distinction; derived from a numerical score)
- Elevation zone (e.g., lowland, mid-altitude, highland; derived from altitude)
Binary variables:
- Academic grade category (e.g., fail, pass, distinction; derived from a numerical score)
- Sex (e.g., male, female)
- Question outcomes with two options (e.g., Yes/No responses to “Do you own a car?”)
Tips and warnings
Flexibility of notation: A qualitative variable can be recorded using many different symbolic representations. For example, a binary survival status column can be coded as
dead/alive,d/a,maty/velona,yes/no,Y/N,1/0, oroui/non. It is crucial to distinguish between the underlying value or category and the notation used to represent it. Using numeric symbols like1and0does not make the variable quantitative; they remain shorthand representations for discrete categories. For true quantitative variables, by contrast, the numerical values are fixed by measurement and cannot be arbitrarily renamed.Record quantitative data whenever possible: Collecting data in qualitative categories (such as age brackets) can be faster or easier in the field, but it involves a permanent loss of information. A continuous quantitative variable (like age in years) can always be binned into qualitative categories later, but qualitative categories cannot be converted back into precise quantitative measurements.
Visualization constraints: The structural nature of a variable dictates the appropriate visualization methods. For example, a histogram is strictly designed to show the continuous distribution of quantitative data, whereas qualitative data must be visualized using tools appropriate for counts across discrete categories, such as bar charts.
Encoding binary variables: Any binary qualitative variable can be reframed as a boolean (True/False) question. Instead of recording a variable named
colorwith categoriesBlueorRed, one can define the variable asIs_Blue?with valuesTrueorFalse. Utilizing native boolean types is often computationally advantageous, as programming languages possess dedicated structures to handle two-state logic efficiently (Chapter 33).These variables are not mutually exclusive. Ordinal variables can always be coerced into or considered as a nominal variable by ignoring the order. Whereas the reverse is not possible. It is not possible to order eye color per se. And any variable can always be coerced into a binary variable (blue eye and not blue eye). Binary variable can also be considered as nominal variable.
not only on human↩︎
choosing to use the more confusing popular term in this handbook so not to distance too much to materials at the university↩︎
See Chapter 16 for the formal definition of a variable as a function↩︎