Statistics

Types of Data and Variables

Last updated: March 2026 · Beginner
Before you start

You should be comfortable with:

Real-world applications
💊
Nursing

Medication dosages, IV drip rates, vital monitoring

Before you can analyze data, you need to know what kind of data you have. The type of data determines which graphs, summary statistics, and analytical methods are appropriate. Applying the wrong technique to the wrong data type produces results that look numerical but mean nothing.

This page covers the three most important classification systems: categorical vs quantitative, discrete vs continuous, and the four levels of measurement.

Categorical vs Quantitative Data

Every variable you encounter falls into one of two broad categories.

Categorical (qualitative) data describes a quality, label, or grouping. The values are names or categories, not numbers you perform arithmetic on. Even when categorical data uses numbers (like zip codes or jersey numbers), those numbers are labels — averaging them would be meaningless.

Examples: blood type, eye color, job title, zip code, marital status, brand preference.

Quantitative (numerical) data represents a measurable quantity. You can add, subtract, and average these values, and the results are meaningful.

Examples: height, temperature, number of patients, test score, annual income, weight.

FeatureCategoricalQuantitative
DefinitionDescribes a category or labelRepresents a measurable amount
ExamplesBlood type, eye color, zip codeHeight, weight, test score
OperationsCount, group, find modeAdd, subtract, average, find standard deviation
Typical GraphsBar chart, pie chartHistogram, box plot, scatter plot

The key test: Can you meaningfully calculate a mean? If yes, the data is quantitative. If the “average” would be nonsensical (like an average blood type), it is categorical.

Example 1: Classifying Hospital Data

A hospital patient record includes these fields. Classify each as categorical or quantitative.

FieldTypeReasoning
Patient nameCategoricalA label identifying the person — you cannot average names
AgeQuantitativeA measurable number — the mean age of patients is meaningful
Blood typeCategoricalA, B, AB, or O are categories with no numerical order
Weight (kg)QuantitativeMeasurable on a continuous scale — you can compute averages
Room numberCategoricalDespite being a number, room 302 is a label — the “average room” is meaningless
Insurance typeCategoricalHMO, PPO, Medicare are categories
Heart rate (bpm)QuantitativeMeasured numerically — you can calculate a mean heart rate
DiagnosisCategoricalDisease names are labels — you count how many patients share each diagnosis

Notice that room number is the classic trap. Just because a value contains digits does not make it quantitative. Ask: does arithmetic on this number produce something meaningful? Adding room 302 and room 115 gives 417, which is not a useful result.

Discrete vs Continuous Variables

Quantitative data divides further into two subtypes based on what values are possible.

Discrete variables have countable values, usually whole numbers. You can list every possible outcome. There is no value “between” two consecutive counts — you cannot have 2.7 children or 14.3 defective items on a production line.

Examples: number of children, number of defective items, patients per shift, cars in a parking lot, emails received per day.

Continuous variables can take any value within a range, including decimals and fractions. Between any two measurements, there is always another possible value. The precision is limited only by your measuring instrument.

Examples: height, weight, temperature, time, blood pressure, distance.

The key distinction: Can there be values between any two data points? If yes, the variable is continuous. If the values jump from one whole number to the next with nothing in between, it is discrete.

Example 2: Identifying Variable Types

A retail store tracks these metrics. Classify each as discrete or continuous.

MetricTypeReasoning
Number of transactions per dayDiscreteYou count whole transactions — there is no such thing as 47.3 transactions
Revenue per dayContinuousRevenue can be any dollar-and-cent amount — $2,847.53, $2,847.54, etc.
Number of returnsDiscreteYou count whole return events: 0, 1, 2, 3, …
Time spent per customer (minutes)ContinuousTime is measurable to any precision — 4.2 minutes, 4.21 minutes, and so on
Number of complaints per dayDiscreteYou count whole complaints: 0, 1, 2, 3, … — no fractional complaints

Number of complaints is a classic discrete variable. You can only have whole counts — there is no such thing as 2.7 complaints in a day.

