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