Expand menu menu_open Minimize Start chapters Home History history History expand_more
{{ item.displayTitle }}
navigate_next
No history yet!
Progress & Statistics equalizer Progress expand_more
Student
navigate_next
Teacher
navigate_next
{{ filterOption.label }}
{{ item.displayTitle }}
{{ item.subject.displayTitle }}
arrow_forward
No results
{{ searchError }}
search
menu_open
{{ courseTrack.displayTitle }}
{{ statistics.percent }}% Sign in to view progress
{{ printedBook.courseTrack.name }} {{ printedBook.name }}
search Use offline Tools apps
Login account_circle menu_open

Drawing and Interpreting Two-Way Frequency Tables

In surveys, multiple questions are often asked. Thus, it can be interesting to study the answers to more than one question at a time. Using a two-way frequency table, the answers to two questions can be analyzed together.
Concept

Categorical Data

Categorical data is data belonging to one or more categories that have a set amount of possible outcomes or values. This is opposed to numerical data, for which all the possible values can't be listed. However, numerical data can be grouped into intervals, making it categorical data. One example of categorical data is whether a person is rocking a mullet. The possible values are then "yes" and "no."
Concept

Frequency Table

A frequency table is a type of table that is used to present categorical data from some kind of measurement. It lists the possible values or outcomes of the category, and how many times each value or outcome has been measured. The results of asking a group of ten people if they prefer cats, dogs, quokkas, or turtles can be presented as follows.

Preference Frequency
Cats
Dogs
Quokkas
Turtles
fullscreen
Exercise

For a school project, Petrus asked some of his classmates how many pets they've had in total in their life. Unsorted, his results were Dividing his data into the groups and how should his frequency table look?

Show Solution
Solution

To begin, we can set up the table. The right column should show frequency, so the left column is "number of pets." Let's add the groups to the left column.

Number of pets Frequency

We can now look at the data and count how many times an answer was given in each group. For instance, five of the classmates answered and three gave an answer of or Filling in the entire table like this gives us the desired frequency table.

Number of pets Frequency
Concept

Two-Way Frequency Table

When categorical data belongs to two categories, such as if people are asked whether they own a car and whether they have a driver's license, it can be presented in a two-way frequency table. One of the categories is represented by the rows of the table, and the other by the columns. The above survey, with participants, could result in the following answers.

Driver's license
Yes No
Car Yes
No

The two categories are then "car" and "driver's license," both with the possible answers "yes" and "no." The entries in the table are called joint frequencies. Often, two-way frequency tables include the total of the rows and columns. These totals are called marginal frequencies. The sum of the "total" row and "total" column are each equal to the sum of all joint frequencies, in this case.

Driver's license
Yes No Total
Car Yes
No
Total
From the table, it can, for instance, be read that out of the people both own a car and have a driver's license, and that of the do not have a driver's license.
Method

Drawing a Two-Way Frequency Table

Organizing data in a two-way frequency table can help with visualization, which in turn makes it easier to analyze and present the data. Consider the following survey.

people took part in an online survey, where they got to choose their preferred hat, top hat or beret. Out of the males that participated, twelve of them prefer a beret. Fifteen of the females chose top hat as their preference.

1

Determine the categories

First, determine the two categories of the table and draw it without frequencies. Here, the participants gave their hat preference and their gender, which are then the two categories. Hat preference can be further divided into top hat and beret, and gender into female and male. This gives the following table.

Hat preference
Top hat Beret Total
Gender Male
Female
Total

The "total" row and columns are included to make room for the marginal frequencies.


2

Fill the table with given data


The given joint and marginal frequencies can now be added to the table.

Hat preference
Top hat Beret Total
Gender Male
Female
Total


3

Find any missing frequencies


Using the given frequencies, more information can potentially be found by reasoning. For instance, out of the males prefers berets, which means that males prefer top hats. Thus, there are males and females who prefer top hats, making a total of participants that prefer top hats. Continuing this reasoning, the entire table can be completed.

Hat preference
Top hat Beret Total
Gender Male
Female
Total


Concept

Joint and Marginal Relative Frequencies

A joint relative frequency is the ratio of a joint frequency and the total number of values or observations. Similarly, a marginal relative frequency is the ratio of a marginal frequency and the total. For the example above, the joint and marginal relative frequencies are found by dividing the frequencies by the number of participants.

Hat preference
Top hat Beret Total
Gender Male
Female
Total
Notice that, ignoring the error margin introduced by rounding, a marginal relative frequency can be found by adding a row or column of joint marginal frequencies. This table shows, for instance, that female's with a preference for berets make up about of the participants.
Concept

Conditional Relative Frequency

