Types of Data
Theory
A variable is anything that can be counted, measured or described. Categorical data is labels (nominal or ordinal); numerical data is numbers, either discrete (counted, such as the number of children in a family) or continuous (measured, such as the heights of a basketball team). This Year 8 maths page shows how to tell them apart.
Categorical data is made of names or labels, not amounts, such as red, blue, green. It is nominal when the categories have no natural order (eye colour, sport) and ordinal when they do (small, medium, large; poor, good, excellent).
Numerical data is made of numbers that say how many or how much. It is discrete when the numbers are counted, so only certain values are possible (the number of children in a family), and continuous when they are measured, so any value in a range is possible (height, mass, time, temperature).
The test: counted or measured? Counting moves in separate steps with nothing in between. The steps need not be whole numbers: pizzas ordered by the half are still counted. Measuring with a ruler, scales, a thermometer or a stopwatch can always be done more precisely.
Numbers used as labels are categorical. Bus route numbers, phone numbers and locker numbers are names; adding them means nothing.
Rounding does not make data discrete. A time recorded to the nearest second is still measured, so it is continuous.
The type decides the display. Categories suit a column graph or a sector graph; counted numbers suit a dot plot or a stem-and-leaf plot; measured numbers are grouped for a histogram.
Ask two questions:
| Question | Answer | Type |
|---|---|---|
| Is it a number (an amount)? | No, and no order | categorical (nominal) |
| No, but in order | categorical (ordinal) | |
| Yes, counted | numerical (discrete) | |
| Yes, measured | numerical (continuous) |
| Example | Type |
|---|---|
| favourite colour | categorical (nominal) |
| grades A to E | categorical (ordinal) |
| number of goals | numerical (discrete) |
| mass of a parcel | numerical (continuous) |
Classifying a variable
- Ask: is each value an amount? If not, it is categorical.
- Categorical: is there a natural order? Yes is ordinal, no is nominal.
- Numerical: is it counted or measured? Counted is discrete, measured is continuous.
(i) The number of Year 8 students at each school in a region.
(ii) The suburb each student lives in.
(iii) The volume of water left in each drink bottle.
(iv) How hot a sauce is: mild, medium or hot.
(i) Numbers, counted one by one.
(ii) Names of places, with no order.
(iii) Numbers, and volume is measured.
(iv) Labels, but mild, medium, hot is an order.
(i) Numerical (discrete)
(ii) Categorical (nominal)
(iii) Numerical (continuous)
(iv) Categorical (ordinal)
(i) Classify the ratings.
(ii) Classify the number of visits.
(i) \(3\) stars \(+\) \(4\) stars means nothing, so the stars are labels; but \(1\) star \(<\) \(2\) stars \(< \ldots <\) \(5\) stars is an order.
(ii) \(3\) visits \(+\) \(4\) visits \(= 7\) visits, and visits are counted.
(i) Categorical (ordinal)
(ii) Numerical (discrete)
(i) The rainfall each day, to the nearest millimetre.
(ii) The number of days it rained.
Classify each one.
(i) Rain is measured in a gauge: \(7\) mm could really be \(7.4\) mm or \(7.38\) mm. Rounding only shortens the measurement.
(ii) Rainy days are counted: \(0, 1, 2, \ldots, 31\), with no day between \(8\) and \(9\).
(i) Numerical (continuous)
(ii) Numerical (discrete)
(i) the colours red, blue and green of a set of counters
(ii) the number of children in each family in a street
(iii) the heights of the players in a basketball team.
(i) Categorical (nominal)
(ii) Numerical (discrete)
(iii) Numerical (continuous)
(i) The favourite takeaway meal of each student.
(ii) The mass of each student’s school bag, to the nearest \(100\) g.
(i) Meal names are labels with no order.
(ii) Mass is measured on scales; rounding to \(100\) g does not change that.
(i) Categorical (nominal): a column graph (with gaps) or a sector graph.
(ii) Numerical (continuous): group the masses into classes for a histogram.
Common pitfalls
Frequently asked questions
What is the difference between categorical and numerical data?
Categorical data is labels or names; numerical data is numbers that are amounts.
What is the difference between discrete and continuous data?
Discrete data is counted and has gaps between possible values; continuous data is measured and can take any value in a range.
What is ordinal data?
Categorical data whose categories have a natural order, such as small, medium and large.
Is age discrete or continuous?
Age is measured in time, so it is continuous, even though we usually round it to whole years.
Are phone numbers numerical?
No. Phone numbers are labels, so they are categorical (nominal).