Types of data and frequency tables
Categorical (nominal and ordinal) and numerical (discrete and continuous) data, ungrouped and grouped frequency tables, cumulative and relative frequency, and class centres.
Before you can choose a graph or a summary statistic, you need to know what kind of data you have. Averaging postcodes or drawing a histogram of favourite colours makes no sense, and it's the type of data that tells you so.
Four types of data
| Type | What it is | Examples |
|---|---|---|
| Categorical, nominal | Labels with no order | favourite sport, transport mode, postcode |
| Categorical, ordinal | Labels with a natural order | T-shirt size, star rating, "strongly disagree … strongly agree" |
| Numerical, discrete | Counted: separate values, usually whole numbers | number of siblings, goals scored, Opal taps |
| Numerical, continuous | Measured: any value in a range | height, time, mass, temperature |
A quick test: if you count it, it's discrete. If you measure it, it's continuous, even if you round the measurement. If adding or averaging the values makes no sense, it's categorical, even when the values are written as numbers.
Classify all twelve items. Aim for $12$ out of $12$.
Which items could be argued two ways? For each one, explain how the way the data is recorded changes its type.
Ungrouped frequency tables
A frequency table lists each value (the score, $x$) and how many times it occurs (the frequency, $f$). Three extra columns make it much more useful:
- Cumulative frequency (cf): a running total of the frequencies. It tells you how many values are less than or equal to each score.
- Relative frequency: $\dfrac{f}{\text{total}}$, the fraction (or percentage) of the data at each score.
- $f \times x$: adding this column and dividing by the total gives the mean.
Thirty students recorded how many people live in their home: $2$ (4 students), $3$ (7), $4$ (10), $5$ (6), $6$ (3). Complete a frequency table and find the mean, median and mode.
| $x$ | $f$ | cf | $f \times x$ |
|---|---|---|---|
| 2 | 4 | 4 | 8 |
| 3 | 7 | 11 | 21 |
| 4 | 10 | 21 | 40 |
| 5 | 6 | 27 | 30 |
| 6 | 3 | 30 | 18 |
| Total | 30 | 117 |
Grouped frequency tables
When data is continuous, or has many different values, a table of every value would be huge and mostly ones. Instead, group the values into classes of equal width, such as $0$ to under $2$, $2$ to under $4$, and so on. Five to ten classes usually works well.
Grouping loses the exact values. To estimate the mean, use the class centre (the midpoint of each class) as if every value in the class were at its centre.
Forty Year 11 students recorded their daily screen time in hours: $0$–$2$: $3$, $2$–$4$: $9$, $4$–$6$: $14$, $6$–$8$: $10$, $8$–$10$: $4$ (each class includes its lower limit but not its upper). Estimate the mean, and find the modal class.
Your turn
From Example 1, what percentage of students live in a home with at least $5$ people?
Show the working
At least $5$ means $5$ or $6$: $6 + 3 = 9$ students. $\dfrac{9}{30} \times 100\% = 30\%$. Or from the cf column: $30 - 21 = 9$.
The time taken to complete a crossword is:
Time is measured, so it can take any value in a range.
Coffee sizes small, medium and large are:
They are categories with a natural order.
The number of pets in a household is:
Pets are counted in whole numbers.
In Example 1, what is the relative frequency of a $5$-person home, as a decimal?
$\dfrac{6}{30} = 0.2$.
In Example 1, how many students live in a home with $3$ or fewer people?
The cumulative frequency at $x = 3$ is $4 + 7 = 11$.
What is the class centre of the class $15$ to under $20$?
$\dfrac{15 + 20}{2} = 17.5$.
Why is the mean from a grouped table only an estimate?
Once grouped, the exact values are lost. The class centre stands in for each of them.
Exam style: In Example 2, how many students spend less than $6$ hours a day on screens?
$3 + 9 + 14 = 26$ (the cumulative frequency up to the $4$ to under $6$ class).
Exam style: Scores $1$, $2$, $3$, $4$ have frequencies $5$, $8$, $x$, $2$, and the total frequency is $40$. Find $x$.
$5 + 8 + x + 2 = 40$, so $x = 40 - 15 = 25$.
Coaching Centre