Making two way tables

Two way tables, also known as contingency tables, show frequencies (counts) as they relate to two variables. To complete a two way table for a set of data, you need to determine the variables of interest, their possible values, and then finally, the frequencies. We will look at how to do this using an example and then also look at how to answer questions about a data set using a two way table.

[adsenseWide]

Example of making a two way table

Suppose that a company is doing market research on a new product and have selected a random sample of potential customers to help choose the most effective TV commercial. Out of the 180 people in the sample 65 viewed the first version, 30 viewed the second version, and the remainder viewed the third. Of those who viewed the first version, 25 indicated that they were likely to buy the product while the rest said they were either unsure or unlikely to buy the product. For those viewing the second version, 20 said they were likely to buy the product and for the third 54 said the same.

Step 1: Identify the variables

There are two variables of interest here: the commercial viewed and opinion. What we call these two variables isn’t that important – just determine which two pieces of information are present in the situation. Everything in the description is about the version of the commercial that the people viewed and their opinion on whether or not they will buy the product.

Step 2: Determine the possible values of each variable.

For the two variables, we can identify the following possible values.

Commercial viewed: version 1, version 2, version 3

Opinion: likely to buy the product, unsure or unlikely to buy the product

Step 3: Set up the table.

Pick one variable to be represented by the rows and one to be represented by the columns. It doesn’t matter which! Then, use the possible values of the variables to represent the rows and columns. Finally, be sure to add a total column and row. It isn’t required, but it is helpful.

two way table setup

Step 4: Fill in the frequencies.

Here, we want to use the problem to determine the frequencies. Let’s go piece by piece through the problem and translate the statements.

Suppose that a company is doing market research on a new product and have selected a random sample of potential customers to help choose the most effective TV commercial. Out of the 180 people in the sample 65 viewed the first version, 30 viewed the second version, and the remainder viewed the third. Of those who viewed the first version, 25 indicated that they were likely to buy the product while the rest said they were either unsure or unlikely to buy the product. For those viewing the second version, 20 said they were likely to buy the product and for the third 54 said the same.

First, we see that 180 people were sampled. This must be the overall total which goes in the bottom right corner.

two way table with total

Out of the 180 people in the sample 65 viewed the first version, 30 viewed the second version, and the remainder viewed the third.

Alright, let’s take the rest of this information and add it into the table.

Of those who viewed the first version, 25 indicated that they were likely to buy the product while the rest said they were either unsure or unlikely to buy the product. For those viewing the second version, 20 said they were likely to buy the product and for the third 54 said the same.

two-way-table-2

Finally, any missing values can be found using the column totals. For example, we know that 65 people viewed version 1 and 25 were then likely to buy the product. So, it must be that \(65 – 25 = 40\) were unsure or unlikely to buy. Continuing this process, we can complete the table.

two-way-table-3

The totals on the right, or row totals were found by adding across: \(25 + 20 + 54 = 99\) and \(40 + 10 + 31 = 81\). So that’s it! We have made our two way table. Here it is all by itself with none of the crazy arrows and circles.
Two way table summarizing this data:
two-way-table-final
While it took a bit of reading, it is a very nice summary to represent this data and can be used to answer many different types of questions.

[adsenseLargeRectangle]

Observations and vocabulary

To double check your work, always make sure that the totals across rows and down columns are correct.

two-way-table-check

The row totals 99 and 81 as well as the column totals 65, 30, and 85 are called marginal frequencies while values inside the table like 25, 20, 54, 40, 10, 31 are called joint frequencies.

two-way-table-joint-marginal-frequencies

As was mentioned above, using a two way table, you can easily answer a wide variety of questions using the joint or marginal frequencies. In those types of problems, it will be very important that you read carefully so you know WHICH frequency to use!