Levels of Measurement

The levels of measurement are the most important classification system in statistics because they determine exactly which operations and statistics are valid for your data. There are four levels, each building on the one below it.

Nominal

Nominal data consists of categories with no natural order. You can group items and count how many fall into each category, but you cannot rank them.

Examples: blood type (A, B, AB, O), gender, brand preference, country of birth, eye color.

Allowed operations: Count, mode, frequency tables. That is all.

You can say “more patients have Type O than Type AB,” but you cannot say Type O is “greater than” Type AB — the categories have no inherent ranking.

Ordinal

Ordinal data has categories with a meaningful order, but the intervals between categories are not necessarily equal.

Examples: pain scale (0 to 10), education level (high school, bachelor’s, master’s, doctorate), Likert scale responses (strongly disagree, disagree, neutral, agree, strongly agree), military rank, class rank.

Allowed operations: Everything nominal allows, plus ranking, median, and percentiles.

The critical limitation: you can say a master’s degree is “higher” than a bachelor’s, but you cannot say the difference between a bachelor’s and a master’s is the same as the difference between a master’s and a doctorate. The intervals are unequal or undefined.

Interval

Interval data is ordered with equal intervals between values, but there is no true zero point. A value of zero does not mean “none” of the quantity.

Examples: temperature in °F or °C (0°F does not mean “no temperature”), calendar year (year 0 is not “no time”), IQ score, SAT score.

Allowed operations: Everything ordinal allows, plus addition, subtraction, and mean.

You can say that the difference between 60°F and 80°F is the same as the difference between 30°F and 50°F (both are 20°F). But you cannot say 80°F is “twice as hot” as 40°F, because the zero point is arbitrary.

Ratio

Ratio data has all the properties of interval data plus a true, meaningful zero. Zero means “none” of the quantity — zero weight means no weight, zero dollars means no money, zero seconds means no time elapsed.

Examples: weight, height, income, age, time, distance, number of items, blood pressure.

Allowed operations: Everything interval allows, plus multiplication, division, and ratios. You can say “Person A earns twice as much as Person B.”

Reference Table

LevelOrder?Equal Intervals?True Zero?Allowed OperationsExample
NominalNoNoNoCount, modeBlood type
OrdinalYesNoNoRank, medianPain scale
IntervalYesYesNoAdd, subtract, meanTemperature (°F)
RatioYesYesYesMultiply, divide, all statsWeight, income

Levels of Measurement — Each Level Adds a Property

Ratio+ True ZeroInterval+ Equal IntervalsOrdinal+ OrderNominalCategories Only

Each level inherits all properties of the levels below it. Ratio data is also interval, ordinal, and nominal. Interval data is also ordinal and nominal. This means that any analysis valid for a lower level is also valid for a higher level — you can always find the mode of ratio data, for instance — but you cannot apply higher-level operations to lower-level data.

Example 3: Classifying Survey Questions

A workplace satisfaction survey collects the following data. Classify each by level of measurement.

Survey FieldLevelReasoning
Department (Sales, Engineering, HR)NominalCategories with no inherent order
Years of experienceRatioNumeric with equal intervals and a true zero (0 years = no experience)
Satisfaction rating (1 to 5)OrdinalOrdered categories, but the gap between 1 and 2 may not equal the gap between 4 and 5
Daily commute in minutesRatioMeasurable with equal intervals and a true zero (0 minutes = no commute)
Performance review dateIntervalCalendar dates have equal intervals (each day is 24 hours) but no true zero — year 0 is arbitrary

A common mistake is classifying satisfaction ratings as interval data. While the numbers 1 through 5 appear equally spaced, we have no evidence that the psychological difference between “strongly disagree” and “disagree” is the same as between “agree” and “strongly agree.” This is why most statisticians treat Likert-scale data as ordinal.

Why Data Type Matters

Choosing the wrong analysis for your data type leads to meaningless or misleading results. The following table summarizes which visualizations and statistics are appropriate for each type.

