Objective
Here you will learn how to create and use contingency tables.
Concept
Suppose you wanted to evaluate how gender affects the type of movie chosen by moviegoers, how might you organize data on Male and Female watchers, and Action, Romance, Comedy, and Horror movie types, so it would be easy to compare different combinations?
See the end of the lesson where this question is reviewed.
Watch This
http://youtu.be/sYkt4rXif78 MrNystrom – Contingency Table Intro
Guidance
Contingency tables are used to evaluate the interaction of statistics from two different categorical variables. They are often used to organize data from different random variables in preparation for a contingency test (which we will be discussing further in the next lesson).
Contingency tables are sometimes called twoway tables because they are organized with the outputs of one variable across the top, and another down the side. Consider the table below:
Male 
Female 

Chocolate Candy 
42 
77 
Fruit Candy 
58 
23 
This is a contingency table comparing the variable ‘Gender’ with the variable ‘Candy Preference’. You can see that, across the top of the table are the two gender options for this particular study: ‘male students’ and ‘female students’. Down the left side are the two candy preference options: ‘chocolate’ and ‘fruit’. The data in the center of the table indicates the reported candy preferences of the 100 students polled during the study.
Commonly, there will be one additional row and column for totals, like this:
Male 
Female 
TOTAL 

Chocolate Candy 
42 
77 
119 
Fruit Candy 
58 
23 
81 
TOTAL 
100 
100 
200 
Notice that you can run a quick check on the calculation of totals, since the “total of totals” should be the same from either direction: .
The benefits of a contingency square will be apparent the more you use it. As you begin to evaluate different bits of information, each combination of variable outputs is easily noted.
Example A
Construct a contingency table to display the following data: “250 mall shoppers were asked if they intended to eat at the inmall food court or go elsewhere for lunch. Of the 117 male shoppers, 68 intended to stay, compared to only 62 of the 133 female shoppers”.
Solution:
First, let’s identify our variables and set up the table with the appropriate row and column headers.
The variables are gender and lunch location choice:
Male 
Female 
TOTAL 

Food Court 

Out of Mall 

TOTAL 
Now we can fill in the values we have directly from the text:
Male 
Female 
TOTAL 

Food Court 
68 
62 

Out of Mall 

TOTAL 
117 
133 
250 
Now we can fill in the missing data with simple addition/subtraction:
Male 
Female 
TOTAL 

Food Court 
68 
62 
130 
Out of Mall 
49 
71 
120 
TOTAL 
117 
133 
250 
Example B
Referencing data from Example A, answer the following:
 What percentage of foodcourt eaters are female?
 What is the distribution of male luncheaters?
 What is the marginal distribution of the variable “lunch location preference”?
 What is the marginal distribution of the variable “Gender”?
 What percentage of females prefer to eat out?
Solutions:
 If we read across the row “Food Court”, we see that there were a total of 130 shoppers eating “in”, and that 62 of them were female. To calculate percentage, we simply divide: or 47.7%.
 The male shoppers were distributed as 68 food court and 49 out of mall.
 The marginal distribution is the distribution of data “in the margin”, or in the TOTAL column. In this case, we are interested in the data on lunch location preference, which is found in the far right column: 130 food court and 120 out of mall.
 The marginal distribution of gender can be found in the bottom row: 117 males and 133 females.
 Here we are interested in data from the females, so we will be dealing with the ‘female’ column. From the data in the column, we see that 71 of the 133 females preferred to eat out. This is a percentage of: or 53.4%.
Example C
Using the given data:
 Construct a contingency table
 Identify the marginal distributions
 Identify 3 different percentagebased observations
“Out of 213 polled amateur drag racers, 47 drove cars with turbochargers, 59 had superchargers, and the rest were normally aspirated. The racers themselves were split between 102 rookies and 111 veterans. The rookies evidently preferred turbos, since 29 of them had turbocharged vehicles, and avoided superchargers, since there were only 12 of them”.
Solutions:
a. Set up the table with the appropriate headers, and fill in the data we know. Note that this time we will need a table instead of a (it is still a two way table though, as there are only two variables: engine aspiration and driver experience):
Turbocharger 
Supercharger 
Normal Aspiration 
TOTAL 

