Types of Data
Classify variables by what they measure. Use worked examples to choose summaries and avoid treating category codes as quantities.
On This Page
Start with the variable, not the spreadsheet format
A column of numbers can contain measurements, counts, ordered responses or category labels. Its storage format does not determine what arithmetic means. Write down the observational unit and what each variable records before choosing a summary.
Imagine a hypothetical delivery dataset. Each row is one delivery, and each column below answers a different question.
| Variable | Kind of data | Useful summary |
|---|---|---|
| Delivery ID 1042 | Identifier | Check uniqueness; do not average IDs |
| Shipping method | Unordered categorical | Counts and percentages |
| Satisfaction: poor, fair, good, excellent | Ordered categorical | Ordered counts; median category if appropriate |
| Number of items | Discrete numerical | Mean, median, range |
| Delivery duration in hours | Continuous numerical measurement | Distribution, mean/median and spread |
A continuous duration rounded to whole hours remains a measurement of a continuous quantity. A count can be large without becoming continuous. The categories of a discrete variable need not be integers: amounts restricted to a fixed price grid are another example.
Measurement scales tell you which comparisons make sense
Nominal values distinguish categories without a meaningful order. Ordinal values have an order, but equal gaps between adjacent categories are not established. Coding poor = 1 and excellent = 4 does not show that the improvement from 1 to 2 is the same as from 3 to 4.
Interval measurements have meaningful differences but an arbitrary zero: 20°C is 10°C warmer than 10°C, but not twice as hot. Ratio measurements have a meaningful zero as well as differences: 20 minutes is twice the duration of 10 minutes. Absolute temperature in kelvin is a ratio scale, unlike Celsius.
These labels guide interpretation rather than mechanically dictating every possible statistical method. Treating an ordinal scale as numerical needs an explicit modeling justification, especially for a single response item.
Worked example: a misleading average
Suppose five delivery methods are coded 1, 1, 2, 3, 3, where 1 means pickup, 2 standard and 3 express. The arithmetic average is 2, but it does not mean the typical customer selected standard. Only one customer did so. Counts are pickup 2, standard 1, express 2; percentages are 40%, 20%, 40%.
If the same values represent item counts, the mean of 2 items is meaningful. Identical numbers require different analyses because the variables have different meanings.
Binary 0/1 indicators are a useful special case: their mean equals the proportion coded 1. State which outcome is coded 1; recoding the outcome reverses the proportion.
Missing values and units belong in the definition
A blank response is not a zero-minute delivery. Keep missingness distinct and report how many observations each summary uses. Record units, coding rules and whether rows can repeat the same customer. Repeated observations affect inference even when the variable type is correctly identified.
Practice
A customer rates service from 1 to 5. Can a score of 4 be interpreted as twice the satisfaction of 2?
Show the explanation
No. The responses are ordered categories unless a measurement model establishes more. Start with counts in each category. Even treating the scores as approximately numerical does not establish a meaningful ratio of satisfaction.
Continue
Build frequency tables, then choose a visual summary. For measurement levels, see OpenStax’s introductory reference.
Did this explanation help?
Your response helps us identify lessons that need more work.