Types of data and categorical data distributions
Start your data work in Year 12 VCE General Mathematics by sorting out types of data. A footy club recording members' postcodes, jumper sizes, ages and games played is collecting four very different kinds of information, and the type decides which tables, graphs and summaries make sense.
You will classify variables as categorical (nominal or ordinal) or numerical (discrete or continuous), and see why a number used as a label is still categorical. You will build frequency tables with percentages, fill gaps in two-way tables, read percentage segmented bar charts and describe a distribution by its mode, before moving on to graphs of numerical data.
Theory
Every data investigation starts by deciding what type of data you have. This Year 12 General Mathematics guide for students in Victoria shows how to classify variables as categorical or numerical, and how to describe categorical data with frequency tables, two-way tables, percentages and segmented bar charts.
A variable is something recorded about each person or object in a data set. A categorical variable places each one in a group or category, such as blood type or the suburb a person lives in. A numerical variable is a count or a measurement.
Categorical variables are nominal when the categories have no natural order (blood type, favourite sport) and ordinal when they do (shirt size S, M, L; a rating from poor to excellent). Numerical variables are discrete when they are counted in whole numbers (number of siblings) and continuous when they are measured and can take any value in a range (height, mass, time).
A frequency table lists each category with its count, and often its percentage. A two-way frequency table counts two categorical variables at once, with row and column totals. A percentage segmented bar chart shows a categorical distribution as one bar split into segments that add to \(100\%\). The category with the largest frequency is the mode.
The percentage of the data in a category:
A count from a percentage:
The size of a segment in a percentage segmented bar chart:
Classifying a variable
- Ask: are the values labels (categorical) or counts and measurements (numerical)?
- If categorical, ask whether the categories have a natural order: ordinal if yes, nominal if no.
- If numerical, ask whether it is counted (discrete) or measured (continuous).
Describing a categorical distribution
- Find the total, then each category's percentage = frequency / total × 100%.
- Name the mode (the category with the largest frequency or the largest segment).
- Write a sentence giving the categories from most to least common, with their percentages.
Reading a two-way frequency table
- Use row totals and column totals to find any missing entry: missing = total − the known entries.
- Check that the row totals and the column totals both add to the grand total.
Decide labels or numbers first, then order (categorical) or counted/measured (numerical).
| Variable | Type | Subtype | Reason |
|---|---|---|---|
| Number of people in the group | Numerical | Discrete | counted in whole numbers |
| Water temperature (°C) | Numerical | Continuous | measured; any value in a range |
| Rating of the beach (poor, fair, good, excellent) | Categorical | Ordinal | labels with a natural order |
| Beach visited | Categorical | Nominal | labels with no order |
The rating is ordinal because excellent is better than good, and good is better than fair. The beach names have no order, so that variable is nominal.
| Coffee | Frequency |
|---|---|
| Flat white | 54 |
| Latte | 63 |
| Cappuccino | 27 |
| Long black | 36 |
Each percentage is frequency / total × 100%.
| \(\text{total}\) | \(=\) | \(54 + 63 + 27 + 36\) |
| \(\) | \(=\) | \(180\) |
| \(\text{latte}\) | \(=\) | \(\dfrac{63}{180} \times 100\%\) |
| \(\) | \(=\) | \(35\%\) |
| \(\text{flat white}\) | \(=\) | \(\dfrac{54}{180} \times 100\%\) |
| \(\) | \(=\) | \(30\%\) |
| Coffee | Frequency | Percentage |
|---|---|---|
| Flat white | 54 | \(30\%\) |
| Latte | 63 | \(35\%\) |
| Cappuccino | 27 | \(15\%\) |
| Long black | 36 | \(20\%\) |
| Total | 180 | \(100\%\) |
The mode is latte (\(35\%\)), followed by flat white (\(30\%\)) and long black (\(20\%\)); cappuccino is the least ordered (\(15\%\)).
Read the top and bottom of the swimming segment from the scale, then use percentage × total.
| \(\text{swimming}\) | \(=\) | \(90\% - 55\%\) |
| \(\) | \(=\) | \(35\%\) |
| \(\text{members}\) | \(=\) | \(35\% \times 260\) |
| \(\) | \(=\) | \(0.35 \times 260\) |
| \(\) | \(=\) | \(91\) |
\(35\%\) of the members swim, which is \(91\) members. Swimming is also the mode, as it is the largest segment.
| Canteen | Home | Total | |
|---|---|---|---|
| Year 11 | 48 | \(a\) | 110 |
| Year 12 | \(b\) | 75 | 130 |
| Total |
Each row adds to its row total.
| \(a\) | \(=\) | \(110 - 48\) |
| \(\) | \(=\) | \(62\) |
| \(b\) | \(=\) | \(130 - 75\) |
| \(\) | \(=\) | \(55\) |
| \(\text{grand total}\) | \(=\) | \(110 + 130\) |
| \(\) | \(=\) | \(240\) |
| \(\text{Year 12 canteen}\) | \(=\) | \(\dfrac{55}{130} \times 100\%\) |
| \(\) | \(\approx\) | \(42.3\%\) |
| Canteen | Home | Total | |
|---|---|---|---|
| Year 11 | 48 | 62 | 110 |
| Year 12 | 55 | 75 | 130 |
| Total | 103 | 137 | 240 |
Check: the column totals \(103 + 137 = 240\) agree with the grand total. About \(42.3\%\) of the Year 12 students buy lunch at the canteen.
Common pitfalls
Frequently asked questions
What is the difference between categorical and numerical data?
Categorical data are labels that put each person or object into a group, such as eye colour. Numerical data are counts or measurements, such as the number of pets or a height in centimetres.
What is the difference between nominal and ordinal data?
Both are categorical. Ordinal categories have a natural order, such as small, medium and large. Nominal categories have no order, such as types of fruit.
What is the difference between discrete and continuous data?
Both are numerical. Discrete data are counted and take separate values, usually whole numbers. Continuous data are measured and can take any value in a range, such as time or mass.
Is a postcode numerical or categorical?
Categorical (nominal). A postcode is a label for an area. Adding or averaging postcodes makes no sense, so it is not numerical data.
How do you read a percentage segmented bar chart?
Each segment shows one category. Its percentage is the reading at the top of the segment minus the reading at the bottom. All the segments in a bar add to 100%.
How do you describe a categorical distribution?
Give the mode (the most common category) and the percentages of the categories, from most to least common, in a sentence.