Foundations of Data Science 📂 Descriptive Statistics · 4 of 11 9 min read

Types of Data — Nominal, Ordinal, Interval and Ratio Explained

Understanding data types is the most fundamental skill in statistics. Learn the four types of data — nominal, ordinal, interval and ratio — with real stories, examples from everyday life, and Python code to handle each type correctly.

Section 01

The Story That Makes It Click

You are a data scientist at a delivery company. Your boss drops four spreadsheets on your desk and says: "Find the average for each of these."

Spreadsheet Column Sample values
ADriver regionNorth, South, East, West, North, East
BCustomer satisfactionVery Happy, Happy, Neutral, Unhappy, Very Happy
COutside temperature at delivery−5°C, 0°C, 12°C, 18°C, 25°C
DPackage weight0.5 kg, 1.2 kg, 4.8 kg, 0.3 kg, 12.0 kg

You open Python and type df.mean() on all four. Spreadsheet D gives a sensible answer — 3.76 kg. The rest either error or produce nonsense. What went wrong?

⚠️
You cannot average "North, South, East, West"

The mean of North and South is not "East." The average satisfaction between "Very Happy" and "Unhappy" is not necessarily "Neutral." And whether −5°C is "half as cold" as 10°C depends on which scale you use. Data type determines which operations are mathematically valid. Using the wrong statistic on the wrong data type produces numbers that look precise but mean nothing.

In 1946, psychologist Stanley Stevens published a landmark paper defining four levels of measurement — also called data types — that answer exactly this question: what can you legitimately do with this data?


Section 02

The Four Types — Overview

The four types form a hierarchy. Each level inherits the properties of all levels below it and adds one more. As you move up the hierarchy, the data becomes more informative and more statistics become valid.

📊 The Hierarchy of Data Types
Nominal
Named categories. No order, no numbers, no gaps. Only tells you which group something belongs to.
Property added: Identity — values have names that distinguish them.
Ordinal
Ordered categories. You know which is bigger or better, but not by how much.
Property added: Order — values can be ranked meaningfully.
Interval
Ordered with equal gaps. The difference between values is meaningful, but zero is arbitrary.
Property added: Equal intervals — the distance between any two adjacent values is the same.
Ratio
Ordered, equal gaps, and true zero. All arithmetic is valid. Zero means "none of it."
Property added: True zero — zero means complete absence of the quantity.
Type Has identity? Has order? Equal gaps? True zero?
NominalYesNoNoNo
OrdinalYesYesNoNo
IntervalYesYesYesNo
RatioYesYesYesYes

Section 03

Nominal Data — Just Names

Nominal data is the simplest type. Values are labels or categories with no natural order. You can count how many are in each category, but you cannot rank them or do arithmetic.

The story — sorting the post room

A post room worker sorts 200 parcels into four regions: North, South, East, West. She counts: 62 North, 48 South, 55 East, 35 West. The mode is North — the most common destination. That is the only statistic that makes sense here.

If someone asks "what is the average region?" the question is meaningless. If someone asks "is North bigger than South?" they mean count, not value. North is not a bigger number than South — it is just a different label.

Valid stats
  • Mode (most common)
  • Frequency counts
  • Percentages
  • Chi-square test
Invalid stats
  • Mean (no average label)
  • Median (no order)
  • Standard deviation
  • Any arithmetic
Real examples
🏷️
  • Blood type: A, B, AB, O
  • Eye colour
  • Programming language
  • Country, city, postcode
SituationNominal columnCorrect question to ask
Customer databaseGenderWhich gender is most common in our users?
Hospital recordsBlood typeWhat percentage of patients are blood type O?
E-commerce ordersPayment methodIs credit card or PayPal used more often?
Job applicationsDegree subjectWhat is the most common degree among applicants?
App analyticsDevice typeWhat share of users are on iOS vs Android?
💡
Nominal data encoded as numbers is still nominal

Many datasets encode nominal categories as integers — 1 = Male, 2 = Female, 3 = Non-binary, or 1 = North, 2 = South, 3 = East, 4 = West. The numbers are just shorthand labels. The average of (1 + 3) / 2 = 2 does not mean "Female." Always check what encoded numbers represent before applying any arithmetic to them.


Section 04

Ordinal Data — Order Without Equal Gaps

Ordinal data has a meaningful order — you know which value is higher or lower. But the gaps between values are not necessarily equal. You cannot say the difference between rank 1 and rank 2 is the same as the difference between rank 4 and rank 5.

The story — the restaurant table

Four friends eat at a restaurant and each rates their experience: Alice gives 5 stars, Bob gives 4 stars, Carol gives 2 stars, Dan gives 5 stars. You know Alice enjoyed it more than Carol. You know 5 stars is better than 4 stars. But is the gap between 4 and 5 the same emotional distance as the gap between 1 and 2?

Not necessarily. The jump from "Terrible" to "Bad" might represent far more improvement in experience than the jump from "Good" to "Excellent." The numbers create an illusion of precision that does not really exist. This is why the median, not the mean, is the correct measure of centre for ordinal data.

🧮 Why the mean misleads on ordinal data
Scenario
Ten customers rate a product on a 1–5 scale:
[5, 5, 5, 5, 5, 1, 1, 1, 1, 1]
Five absolutely love it. Five absolutely hate it.
Mean
(5+5+5+5+5+1+1+1+1+1) / 10 = 30 / 10 = 3.0
Interpretation: "Average satisfaction — customers are neutral." This is completely wrong. Nobody rated it 3. Nobody is neutral.
Median
Sorted: [1, 1, 1, 1, 1, 5, 5, 5, 5, 5]
Median = average of 5th and 6th values = (1+5)/2 = 3.0
Same number — still misleading. This is why for ordinal data you must always look at the full distribution, not just a single central value.
Correct approach
Report the frequency of each rating:
⭐⭐⭐⭐⭐ = 50%   ⭐⭐⭐⭐ = 0%   ⭐⭐⭐ = 0%   ⭐⭐ = 0%   ⭐ = 50%
Bimodal distribution revealed. This product divides opinion completely. That is the real story.
Valid stats
  • Mode
  • Median
  • Percentiles / IQR
  • Frequency distribution
Invalid stats
  • Mean (gaps not equal)
  • Standard deviation
  • Pearson correlation
  • Ratio comparisons
Real examples
📋
  • Star ratings 1–5
  • Education level
  • Pain scale 1–10
  • Likert scale surveys