Foundations of Data Science slides 📂 Introduction · 4 of 10 36 min read

Nominal, Ordinal, Interval & Ratio: The Four Types of Data

Before any statistic makes sense, you have to know what kind of number you're holding. Stevens' four levels — nominal, ordinal, interval, ratio — form a ladder where each rung adds one power: identity, order, equal gaps, true zero. That level decides which statistics are legal, which chart to draw, and how to encode a feature for ML. Includes the true-zero test and a classification flowchart, with animated diagrams.

🏷️

Nominal, Ordinal, Interval & Ratio

Before any statistic makes sense, you have to know what kind of number you're holding. Stevens' four levels of measurement decide which operations are legal — and which produce nonsense that only looks precise.
Nominal Ordinal Interval Ratio

Press Next → or use ← → arrow keys

Section 01

The Intuition — Four Columns, One Question

A delivery spreadsheet — which columns can you average?
Open a delivery dataset and you'll see four kinds of column: driver region (North, South, East, West), customer satisfaction (Unhappy → Very Happy), delivery temperature (−5°C, 12°C, 25°C), and package weight (0.5 kg, 12 kg).

You can average the weights and it means something. You cannot average the regions. Satisfaction and temperature sit somewhere in between. That spectrum — from "labels only" to "fully numeric" — is exactly what the four data types describe.
💡
The Type Decides The Maths

A variable's type determines which operations are mathematically valid. Run the wrong statistic on the wrong type and you get a number that looks authoritative but means nothing — the single most common beginner mistake in statistics.

Section 01 · Stevens' Levels

The Hierarchy — Each Level Adds One Power

Identity Order Equal gaps True zero Nominal named categories Ordinal + ranked order Interval + equal gaps Ratio + true zero
🪜
Four Cumulative Powers

Stevens (1946) ranked measurement into four levels, each inheriting everything below and gaining one new power: identity (can label) → order (can rank) → equal gaps (can subtract) → true zero (can divide). The higher you climb, the more statistics unlock.

Section 02 · Level 1

Nominal — Names, Nothing More

🏷️
What it is
Categories that only name — no order, no arithmetic. Swap the labels around and nothing is lost.
📋
Examples
Blood type (A, B, AB, O), eye colour, country, payment method, iOS vs Android, gender.
Valid stats
Mode, frequency counts, percentages, chi-square. Never a mean or median.
⚠️
Numbers On A Nominal Column Are Still Just Labels

Encoding gender as Male=1, Female=2, Other=3 doesn't make it numeric — the codes are still names. The "average" (1+2)/2 = 1.5 doesn't mean "halfway between Male and Female"; it means nothing. This is exactly why nominal features get one-hot encoded, not treated as quantities, before machine learning.

Section 03 · Level 2

Ordinal — Ranked, But Gaps Aren't Equal

rating (1–5 stars) 5 people 5 people 1 ★ 2 ★ 3 ★ 4 ★ 5 ★ mean = 3.0 ← nobody rated 3!
🚫
The Ordinal Mean Trap

Ten customers: five gave 1 star, five gave 5. The "average" is 3.0 — "neutral" — yet nobody felt neutral; the room is split love/hate. The mean invented a middle that doesn't exist. For ordinal data, report the median and the full distribution, never the mean, because the gap from 1→2 stars isn't guaranteed to equal the gap from 4→5.

Section 04 · Level 3

Interval — Equal Gaps, But No True Zero

📏
What it is
Numeric with equal, meaningful gaps — but zero is an arbitrary point, not "nothing."
🌡️
Examples
Temperature in °C/°F, calendar dates & years, IQ scores, the pH scale.
Valid stats
Mean, standard deviation, Pearson correlation — differences are fully meaningful.
You Can Subtract, But Not Divide

The gap from 10°C to 20°C equals the gap from 20°C to 30°C — so differences are valid. But ratios aren't: 20°C is not "twice as hot" as 10°C, because 0°C doesn't mean "no heat." Move the same temperatures to Fahrenheit and the ratio changes — proof that zero here is just a convention.

Section 05 · Level 4

Ratio — The Full Toolkit

⚖️
What it is
Everything interval has, plus a true zero that means "none of it exists."
📦
Examples
Weight, height, age, income, distance, counts, duration — any true physical measurement.
Valid stats
All of them — plus geometric mean, coefficient of variation, and genuine ratios.
✖️
Now "Twice As Much" Actually Means Something

