liveBook · Manning

Ordinal data

As explained in The Well-Grounded Data Analyst

Ordinal data consists of categorical values whose categories have a meaningful natural order.

Ordinal data uses categorical values with a meaningful natural order, but without a numerical scale that guarantees equal spacing. Sizes such as small, medium, and large, or survey responses from strongly disagree to strongly agree, are typical examples. section 6.1

Table 6.1 An overview of the different types of data
Name
Categorical or continuous?
Properties
Example
Nominal
Categorical
Data has discrete values, and categories are not ordered.
Colors, political parties
Ordinal
Categorical
Data has discrete values, and categories have a natural order, but spacing is uneven between categories.
T-shirt sizes (S/M/L), survey responses (good versus bad)
Interval
Continuous
Values are spaced evenly, but zero is not an absence of the measurement.
Temperature
Ratio
Continuous
Values are spaced evenly, and zero means an absence of the measurement.
Height, weight

Use the data-type overview to distinguish ordinal categories from nominal data and from interval or ratio measurements. section 6.1

A practical analysis usually involves these decisions:

  • Inspect the actual values rather than trusting storage types: an integer column with only a few discrete values may represent ordered categories. section 6.1
  • Check missing responses and distinguish meaningful ordinal answers from entries such as “No answer given” before analyzing relationships. section 6.4.1 section 7.2.2
  • Use rank-based measures when relating an ordinal variable to a continuous one; Spearman’s rank correlation and Kendall’s tau are practical starting points. section 7.2.2

Survey trust ratings

A Likert-scale question asking how favorable or trustworthy respondents find AI tools produces ordinal data. To compare trust with years of professional coding experience, remove missing or non-answer responses, rank the trust categories, and calculate Spearman’s correlation or Kendall’s tau. section 6.4.1 section 7.2.2

How The Well-Grounded Data Analyst covers it

How deep it goes
Defines ordered categories, inspects numeric-looking columns, and applies rank-based tests while deferring broader categorical testing.
Examples
Uses clothing sizes, Likert responses, heart-disease test categories, and AI-tool trust ratings as examples.
What it assumes
Distinguishes categorical from continuous data and inspects missing values before treating numeric-looking columns as ordered categories.
What you can do after
Apply it via pandas and SciPy by ranking ordered responses, filtering invalid entries, and calculating Spearman’s correlation or Kendall’s tau.
How it connects
Connects categorical data, nominal data, continuous data, missing data, Spearman’s rank correlation, and Kendall’s tau.

Also explained in

Compare how 8 books explain ordinal data →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Well-Grounded Data Analyst. The section links point to the parts of the book it draws on.