Rookie 
29 
12 
102 

Veteran 
111 

TOTAL 
37 
59 
117 
213 
Now we can update the table with the missing data, calculated using addition or subtraction:
Turbocharger 
Supercharger 
Normal Aspiration 
TOTAL 

Rookie 
29 
12 
61 
102 
Veteran 
8 
47 
56 
111 
TOTAL 
37 
59 
117 
213 
b. The marginal data refers to the overall data for each of the two variables:
 Aspiration type is distributed as follows: 37 Turbos, 59 Superchargers, and 117 normally aspirated.
 Driver experience distribution: 102 Rookies and 111 Veterans.
c. Three percentagebased observations:
 or 59.8% of Rookies drive normally aspirated cars.
 or 79.66% of the Superchargers were in cars driven by Veterans.
 or 42.34% of Veterans use Superchargers.
Concept Problem Revisited
Suppose you wanted to evaluate how gender affects the type of movie chosen by moviegoers, how might you organize data on Male and Female watchers, and Action, Romance, Comedy, and Horror movie types, so it would be easy to compare different combinations?
A contingency table would be excellent for this purpose. By listing gender categories in one direction and movie type in the other, it would be a simple matter to evaluate different combinations of variables.
Vocabulary
A contingency table or twoway table is used to organize data from multiple categories of two variables so that various assessments may be made.
A marginal distribution is the distribution of data “in the margin” of a table. It may also be described as the distribution of the data for a single variable.
Guided Practice
1. Complete the data in the contingency table:

A  B 
TOTAL 
X 
47 


Y 

32 
100 
TOTAL 
100 

200 
2. What is the marginal distribution of the variable consisting of categories A and B?
3. What percentage of B’s are Y’s?
4. What portion of A’s are X’s? Express your answer as a decimal.
Solutions:
1.

A 
B  TOTAL 
X 



Y 



TOTAL 



2. The variable consisting of categories A and B is distributed as A: 100 and B: 100.
3. There are 32 B’s that are also Y’s, out of the total of 100 B’s:
4. 47 of the 100 A’s are X’s,
Practice
Questions 19 refer to the following table:
Sports Cars 
Pickup Trucks 
Luxury Cars 
TOTAL 

Male Drivers 
72 
67 
36 
175 
Female Drivers 
36 
71 
68 
175 
TOTAL 
108 
138 
104 
350 
1. What is the marginal distribution of vehicle types?
2. What is the marginal distribution of driver gender?
3. What decimal portion of male drivers have luxury cars?
4. What percentage of female drivers have pickups?
5. How many drivers were polled?
6. What is the overall most popular vehicle type, by percentage?
7. Which vehicle type has the single largest cell value, and what percentage does it represent of that gender category?
8. What percentage of pickup trucks are driven by females?
9. What percentage of females drive pickup trucks?
Questions 1018 refer to the following data:
“One hundred eighty dogs were studied to determine if breed affected food preference. Of the 70 Huskies, 30 preferred beef flavor and 40 preferred chicken. Of the 50 Poodles, 27 preferred beef, the rest chicken. The rest of the dogs, English Mastiffs, were obviously beeflovers, as only 19 preferred chicken over beef”.
10. Create a contingency table to display the data.
11. What is the marginal distribution of dog breeds?
12. What is the marginal distribution of food types?
13. What percentage of Mastiffs preferred beef?
14. What percentage of beeflovers were Mastiffs?
15. What flavor/dog combination indicated the strongest preference? What percentage of the breed did it represent?
16. What is the distribution of chicken preference?
17. What is the distribution of beef preference?
18. Which breed shows the least defined preference, as a percentage?