A conditional relative frequency is the ratio of a joint frequency and either of its corresponding two marginal frequencies. Alternatively, it can be calculated using relative joint and marginal frequencies. As an example, the following data will be used.

Driver's license
Yes No Total
Car Yes
No
Total

Using the column totals, the left column of joint frequencies should be divided by and the right column by Since the column totals are used, the sum of the conditional relative frequencies will be

Driver's license
Yes No
Car Yes
No
This table shows that, for instance, out of all the participants with a driver's license, about of them own a car, and out of those without a driver's license, do not have a car.
Method

Recognizing Associations in Data

Continuing on the example above, it can be seen that among people with a driver's license, having a car is common, and among those without a license, owning a car is uncommon. Thus, it can be reasoned that there is an association between having a driver's license and owning a car. Finding the conditional relative frequencies using the row totals instead, gives a slightly different result.

Driver's license
Yes No
Car Yes
No

Here, it is shown that among car owners, almost everyone has a driver's license, but among those without a car, roughly half have a driver's license. This isn't as obvious, but it shows a tendency of relating car ownership with having a driver's license, which further confirms the association. In some cases, it is obvious that answers in one category might be the result of the other category, such as in the following example.

Bed time
Before 9.30 a.m. After 9.30 a.m.
Age 10-12
13-15
16-18

A person's bed time might be dependent on their age, but their age is not dependent on their bed time. Because of this, it is recommended to use the age totals when finding the conditional relative frequencies. This gives the distribution of bed time given a certain age span, which will clearly show any association.

Bed time
Before 9.30 a.m. After 9.30 a.m.
Age 10-12
13-15
16-18
A trend of going to bed after 9.30 a.m. as age increases can now be seen in the table. Thus, there is an association.
fullscreen
Exercise

Eugenia is passionate about two things in particular, hot air balloons and forks. Lately, she's run an online survey, where people answer if they have ever flown a hot air balloon and how many forks they have, urging all her friends to share the link to it. She's now finally made a post of the results:

"Thank you, all participants. More than I predicted, of you, have flown in a hot air balloon. Out of these have between eleven and twenty forks, and have between six and ten forks. In total, people have between six and ten forks, and people have never flown in a hot air balloon and have between eleven and twenty forks."

Help her visualize the data by drawing a two-way frequency table including all joint and marginal frequency. Then, draw a two-way table with joint relative and marginal relative frequencies. Finally, find and use the conditional relative frequencies to determine if there are any apparent associations in the data.

Show Solution
Solution

To begin, we'll establish the different categories for this data set. Based on Eugenia's questions, we can sort the data into two categories: "hot air balloon" and "forks." Next, we'll draw a two-way frequency table that organizes Eugenia's results.

Hot air balloon
Yes No Total
Forks 0-5
6-10 22 312
11-20 44 583
Total 75 1105

Notice that the "Yes" column, the "11-20" row, the "Total" row, and the "6-10" row each have only one cell missing. Thus, we can complete each by reasoning.

Hot air balloon
Yes No Total
Forks 0-5
6-10 22 312
11-20 44 583
Total 75 1105

The remaining two cells can be found by reasoning in the same way. First, we'll find the number of people who have not ridden in a hot air balloon and own 0-5 forks, then we'll find the remaining total.

Hot air balloon
Yes No Total
Forks 0-5 9
6-10 22 290 312
11-20 44 583 627
Total 75 1030 1105

Now that we have complete two-way table, we can see the joint and marginal frequencies for Eugenia's data. To find the joint relative and marginal relative frequencies, we'll divide each frequency by the total number of participants,

Hot air balloon
Yes No Total
Forks 0-5
6-10
11-20
Total

From the relative frequencies above, we can notice trends in Eugenia's data. For instance, only of participants have ridden in a hot air balloon, and own between and forks. Lastly, we can calculate the conditional relative frequencies using either the row or the column totals. Here, we'll arbitrarily use the column totals.

Hot air balloon
Yes No
Forks 0-5
6-10
11-20

For both groups of people, those who have and have not ridden in a hot air balloon, few have between and forks, while more than half have between and forks.


{{ 'mldesktop-placeholder-grade-tab' | message }}
{{ 'mldesktop-placeholder-grade' | message }} {{ article.displayTitle }}!
{{ grade.displayTitle }}
{{ exercise.headTitle }}
{{ 'ml-tooltip-premium-exercise' | message }}
{{ 'ml-tooltip-programming-exercise' | message }} {{ 'course' | message }} {{ exercise.course }}
Test
{{ 'ml-heading-exercise' | message }} {{ focusmode.exercise.exerciseName }}
{{ 'ml-btn-previous-exercise' | message }} arrow_back {{ 'ml-btn-next-exercise' | message }} arrow_forward