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:
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:
Writing Hand | Relative Frequency (%) |
---|---|
Left | 7.63 |
Right | 92.37 |
Test your knowledge
- Based on Table 2.1, the number of right-handed people in the sample is .
- Based on Table 2.2, % of people in the sample are left-handed.
- Based on Table 2.2, 92.37% of people in the sample are right-handed. Converted to a proportion, this number is .
- 218
- 7.63
- 0.9237