Data TypeAppropriate GraphsAppropriate Statistics
Categorical (nominal/ordinal)Bar chart, pie chartMode, frequency counts, chi-square test
Quantitative discreteDot plot, bar chart, histogramMean, median, mode, standard deviation
Quantitative continuousHistogram, box plot, scatter plotMean, median, standard deviation, correlation

For example, calculating the mean of nominal data like zip codes produces a number, but that number is garbage — there is no “average zip code.” Similarly, creating a histogram of categorical data like blood types makes no sense because the x-axis has no meaningful order or scale.

When in doubt, start by identifying the level of measurement. That tells you exactly which statistics and graphs are valid.

Real-World Application: Nursing — Classifying Patient Data

A nurse reviews a patient intake form with the following fields. Each must be classified by data type and level of measurement to determine how it can be analyzed.

FieldCat. / Quant.Discrete / ContinuousLevel of MeasurementReasoning
Patient IDCategoricalNominalA unique label — arithmetic on IDs is meaningless
Age (years)QuantitativeContinuousRatioMeasurable, true zero (age 0 = birth)
GenderCategoricalNominalCategories with no order
Temperature (°F)QuantitativeContinuousIntervalEqual intervals, but 0°F is not “no temperature”
BP category (low / normal / high / critical)CategoricalOrdinalOrdered categories with unequal intervals
Pain level (0 to 10)CategoricalOrdinalOrdered ratings, but intervals between levels are not provably equal
Number of medicationsQuantitativeDiscreteRatioCountable whole numbers, true zero (0 = no medications)
Insurance providerCategoricalNominalLabels with no order
Weight (kg)QuantitativeContinuousRatioMeasurable on a scale, true zero

Why this matters in practice:

  • You can calculate the mean age and mean weight of patients on a ward because both are ratio-level data. You cannot calculate a “mean gender” or “mean insurance provider.”
  • You can rank pain levels — a patient at level 8 is in more pain than one at level 3. But you should not assume the difference between 3 and 4 equals the difference between 7 and 8. The clinical gap between moderate and severe pain may be very different from the gap between mild and moderate.
  • Temperature in Fahrenheit is interval, not ratio. You can say that the difference between 98.6°F and 100.6°F is the same as the difference between 100.6°F and 102.6°F (both 2°F). But you cannot say 100°F is “twice as hot” as 50°F — that comparison requires the Kelvin scale, which has a true zero.
  • Blood pressure category is ordinal. A hospital can report that 40% of patients have “high” BP, but computing a mean of (low, normal, high, critical) requires assigning numeric values — and the choice of those values is subjective, which is why many researchers use the median or mode for ordinal data.

Practice Problems

Test your understanding with these problems. Click to reveal each answer.

Problem 1: Classify each of the following as categorical or quantitative: (a) shoe size, (b) phone number, (c) number of siblings, (d) hair color, (e) GPA.
  • (a) Shoe size — Quantitative. Shoe sizes are numerical and ordered with a meaningful scale (size 10 is larger than size 8).
  • (b) Phone number — Categorical. Despite being digits, a phone number is an identifier — adding two phone numbers produces nothing useful.
  • (c) Number of siblings — Quantitative. A countable number where arithmetic is meaningful (average number of siblings).
  • (d) Hair color — Categorical. Labels like brown, blonde, black describe a quality, not a quantity.
  • (e) GPA — Quantitative. A numerical value where averaging is meaningful.

Answer: (a) Quantitative, (b) Categorical, (c) Quantitative, (d) Categorical, (e) Quantitative.

Problem 2: For each quantitative variable, state whether it is discrete or continuous: (a) number of books read this year, (b) distance from home to work, (c) number of text messages sent per day, (d) body mass index (BMI).
  • (a) Number of books read — Discrete. You count whole books: 0, 1, 2, 3, …
  • (b) Distance from home to work — Continuous. Distance can be 12.3 miles, 12.31 miles, or any value in between.
  • (c) Number of text messages — Discrete. Whole messages only: 0, 1, 2, 3, …
  • (d) BMI — Continuous. BMI is computed from height and weight and can take any decimal value (e.g., 24.7, 24.71).

