Stat Trek

Teach yourself statistics

Stat Trek

Teach yourself statistics


Two-Way Tables

Statisticians use two-way tables and segmented bar charts to examine the relationship between two categorical variables.

Entries in the cells of a two-way table can be displayed as frequency counts or as relative frequencies (just like a one-way table). Or they can be displayed graphically as a segmented bar chart.

Two-Way Frequency Tables

Below, the two-way table shows the favorite leisure activities for 50 adults - 20 men and 30 women. Because entries in the table are frequency counts, the table is a frequency table.

Dance Sports TV Total
Men 2 10 8 20
Women 16 6 8 30
Total 18 16 16 50

Entries in the "Total" row and "Total" column are called marginal frequencies or the marginal distribution. Entries in the body of the table are called joint frequencies.

If we looked only at the marginal frequencies in the Total row, we might conclude that the three activities had roughly equal appeal. Yet, the joint frequencies show a strong preference for dance among women; and little interest in dance among men.

Two-Way Relative Frequency Tables

The table above used frequency counts to describe preferences for leisure activities. Alternatively, we could have used relative frequencies, like percentages or proportions, to describe the same data. When we use relative frequencies in a two-way table, table entries are are called conditional frequencies or the conditional distribution. Here is a version of the leisure-activity table with proportions in the table cells.

Dance Sports TV Total
Men 0.04 0.20 0.16 0.40
Women 0.32 0.12 0.16 0.60
Total 0.36 0.32 0.32 1.00

Relative Frequency for the Whole Table

Two-way tables can show relative frequencies for the whole table, for rows, or for columns. The table above shows relative frequencies for the whole table. The following table shows relative frequencies (proportions) for rows.

Dance Sports TV Total
Men 0.10 0.50 0.40 1.00
Women 0.53 0.20 0.27 1.00
Total 0.36 0.32 0.32 1.00

Relative Frequency for Table Rows

And, the next table show relative frequencies (proportions, again) for columns.

Dance Sports TV Total
Men 0.11 0.62 0.50 0.40
Women 0.89 0.38 0.50 0.60
Total 1.00 1.00 1.00 1.00

Relative Frequency for Table Columns

Each type of relative frequency table makes a different contribution to understanding the relationship between gender and preferences for leisure activities. For example, the "Relative Frequency for Rows" table most clearly shows the probability that each gender will prefer a particular leisure activity. It is easy to see that the probability that a man will prefer dance is 10%; the probability that a woman will prefer dance is 53%; the probability that a man will prefer sports is 50%; and so on.

Segmented Bar Charts

Sometimes, relationships are easier to detect when they are displayed graphically in a segmented bar chart. A segmented bar chart has one bar for each level of a categorical variable. Each bar is divided into "segments", such that the length of each segment indicates proportion or percentage of observations in a second variable.

Bar chart shows preferences for dance, sports, and TV by gender

The segmented bar chart above uses data from the "Relative Frequency for Rows" table that we discussed earlier. It shows that women have an strong preference for dance; while men seldom make dance their first choice. Men are most likely to prefer sports, but the degree of male preference for sports over TV is not great.

Test Your Understanding

Problem

A public opinion survey explored the relationship between age and support for increasing the minimum wage. The results are summarized below in a two-way frequency table.

For Against No opinion Total
21 - 40 25 20 5 50
41 - 60 20 35 20 75
Over 60 55 15 5 75
Total 100 70 30 200

In the 21 to 40 age group, what percentage supports increasing the minimum wage?

(A) 12.5%
(B) 20%
(C) 25%
(D) 50%
(E) 75%

Solution

The correct answer is (D). A total of 50 people in the 21 to 40 age group were surveyed. Of those, 25 were for increasing the minimum wage. Thus, half of the respondents in the 21 to 50 age group (50%) supported increasing the minimum wage.