A 12 kg parcel really is twice as heavy as a 6 kg one, because 0 kg means no weight at all. That true zero unlocks multiplication and division — the reason ratio is the richest level, where every statistic is fair game.

Section 06 · The Key Test

Interval vs Ratio — The True-Zero Test

Temperature (°C) · INTERVAL −10°C (colder still!) 0°C ≠ "no heat" 20°C not "2× 10°C" ✗ zero is arbitrary → no ratios Weight (kg) · RATIO 0 kg = "no weight" ✓ 6 kg 12 kg = 2× 6 kg ✓ true zero → ratios valid
🌡️
One Question Settles It

Ask: does zero mean "none of this thing exists"? 0 kg = no weight, and values can't go negative → ratio. 0°C is just a cold day (it can drop to −10°C) → interval. If zero is a true floor meaning absence, ratios like "twice as much" are valid; if it's arbitrary, they're not.

Section 07 · Classify Any Variable

The Three-Question Decision Flow

Is there a meaningful order? no NOMINAL yes Are the gaps equal & numeric? no ORDINAL yes Does zero mean "none of it"? no INTERVAL yes RATIO
🧭
Three Yes/No Questions, Every Time

Ordered? No → nominal. Equal numeric gaps? No → ordinal. True zero? No → interval, Yes → ratio. Run any column through these three questions and you'll always land on the right type — and therefore the right statistics.

Section 08 · Reference

What's Valid At Each Level

TypeOrder+ / −× / ÷CentreValid stats
NominalModeCounts, %, chi-square
OrdinalMedianPercentiles, IQR
IntervalMeanStd dev, correlation
RatioMean (+ geo)Everything
📈
The Centre Climbs With The Level

Notice the "centre" column: mode works everywhere, the median needs order, and the mean needs equal gaps. Each rung up the ladder unlocks a stronger summary — but never borrow a statistic from a rung above your data.

Section 09 · Pitfalls

Three Mistakes That Look Fine But Aren't

❌ The MistakeWhy It's Wrong✅ Do Instead
Averaging a Likert / star scaleGaps between ranks aren't equalMedian + full distribution
Treating coded categories as numbersCodes are labels, not quantitiesOne-hot encode nominal
Saying "20°C is twice 10°C"Interval has no true zeroCompare differences, not ratios
🎭
False Precision Is The Real Danger

Each of these produces a clean-looking number — "3.0 average satisfaction," "gender = 1.5," "twice as hot." They feel rigorous, which is precisely why they slip into reports and models undetected. The type check is what catches them before they mislead a decision.

Section 10 · In Machine Learning

Type Decides How You Feed A Model

🔢
Nominal → One-Hot
Split into 0/1 dummy columns so the model never invents a false order among categories.
🔣
Ordinal → Ordinal Encode
Map ranks to ordered integers (Low=0, Med=1, High=2) so the model keeps the order — but tread carefully.
📐
Interval / Ratio → Scale
Already numeric — just standardize or normalize so no feature dominates by raw magnitude.
🤖
Wrong Encoding = Silent Bug

Label-encode a nominal column (Red=1, Blue=2, Green=3) and a linear model will believe Green > Blue > Red — a fake ordering that quietly corrupts predictions. Identifying the data type first is what tells you which encoder is safe.

Section 11 · Golden Rules

Six Rules For Data Types

🏅 Nominal → Ratio, Distilled
1Identify the type before any statistic. It dictates every operation that follows.
2Never average nominal or ordinal data. Use mode for nominal, median for ordinal.
3Numbers in a column don't make it numeric. Coded categories are still labels.
4Run the true-zero test to split interval from ratio — only ratio allows "twice as much."
5Always show the distribution for ordinal data — a single number can hide a split crowd.
6Match the encoder to the type — one-hot for nominal, ordinal encode for ordinal, scale for numeric.
Wrap-Up

You Can Now Type Any Variable

NomLabels · mode
OrdRanked · median
IntEqual gaps · mean
RatioTrue zero · all
0=?True-zero test
3 QsDecision flow
🎯
The Through-Line

Stevens' four levels — nominal, ordinal, interval, ratio — form a ladder where each rung adds one power: identity, order, equal gaps, true zero. That level decides which statistics are legal, which chart to draw, and how to encode the feature for a model. Type first, everything else second.

📚
Where To Go Next

With types nailed down, revisit mean, median & mode and variance knowing exactly when each applies, and move on to data visualization — where the type also decides whether you reach for a bar chart, box plot, or histogram.

🏷️ End of tutorial · Press to review, or click Restart