Use Sophia to knock out your gen-ed requirements quickly and affordably. Learn more
×

Two-Way Tables/Contingency Tables

Author: Sophia

what's covered
This tutorial will cover the topic of two-way tables, also called contingency tables. Our discussion breaks down as follows:

Table of Contents

1. Two-Way Tables

Two-way tables are a way of showing the relationship between two categorical variables.

EXAMPLE

Suppose you had 335 students in different parts of the country and they were asked the question, "If you had to pick one thing about school that's most important to you, would it be getting good grades, being popular, or being good at sports?" The distribution looks like this:


School Locations
Rural Suburban Urban
Goal Grades 57 87 24
Popular 50 42 6
Sports 42 22 5


This means that 57 rural students said that grades were the most important thing. Six urban students said that being popular was the most important thing to them. We can see the relationship between school location and goal.

One of the most important features of a two-way table is called the marginal distributions. They are called that because they're written in the margins. They are the row totals and column totals for the particular categories that you have.


School Locations

Rural Suburban Urban

Goal Grades 57 87 24 168 begin mathsize 36px style open table attributes columnalign right end attributes row blank row blank end table close curly brackets end style
Popular 50 42 6 98 Row space Total
Sports 42 22 5 69


149 151 35 box enclose 335


begin mathsize 26px style table attributes columnalign left end attributes row cell stack space space space space space space space space space space space space space space space space space space space space space space space space space space space space space space with bottom parenthesis below end cell row cell space space C o l u m n space T o t a l s end cell end table end style

box enclose space space space space space end enclose equals Grand Total

This shows that there were 149 rural students in this study, whereas there were only 35 urban students in this study. It shows that 168 students said that grades were the most popular thing, regardless of where they live, and 98 students said that being popular was the most important thing at school.

We also can add up all these cell values and obtain the grand total. This means there were 335 students in the study, which we knew at the beginning, based on the way the problem was posed.

This allows us to answer some pretty interesting probability problems:
Probabilities of School Locations and Goals
What's the probability that a student says that grades are the most important thing? That would be 168 students out of 335 students, because there were 168 students, regardless of where they live, that said that grades were the most important thing, out of the total 335 students.
What's the probability that an urban student says popular? Isolate your view to just the 35 urban students, and you can see that it's six out of those 35.
What's the probability that someone who said sports was a rural student? Limit your view to just the 69 students who said sports, and you can see that 42 out of those 69 were the ones who were in the rural schools.

term to know
Two-Way Tables
A way of presenting data such that we can see the relationships between two categorical variables.

summary
Two-way tables help you to understand the relationships between two different events, or two different categories. You can use two-way tables to answer some pretty interesting probability questions. Often, you use the marginal distributions--the row totals or column totals, or even the grand total, to answer these probability questions.

Good luck!

Source: THIS TUTORIAL WAS AUTHORED BY JONATHAN OSTERS FOR SOPHIA LEARNING. PLEASE SEE OUR TERMS OF USE.

Terms to Know
Two-Way Table/Contingency Table

A way of presenting data such that we can see the relationships between two categorical variables.