Frequency tables for discrete and continuous values

Frequency tables often arise in official statistics and are often displayed in bar and pie charts. A frequency table counts the number of members from some 'population' (people, households, businesses, ...) categorised in some way. This grouping of individuals can be one of the following:

Categorical
The classification of an individual is not based on a number, but on some non-numerical characteristic (e.g. married, single, divorced, ...)
Discrete numerical
The classes are whole numbers — usually themselves counts of something (e.g. the number of children in each household)
Continuous numerical
The classes are based on numbers, but the individual values are not restricted to be integers (e.g. household income or calorie intake per day)

Note that we are describing the types of value that are counted here, not the frequencies themselves which are always whole numbers.

Female prisoners in New Zealand

The following three frequency tables describe characteristics of the 262 females in New Zealand prisons in a prison census that was conducted on 20th November 2003.

Categorical Discrete Continuous
Major offence Frequency   Previous periods in custody Frequency   Age Frequency
Violence
Sexual violence
Involving drugs
Traffic
Against property
Miscellaneous
94
83
46
22
9
8
0
1
2
3-5
6-10
11+
161
41
17
28
10
5
14-19
20-29
30-39
40-49
50+
Unavailable
26
87
87
43
14
5
Total
262
  Total
262
  Total
262

The offence type is categorical. The number of previous periods in custody is a discrete numerical value (though it has been presented in the frequency table with some grouping of the values). However the ages of the prisoners are continuous — it is conventional to report ages in whole years, but an age of "20" means any age from 20 until just under 21.

Histograms for continuous measurements

Bar charts and pie charts are commonly used to display frequency tables for categorical and discrete values. However a simple bar chart can be misleading for a frequency table describing a continuous numerical measurement. A modified type of bar chart called a histogram should be used in preference.

A histogram is similar to a bar chart, but:

These issues are explained most clearly in an example.

Ages of New Zealand cars in 2006

Each year, Land Transport New Zealand publishes a frequency table describing the age distribution of cars that have been registered. The following is an extract from the table. Note that the ages are grouped into classes for the oldest cars. (Although the top class is '51 and over', we will treat it as '51-60' for the purpose of this illustration.)

Age in whole years Frequency
Under 1
1
2
3
4
5
...
40
41-50
51 and over
76,483
79,783
76,828
76,650
73,396
75,822
...
3,856
19,832
15,816
Total
2,726,403

The diagram below represents the data with a bar (rectangle) for each class. Initially the bar heights equal the frequencies of the classes.

This bar chart adequately describes the cars aged 40 and younger, but it gives the misleading impression of a bulge in ownership of cars aged 41 and over because the classes are wider. To see what has happened, click the checkbox Group ages 0-4 to combine the first five classes. If the height of the bar for this combined class is its frequency, then it becomes almost 5 times as high as before.

The solution is to divide the total frequency for the combined class by the number of years, so the height is the average frequency per year instead of the raw frequency. Click Correct diagram to do this. Now the visual appearance remains roughly the same when classes are combined.