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.

How 120 students travel to school.
Method of travelFrequencyPercentage frequency
Car4235%
Bus3025%
Walk1815%
Train1815%
Bike1210%
Total120100%

Definition

Frequency tables

A frequency table lists each category with its frequency ff, the number of times it occurs. The percentage frequency gives each frequency as a percentage of the total nn, so you can compare categories, and even surveys of different sizes, fairly.

For car: 42120×100%=35%\frac{42}{120} \times 100\% = 35\%.
percentage frequency=fn×100%\text{percentage frequency} = \frac{f}{n} \times 100\%

At another school, 12 of the 75 students surveyed walk to school. What percentage of the students walk?

in \%

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, 360∘360^\circ, stands for all nn data values, and each category gets a sector whose angle is the same fraction of 360∘360^\circ as its frequency is of nn.

For car: 42120×360∘=126∘\frac{42}{120} \times 360^\circ = 126^\circ.
sector angle=fn×360∘\text{sector angle} = \frac{f}{n} \times 360^\circ

In the travel survey, 30 of the 120 students catch a bus. What angle does the bus sector need in a pie chart?

in circ

Worked example

Construct a pie chart of favourite music genres

  • Simple familiar

A Townsville radio station asked 240 listeners to name their favourite music genre.

GenrePopCountryRockHip hopClassical
Frequency8448603018

Calculate the percentage frequency and the sector angle for each genre, and construct a pie chart.

The finished pie chart.

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Check that the frequencies add to nn.

  2. Percentage =fn×100%= \frac{f}{n} \times 100\% and sector angle =fn×360∘= \frac{f}{n} \times 360^\circ.

  3. Check that the angles total 360∘360^\circ, then draw and label each sector.

Watch out for

  • Using the percentage as the angle: drawing 35∘35^\circ for pop instead of 126∘126^\circ.

  • 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.

RatingVery poorPoorAverageGoodVery good
Frequency410183216

What percentage of the passengers rated the service as good or very good?

in \%

Common mistake

Charts that mislead or don't add up

  • Sector angles that don't total 360∘360^\circ. 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 =fn×100%= \frac{f}{n} \times 100\%.

  • 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 =fn×360∘= \frac{f}{n} \times 360^\circ, and the angles total 360∘360^\circ.

  • 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.

Lesson 2 of 80% read

Save your progress with a free account