What is a Two-Way Table?
A two-way table displays frequencies for combinations of two categorical variables. Columns correspond to the values of one variable, while the rows relate to the other. The intersection of each row and column displays a frequency or relative frequency of observations having a pair of categorical attributes. Statisticians also refer to them as contingency tables.
Use two-way tables to understand the relationship between categorical variables. For example, is there a relationship between someone’s beverage preference and when they drink it?
Categorical variables have discrete, non-numeric categories. ‘Colors of cars,’ ‘customer satisfaction levels,’ or ‘movie genres’ are ideal candidates.
Two-way tables organize your data and allow you to answer diverse questions. In this post, learn about two-way frequency and relative frequency tables and how to interpret them.
Two-Way Table Examples
Suppose we surveyed people’s preference for coffee or tea and whether they drank it during the morning or evening. We gathered data from 120 participants. Let’s crunch these numbers in a two-way table.
So, what can we glean from this? Well, for starters, we can see relationships. Trends in the data become apparent. We can compare categories and spot patterns.
Reading a two-way table is a breeze. Start with rows and columns. They represent your variables. Each cell shows how often a specific combination of variables occurs. In the tables below, columns represent the time of day—Morning or Evening. Rows represent the preferred beverage—Coffee or Tea.
Frequency Table
Let’s first look at the raw counts in a two-way frequency table. Each cell displays a count (frequency) for a combination of attributes. For example, the top-left cell indicates that 45 people drink coffee in the morning, while the next cell to the right shows there are only 15 evening coffee drinkers.
Morning | Evening | Total | |
Coffee | 45 | 15 | 60 |
Tea | 15 | 45 | 60 |
Total | 60 | 60 | 120 |
This two-way table shows that 45 people prefer coffee in the morning while the same number prefer tea in the evening.
In our sample, coffee drinkers indulge in the morning, while tea consumption occurs in the evening.
You can evaluate conditional distributions by looking across a row or down a column in a two-way table. Conditional distributions hold one variable constant and display the values of the other variable. For instance, look down the Morning column to hold the variable’ time of day’ constant, and you see that the conditional distribution of beverage consumption is coffee 45 and tea 15. This conditional distribution shows that more people drink coffee in the morning than tea.
Learn more about Conditional Distributions in a Table.
In a two-way table, look at the totals for more contextual information. The totals in the right column indicate equal numbers of coffee and tea drinkers in our sample with 60 of each.
The totals along the bottom role similarly indicate that people who drink their preferred beverage in the mornings vs. evenings are equally split.
Statisticians also refer to these totals as marginal distributions. Learn more about Marginal Distributions in a Table.
The bottom-right cell indicates this two-way table represents a total of 120 people. We’ll use this grand total in the next section to calculate the relative frequencies.
Related post: Frequency Table and How to Make Them.
Relative Frequency Table
A two-way relative frequency table doesn’t display the raw counts. Instead, it displays percentages, proportions, or factions. This kind of two-way table shows how a particular combination of attributes relates to the total number of observations. For example, what percentage of the sample are morning coffee drinkers?
Learn more about Relative Frequencies.
Relative frequency tables show the same story as their frequency counterparts. However, when your data have unequal group sizes, it can be easier to see the patterns using percentages.
Morning | Evening | Total | |
Coffee | 37.5% | 12.5% | 50% |
Tea | 12.5% | 37.5% | 50% |
Total | 50% | 50% | 100% |
To calculate the percentages in a two-way relative frequency table, take the raw count for each cell in a frequency table and divide it by the total number. For example, from the earlier table, we know there are 45 morning coffee drinkers out of a grand total of 120: 45 / 120 = 37.5%.
37.5% of people prefer their coffee in the morning, and an equal percentage like their tea in the evening.
The relationship here is clear: people’s beverage preferences depend on the time of day. Morning seems to be coffee time, and evening is tea time. This insight could be incredibly useful for a café adjusting its menu or stock throughout the day. Once again, the power of two-way tables shines through!
Finally, note that a chi-square test of independence can determine whether this relationship is statistically significant.
Comments and Questions