2.1 Frequency tables and relative frequency tables for nominal data

Frequency tables are used to tell us how many people (or units) fall into each category of a categorical variable. For our next example, we consider the survey data set which contains the responses of Statistics students to a set of questions (Venables and Ripley 2002). This data set can be found in the R package MASS. One of the questions the students were asked was whether they write with the right or left hand. Their responses can be displayed in a simple frequency table, as shown below:

Table 2.1: Frequency table detailing students` dominant writing hand.
Writing Hand Frequency
Left 18
Right 218

As we can see, there are 18 left-handed students and 218 right-handed students.

Relative frequency tables can be used to tell us what percentage of the total group falls into each category. Relative frequencies can be expressed as decimals (or proportions), fractions, or percentages. Percentages can be converted into proportions by dividing by 100 and, conversely, proportions can be converted into percentages by multiplying by 100. The frequency table above could be converted into a relative frequency table as follows:

Table 2.2: Relative frequency table detailing students` dominant writing hand.
Writing Hand Relative Frequency (%)
Left 7.63
Right 92.37

Test your knowledge

  1. Based on Table 2.1, the number of right-handed people in the sample is .
  2. Based on Table 2.2, % of people in the sample are left-handed.
  3. Based on Table 2.2, 92.37% of people in the sample are right-handed. Converted to a proportion, this number is .
  1. 218
  2. 7.63
  3. 0.9237

References

Venables, W. N., and B. D. Ripley. 2002. Modern Applied Statistics with s. Fourth. New York: Springer. https://www.stats.ox.ac.uk/pub/MASS4/.