Lesson 2 of 8 · 14 min
Tables and charts for categorical data
Organise categorical data in a frequency table with percentages, and display it in column, bar and pie charts that suit nominal and ordinal variables.
What you will be able to do
- Organise categorical data in a frequency table and calculate percentage frequencies.
- Construct column and bar charts, keeping ordinal categories in their natural order.
- Calculate sector angles and construct a pie chart.
- Choose between a pie chart and a column or bar chart, and identify the modal category.
A Brisbane high school asks 120 students how they usually travel to school. The raw answers are a long list of words: car, bus, car, walk, train, car, … To see the pattern, first count how many students gave each answer. That count is the answer's frequency.
| Method of travel | Frequency | Percentage frequency |
|---|---|---|
| Car | 42 | 35% |
| Bus | 30 | 25% |
| Walk | 18 | 15% |
| Train | 18 | 15% |
| Bike | 12 | 10% |
| Total | 120 | 100% |
Definition
Frequency tables
A frequency table lists each category with its frequency , the number of times it occurs. The percentage frequency gives each frequency as a percentage of the total , so you can compare categories, and even surveys of different sizes, fairly.
At another school, 12 of the 75 students surveyed walk to school. What percentage of the students walk?
A column chart of the travel data: equal widths, gaps between columns, a frequency axis from zero and a label on each axis.
In a column chart, each category gets a vertical column whose height is its frequency (or percentage). A bar chart is the same idea on its side, with horizontal bars, which is handy when the category names are long. Either way:
- every column has the same width, with gaps between them, because the categories are separate groups;
- the frequency axis starts at zero and has an even scale, so the heights compare fairly;
- both axes are labelled and the chart has a title.
Key idea
Ordering the categories
For a nominal variable any order is fine. Putting the columns from largest to smallest, as above, makes the chart easiest to read. For an ordinal variable, keep the natural order (low, medium, high) so the chart shows how the frequencies change along it.
A pie chart shows how a whole is shared out. The full circle, , stands for all data values, and each category gets a sector whose angle is the same fraction of as its frequency is of .
In the travel survey, 30 of the 120 students catch a bus. What angle does the bus sector need in a pie chart?
Worked example
Construct a pie chart of favourite music genres
A Townsville radio station asked 240 listeners to name their favourite music genre.
| Genre | Pop | Country | Rock | Hip hop | Classical |
|---|---|---|---|---|---|
| Frequency | 84 | 48 | 60 | 30 | 18 |
Calculate the percentage frequency and the sector angle for each genre, and construct a pie chart.
The finished pie chart.
Step 1: Check the total
, which matches the number of listeners.
Step 2: Calculate the percentage frequencies
Pop: . In the same way, country is 20%, rock 25%, hip hop 12.5% and classical 7.5%. They total 100%.
Step 3: Calculate the sector angles
Pop: . In the same way:
Genre Pop Country Rock Hip hop Classical Total Percentage 35% 20% 25% 12.5% 7.5% 100% Angle 126° 72° 90° 45° 27° 360° Each genre gets the same fraction of the circle as its fraction of the listeners.
Step 4: Draw the pie chart
Draw a circle and a radius from the centre to 12 o'clock. Measure with a protractor for pop, then measure each next angle from the edge of the previous sector. Label each sector with its genre and percentage, and add a title.
Checking that the angles total before you draw catches arithmetic slips.
Try it yourself first, then check the working one step at a time.
Answer
Pop 35% (126°), country 20% (72°), rock 25% (90°), hip hop 12.5% (45°) and classical 7.5% (27°), drawn as the pie chart shown.
Method
Check that the frequencies add to .
Percentage and sector angle .
Check that the angles total , then draw and label each sector.
Watch out for
Using the percentage as the angle: drawing for pop instead of .
Leaving the sectors unlabelled or the chart without a title.
Pie chart
Shows each category as a part of the whole. Best with a small number of categories (about two to six) when the proportions are what matter. Sectors of similar size are hard to compare by eye.
Column or bar chart
Compares the frequencies of the categories directly. Works with more categories, makes small differences easy to see, and keeps the natural order of an ordinal variable.
For categorical data, the most common category is the modal category, or mode. In the travel survey it is car. You can't find a mean of car, bus and walk: there are no numbers to add. Percentages and the modal category are the summaries that make sense for categorical data.
A bus company asked 80 passengers to rate its service.
| Rating | Very poor | Poor | Average | Good | Very good |
|---|---|---|---|---|---|
| Frequency | 4 | 10 | 18 | 32 | 16 |
What percentage of the passengers rated the service as good or very good?
Common mistake
Charts that mislead or don't add up
- Sector angles that don't total . Check the total before you draw, allowing a degree or so for rounding.
- Ordinal categories out of order. Very poor, poor, average, good, very good: never sort these by frequency.
- Columns that touch. Touching columns mean a continuous number scale (a histogram). Separate categories need gaps.
- A frequency axis that doesn't start at zero. It exaggerates the differences between columns.
Summary
A frequency table counts each category. Percentage frequency .
Column and bar charts compare categories: equal widths, gaps, a frequency axis from zero, labels and a title.
Keep ordinal categories in their natural order. Nominal categories can go in any order, often largest first.
Pie charts show parts of a whole: sector angle , and the angles total .
For categorical data, report percentages and the modal category. A mean makes no sense.
Finished the lesson?
Try the 3 quick checks above and the lesson completes itself, or mark it complete now.