Answer: (a) Discrete, (b) Continuous, (c) Discrete, (d) Continuous.

Problem 3: Identify the level of measurement for each: (a) jersey numbers on a basketball team, (b) finishing position in a race (1st, 2nd, 3rd), (c) temperature in Kelvin, (d) customer satisfaction (very unsatisfied, unsatisfied, neutral, satisfied, very satisfied).
  • (a) Jersey numbers — Nominal. Numbers are labels, not quantities — player #23 is not “more” than player #11.
  • (b) Finishing position — Ordinal. There is a clear order (1st is better than 2nd), but the time gap between positions varies.
  • (c) Temperature in Kelvin — Ratio. Kelvin has a true zero (0 K = absolute zero, meaning no thermal energy), equal intervals, and meaningful ratios (200 K is twice as hot as 100 K in an absolute sense).
  • (d) Customer satisfaction — Ordinal. The responses have a meaningful order, but the difference between “very unsatisfied” and “unsatisfied” may not equal the difference between “satisfied” and “very satisfied.”

Answer: (a) Nominal, (b) Ordinal, (c) Ratio, (d) Ordinal.

Problem 4: A researcher collects the following data about cars: make (Toyota, Ford, Honda), year of manufacture, mileage (miles driven), and condition rating (poor, fair, good, excellent). What is the highest level of measurement for each variable?
  • Make — Nominal. Brand names are categories with no natural order.
  • Year of manufacture — Interval. Calendar years have equal intervals (each year is the same length), but year 0 is not “no time” — it is an arbitrary reference point. You can say a 2020 car is 10 years newer than a 2010 car, but you cannot say the year 2020 is “twice” the year 1010.
  • Mileage — Ratio. Miles driven has a true zero (0 miles = never driven), equal intervals, and meaningful ratios (60,000 miles is twice 30,000 miles).
  • Condition rating — Ordinal. The ratings have a clear order (excellent is better than good), but the intervals are not equal.

Answer: Make = Nominal, Year = Interval, Mileage = Ratio, Condition = Ordinal.

Problem 5: A clinic reports that the average patient pain score is 4.2 out of 10. A colleague argues this is invalid because pain scores are ordinal. Who is correct, and why?

Your colleague raises a valid statistical point. Pain scores on a 0-to-10 scale are technically ordinal data — the intervals between consecutive values are not provably equal. The difference in actual pain between a 2 and a 3 may not be the same as between a 7 and an 8.

Computing a mean requires at least interval-level data, where equal numerical differences correspond to equal real-world differences. Since pain scales do not guarantee this, a strict interpretation says the mean is not a valid statistic for pain scores.

In practice, however, many healthcare researchers treat pain scores as approximately interval and do compute means, especially when comparing groups or tracking trends over time. The important thing is to acknowledge the assumption and consider reporting the median as well, since the median only requires ordinal data.

Answer: The colleague is technically correct — pain scores are ordinal, and the mean assumes interval-level data. In practice, means of pain scores are widely reported but should be interpreted with caution, and the median should be reported alongside it.

Key Takeaways

  • Categorical data describes qualities or labels (blood type, eye color). Quantitative data represents measurable amounts (height, weight, score).
  • Discrete variables take countable values (number of patients). Continuous variables can take any value in a range (temperature, weight).
  • The four levels of measurement — nominal, ordinal, interval, ratio — form a hierarchy where each level adds a property to the one below it.
  • Nominal data can only be counted. Ordinal adds ranking. Interval adds equal spacing. Ratio adds a true zero and meaningful ratios.
  • The level of measurement determines which statistics are valid: you cannot compute a mean on nominal data or claim meaningful ratios with interval data.
  • Numbers are not always quantitative — zip codes, phone numbers, jersey numbers, and room numbers are categorical despite being digits.
  • When in doubt, ask: “Does arithmetic on this variable produce a meaningful result?” If not, the data is categorical.

Return to Statistics for more topics in this section.

Last updated: March 28, 2026