Types of Data and Measurement Scales

Types of Data and Measurement Scales

Data types tree

Introduction

Before doing any analysis, you must know what kind of data you are holding. The type of data decides which charts, summary statistics, and tests are allowed. Using the wrong tool for a data type is one of the most common analyst mistakes.

The Big Split: Qualitative vs Quantitative

Data types hierarchy

Broad typeAlso calledWhat it describesExamples
QualitativeCategoricalLabels and categoriescolor, country, job title
QuantitativeNumericalCounts and measurementsprice, age, weight

Qualitative Data

Nominal Scale

Categories with no natural order. The labels are just names.

  • Eye color: blue, green, brown
  • City: Warsaw, Berlin, Paris
  • Payment method: card, cash, transfer
You cannot say blue is "greater than" green. The only valid operations are counting (frequencies) and finding the mode.

Ordinal Scale

Categories with a meaningful order, but the gaps between them are not equal or known.

  • Customer satisfaction: very unhappy, unhappy, neutral, happy, very happy
  • Education level: primary, secondary, bachelor, master, doctorate
  • Star ratings: 1 to 5 stars
You can rank values, but you cannot say the distance between 1 star and 2 stars equals the distance between 4 stars and 5 stars.

Quantitative Data

Discrete Data

Values that come from counting and take only whole numbers (or a limited set of values).

  • Number of items in a cart
  • Number of website visits per day
  • Number of defects in a batch

Continuous Data

Values that can take any number within a range, limited only by measurement precision.

  • Weight: 62.4 kg, 62.41 kg, 62.412 kg...
  • Time on page: 143.7 seconds
  • Temperature: 21.56 °C

Why the Distinction Matters

The data type determines your toolkit:

Data typeTypical chartTypical summaryTypical test
NominalBar chartMode, proportionsChi-square
OrdinalBar chart (ordered)Median, percentilesRank-based tests
DiscreteBar chart, histogramMean, median, modeDepends on shape
ContinuousHistogram, box plotMean, std, quartilest-test, ANOVA

Example: Choosing the Wrong Test

A common beginner mistake: running a t-test (which needs continuous data) on star ratings (ordinal). The t-test assumes equal, meaningful intervals, which star ratings do not have. The correct approach is a rank-based test such as the Mann-Whitney U test.

Python: Checking Data Types

import pandas as pd

df = pd.DataFrame({ "country": ["PL", "DE", "PL", "FR", "DE"], "rating": [5, 3, 4, 2, 5], # ordinal "items_in_cart":[1, 3, 0, 2, 5], # discrete "order_value": [42.5, 19.9, 88.0, 12.3, 67.8] # continuous })

print(df.dtypes)

Output:

country         object
rating           int64
items_in_cart    int64
order_value    float64

In pandas, object suggests categorical data, while int64 and float64 are numeric. For cleaner analysis you can convert explicitly:

df["country"] = df["country"].astype("category")
df["rating"] = df["rating"].astype("category")  # ordinal: keep order in mind

Common Pitfalls

  • Treating ordinal data as continuous just because it is stored as numbers.
  • Using a pie chart for continuous data (hides the distribution shape).
  • Reporting a mean for nominal data (what is the "mean" of red and blue?).

Summary

  • Data is qualitative (nominal, ordinal) or quantitative (discrete, continuous).
  • Nominal = unorderable labels; ordinal = ordered labels with unequal gaps.
  • Discrete = counts; continuous = measurements on a continuous scale.
  • Data type decides which charts, summaries, and statistical tests are valid.

Next Lesson

In the next lesson, you will learn about populations and samples, and the sampling methods that keep your analysis honest.

Quiz - Quiz - Types of Data

1. Customer satisfaction ratings (very unhappy, unhappy, neutral, happy, very happy) are what type of data?

2. The number of items in a shopping cart is:

3. Eye color (blue, green, brown) is an example of:

4. Which data type allows any value within a range, limited only by measurement precision?

5. Why can't you run a t-test on star ratings (1-5)?

What is Statistics and Why It Matters