Back to homeMathematics · Integrated Math I · Change subject
Start for free
Math I · Mathematics
Statistics · Statistics

Two-Way Tables

Mateo surveyed 100 students at his school: Do you have a streaming subscription? Then he asked himself a sharper question: does having a subscription depend on your grade? To answer it you can't look at each variable alone. You need to organize both at the same time in a two-way table.

Rows, columns, and totals

Here is Mateo's survey. Some problems call this a contingency table and call the counts absolute frequencies; it is the same thing as a two-way table.

Has subscription No subscription Total
9th grade $24$ $16$ $40$
10th grade $36$ $24$ $60$
Total $60$ $40$ $100$
Layout of a two-way table: the inner cells are joint frequencies, the last column and last row hold the marginal totals, and the bottom-right corner is the grand total N. column 1 column 2 Total row 1 row 2 Total joint joint joint joint row total row total column total column total N (all) Blue: joint frequencies · Orange: marginal frequencies

Read the table above:

  • The joint frequency of "10th grade" and "has subscription" is $36$.

  • The marginal frequency of "9th grade" is $40$. That is the number of 9th graders, whatever their subscription status.

  • The marginal distribution of a variable is the list of its categories with their totals. For "subscription" it is: has subscription $60$, no subscription $40$.

Practice★☆☆Not started
Copy and complete the following contingency table in your notebook, which shows the distribution of a group of students according to their gender and whether they wear…

Copy and complete the following contingency table in your notebook, which shows the distribution of a group of students according to their gender and whether they wear glasses or not.

Wear glasses Do not wear glasses Total
Boys $12$ $18$
Girls $15$ $25$
Total
Solve
Practice★☆☆Not started
In a survey of $80$ people about their main mode of transportation to go to work, the following absolute results were obtained: | | Car | Public transit | Walking |…

In a survey of $80$ people about their main mode of transportation to go to work, the following absolute results were obtained:

Car Public transit Walking Total
Under 30 $10$ $22$ $8$ $40$
Over 30 $25$ $10$ $5$ $40$
Total $35$ $32$ $13$ $80$

State the joint absolute frequency of the people who are "Under 30" and go "Walking", and calculate the marginal absolute frequency of those who use the "Car".

Solve
Practice★☆☆Not started
$200$ customers of a pizzeria were asked about their favorite type of crust. The results are shown in the following table: | | Thin crust | Classic | Stuffed crust |…

$200$ customers of a pizzeria were asked about their favorite type of crust. The results are shown in the following table:

Thin crust Classic Stuffed crust Total
Takeout $45$ $35$ $20$ $100$
Dine-in $25$ $50$ $25$ $100$
Total $70$ $85$ $45$ $200$

Write the marginal distribution of the variable "Type of crust", indicating its absolute frequencies.

Solve

Relative frequencies and percents of the total

Counts depend on how many people you surveyed. A count of $24$ means something very different out of $100$ than out of $1{,}000$. To compare, divide by the total.

Some problems call the joint relative frequencies global relative frequencies. Here are Mateo's cells as a share of all $100$ students:

Has subscription No subscription Total
9th grade $\frac{24}{100} = \frac{6}{25} = 24\%$ $\frac{16}{100} = \frac{4}{25} = 16\%$ $40\%$
10th grade $\frac{36}{100} = \frac{9}{25} = 36\%$ $\frac{24}{100} = \frac{6}{25} = 24\%$ $60\%$
Total $60\%$ $40\%$ $100\%$
Converting a cell count into a joint relative frequency: divide the cell by N, then write the result as a decimal, a simplified fraction, and a percent. cell: 24 ÷ N→ 0.24 = 6/25 × 100→ 24%

Finding the mode. The mode is the most frequent category. In a two-way table you can ask for two different modes:

  • The mode of the joint distribution is the largest cell. It is a pair of categories. In Mateo's table it is "10th grade with a subscription" ($36$).

  • The mode of a marginal distribution is the largest total for one variable. It is a single category. For "subscription" it is "has subscription" ($60$).

Practice★☆☆Not started
From the following contingency table of absolute frequencies, create the corresponding table of global relative frequencies (expressing the results as a simplified…

From the following contingency table of absolute frequencies, create the corresponding table of global relative frequencies (expressing the results as a simplified fraction).

Science Humanities Total
Passed $30$ $20$ $50$
Failed $10$ $40$ $50$
Total $40$ $60$ $100$
Solve
Practice★☆☆Not started
A language school offers French and German classes in the morning and afternoon. The table shows the number of enrolled students: | | Morning | Afternoon | Total | |…

A language school offers French and German classes in the morning and afternoon. The table shows the number of enrolled students:

Morning Afternoon Total
French $24$ $36$ $60$
German $16$ $24$ $40$
Total $40$ $60$ $100$

Calculate what percentage of the total number of students is represented by those studying French in the afternoon.

Solve
Practice★☆☆Not started
Given the following table relating the cell phone brand and the age group of its owners, identify the mode of the joint distribution and the mode of the marginal…

Given the following table relating the cell phone brand and the age group of its owners, identify the mode of the joint distribution and the mode of the marginal distribution of the variable "Brand".

Brand A Brand B Brand C Total
Youth $45$ $15$ $10$ $70$
Adults $20$ $35$ $25$ $80$
Total $65$ $50$ $35$ $150$
Solve

Conditional relative frequencies

Sometimes you want a sharper question: of the students who are in 10th grade, what fraction chose pizza? You are no longer looking at everyone. The condition "10th grade" shrinks the group you care about.

A conditional frequency uses only one group as the whole: 20 of the 25 students in 10th grade chose pizza, which is 80 percent. 10th grade: 25 pizza: 20 20 of 25 → 80%

Use the lunch table ($N = 50$):

Pizza Salad Total
9th grade $18$ $7$ $25$
10th grade $20$ $5$ $25$
Total $38$ $12$ $50$
  • Of the 10th graders, the share who chose pizza is $\dfrac{20}{25} = 0.80 = 80\%$. The whole is the row total, $25$.

  • Of the students who chose pizza, the share who are in 10th grade is $\dfrac{20}{38} \approx 0.526 \approx 52.6\%$. The whole is the column total, $38$.

Same cell, different question, different denominator.

A conditional distribution lists the conditional relative frequencies for every category of a row (or column). They always add up to $100\%$. For the 10th-grade row: pizza $80\%$, salad $20\%$.

Practice★☆☆Not started
Observe the following table which classifies the attendees of a conference according to their nationality and the language in which they preferred to receive the…

Observe the following table which classifies the attendees of a conference according to their nationality and the language in which they preferred to receive the documentation:

Spanish English Total
Europeans $40$ $60$ $100$
Americans $30$ $20$ $50$
Total $70$ $80$ $150$

Calculate the conditional relative frequency of an attendee preferring the documentation in English, given that they are European.

Solve
Practice★★☆Not started
A medical study analyzes the effectiveness of two treatments (Treatment A and Treatment B) to cure a skin condition. The results after one month are as follows: | |…

A medical study analyzes the effectiveness of two treatments (Treatment A and Treatment B) to cure a skin condition. The results after one month are as follows:

Cured Not cured Total
Treatment A $72$ $48$ $120$
Treatment B $54$ $26$ $80$
Total $126$ $74$ $200$

Calculate the percentage of success (cured) for each of the treatments separately and explain, based on these percentages, which of the two treatments seems to be more effective.

Solve
Practice★★☆Not started
In a company of $500$ employees, the relationship between the department they belong to and their level of job satisfaction is studied. | | Satisfied | Indifferent |…

In a company of $500$ employees, the relationship between the department they belong to and their level of job satisfaction is studied.

Satisfied Indifferent Dissatisfied Total
Sales $120$ $60$ $20$ $200$
Production $90$ $110$ $100$ $300$
Total $210$ $170$ $120$ $500$

Calculate the marginal distribution of the variable "Satisfaction" in percentages and the conditional distribution of the level of satisfaction within the "Production" department.

Solve

Independence

In Mateo's survey, $60\%$ of 9th graders and $60\%$ of 10th graders have a subscription, and $60\%$ of all students do. Knowing someone's grade told us nothing about their subscription.

Two bars, one for 9th grade and one for 10th grade, are split at the same height: 60 percent have a subscription in each, so the variables are independent. Yes 60% No 40% Yes 60% No 40% 9th grade (40) 10th grade (60) Bar width = group size. Same split = independent.

When two variables are independent, you can predict every cell from the totals:

Practice★★★Not started
In a population of $400$ inhabitants, two variables are analyzed: "Plays sports" (Yes/No) and "Smokes" (Yes/No). The marginal distributions are known: $240$ people play…

In a population of $400$ inhabitants, two variables are analyzed: "Plays sports" (Yes/No) and "Smokes" (Yes/No). The marginal distributions are known: $240$ people play sports and $160$ do not; on the other hand, $100$ people smoke and $300$ do not smoke.

Construct the contingency table of absolute frequencies assuming that there is perfect statistical independence between the habit of smoking and playing sports in this population.

Solve
Practice★★★Not started
Two statistical variables are said to be independent if the conditional relative frequencies are equal to the corresponding marginal relative frequencies; that is, the…

Two statistical variables are said to be independent if the conditional relative frequencies are equal to the corresponding marginal relative frequencies; that is, the proportion remains constant in all rows and columns.

Given the following incomplete table:

Type I Type II Total
Category Alpha $12$ $18$ $30$
Category Beta $8$ $y$ $8+y$
Total $20$ $18+y$ $38+y$

Calculate the exact value of $y$ so that the two variables ("Category" and "Type") are perfectly independent.

Solve

Filling in missing cells

Many problems give you only part of a table, or describe it in words. You can always rebuild it because every row and every column must add up to its total.

To find a missing cell, subtract the known cells from the known row or column total. each row adds to its total,each column adds to its total known unknown? row totalknown
Practice★☆☆Not started
In a sports club there are $120$ members. We know that $70$ play tennis, $50$ play pickleball, and of those who play tennis, $20$ are women. If there is a total of $45$…

In a sports club there are $120$ members. We know that $70$ play tennis, $50$ play pickleball, and of those who play tennis, $20$ are women. If there is a total of $45$ women in the club, construct the contingency table of absolute frequencies relating gender (Male / Female) to the sport played (Tennis / Pickleball).

Solve
Practice★★☆Not started
Complete the following contingency table knowing that the global relative frequencies of some cells are given as a fraction of the total $N = 150$. | | Movies | TV Shows…

Complete the following contingency table knowing that the global relative frequencies of some cells are given as a fraction of the total $N = 150$.

Movies TV Shows Documentaries Total
Tablet $\frac{1}{5}$ of the total $40$ $85$
Television $\frac{2}{15}$ of the total $10$
Total $25$ $150$
Solve
Practice★★☆Not started
In a quality control test, a metal detector inspects $1000$ pieces of luggage. It is known that $40$ pieces contain prohibited items. The detector triggers the alarm in…

In a quality control test, a metal detector inspects $1000$ pieces of luggage. It is known that $40$ pieces contain prohibited items. The detector triggers the alarm in $35$ of the pieces that have prohibited items and also gives a false alarm in $24$ pieces that do not contain anything prohibited. Construct the contingency table and calculate the percentage of pieces that actually contain prohibited items among all those in which the alarm was triggered.

Solve

Building a table from percents

Often the problem says things like "40% of the students do X" and "30% of those do Y." The key question is always: percent of what?

Nested groups: 500 students, of which 40 percent (200) have a job, of which 30 percent (60) are on a varsity team. Each percent applies to its own group. All students: 500 Job: 200 = 40% of 500 Varsity: 60 = 30% of 200
Practice★★☆Not started
In a high school of $300$ students, $60\%$ participate in extracurricular activities. Of the students who participate in these activities, $40\%$ are signed up for…

In a high school of $300$ students, $60\%$ participate in extracurricular activities. Of the students who participate in these activities, $40\%$ are signed up for drama. Furthermore, it is known that $15\%$ of the total number of students in the school do not do extracurricular activities and do not like drama either. Construct the contingency table of absolute frequencies and determine how many students do not do extracurricular activities but are signed up for drama.

Solve
Practice★★☆Not started
Reconstruct a $2 \times 2$ contingency table with the variables $X$ and $Y$ from the following information: The total number of individuals is $N = 200$. The marginal…

Reconstruct a $2 \times 2$ contingency table with the variables $X$ and $Y$ from the following information:

  • The total number of individuals is $N = 200$.

  • The marginal frequency of $X_1$ is $120$.

  • The marginal frequency of $Y_2$ is $90$.

  • $30\%$ of the individuals who satisfy $X_1$ also satisfy $Y_1$.

Solve
Practice★★☆Not started
A nature reserve classifies the trees in a plot according to their species (Pine / Oak) and the type of soil in which they grow (Dry / Damp). A total of $240$ trees have…

A nature reserve classifies the trees in a plot according to their species (Pine / Oak) and the type of soil in which they grow (Dry / Damp). A total of $240$ trees have been counted, of which $150$ are pines. It is known that $60\%$ of the oaks grow in damp soil, while only $40$ pines grow in damp soil. Construct the contingency table and determine what percentage of the total number of trees grows in dry soil.

Solve

Unknown cells and equations

Sometimes the cells are written with a variable, or the clues are ratios. Then you set up an equation (or a system) from the rules of the table.

A two-way table whose cells are algebraic expressions in x, with row and column totals written as sums. Col 1 Col 2 Total Row 1 Row 2 Total x 2x 8 x + 4 3x x + 12 x + 8 3x + 4 4x + 12
Practice★★★Not started
Consider the following contingency table where some absolute frequencies depend on a parameter $x$: | | Event A | Event B | Total | | :--- | :---: | :---: | :---: | |…

Consider the following contingency table where some absolute frequencies depend on a parameter $x$:

Event A Event B Total
Condition 1 $x$ $2x$
Condition 2 $10$ $x+5$
Total

If it is known that the marginal relative frequency of "Condition 1" is equal to $0.6$, set up an equation, find the value of $x$ and reconstruct the complete table with numerical values.

Solve
Practice★★★Not started
In a $2 \times 2$ contingency table with the variables $X$ and $Y$, the following proportional relationships between the absolute frequencies $a, b, c, d$ are known: | |…

In a $2 \times 2$ contingency table with the variables $X$ and $Y$, the following proportional relationships between the absolute frequencies $a, b, c, d$ are known:

$Y_1$ $Y_2$ Total
$X_1$ $a$ $b$ $50$
$X_2$ $c$ $d$ $50$
Total $a+c$ $b+d$ $100$

Knowing that the ratio between $a$ and $c$ is $\frac{2}{3}$ and the ratio between $b$ and $d$ is $\frac{4}{1}$, set up a system of equations to find the values of $a, b, c$ and $d$.

Solve
Practice★★★Not started
A market research study on $600$ consumers classifies their drink preferences (Water, Soda, Juice) and their age range (Youth, Adult). The table is almost empty, but the…

A market research study on $600$ consumers classifies their drink preferences (Water, Soda, Juice) and their age range (Youth, Adult). The table is almost empty, but the following clues are known:

  1. The total number of Youth is twice that of Adults.

  2. The number of Adults who prefer Water is equal to the number of Adults who prefer Juice.

  3. The Youth who prefer Soda are $150$.

  4. The total number of people who prefer Juice is $140$.

  5. The marginal frequency of those who prefer Water is $200$.

Deduce all the joint and marginal frequencies and construct the complete contingency table.

Solve

Venn diagrams and tree diagrams

Two-way tables are not the only way to show two variables. A Venn diagram and a tree diagram carry the same information. To work with either, turn it into a table.

Venn diagrams

Each circle is a group. The overlap is the individuals in both groups. Anyone outside both circles is in neither.

Venn diagram of 120 students: 35 in band only, 15 in both band and chorus, 25 in chorus only, and 45 in neither. Band Chorus 35 15 25 neither: 45

Tree diagrams

A tree diagram starts with one variable and branches into the other. The percents on the branches tell you "percent of what": the second-level percents are percents of the branch above them.

Tree diagram: 500 students split into bus riders (60 percent) and non-riders (40 percent). Among bus riders 10 percent are late; among non-riders 5 percent are late. 500 60% 40% Bus Not bus 10% 90% 5% 95% Late On time Late On time
Practice★★☆Not started
The following Venn diagram shows the distribution of $110$ students from a language school according to whether they study English ($A$) or French ($B$). Translate the…

The following Venn diagram shows the distribution of $110$ students from a language school according to whether they study English ($A$) or French ($B$).

English (A) French (B) 45 20 35 10 E

Translate the information from the diagram into a contingency table where the variables are "Studies English" (Yes/No) and "Studies French" (Yes/No). Then, calculate the proportion of students who study French given that they do not study English.

Solve
Practice★★★Not started
The following tree diagram represents the proportions of a population of $500$ individuals classified according to two dichotomous variables $A$ and $C$. Transform the…

The following tree diagram represents the proportions of a population of $500$ individuals classified according to two dichotomous variables $A$ and $C$.

A B C D C D 0.4 0.6 0.2 0.8 0.7 0.3

Transform the information from this diagram into a contingency table of absolute frequencies where the rows are $A$ and $B$, and the columns are $C$ and $D$. Calculate the marginal relative frequency of $C$.

Solve
Practice★★★Not started
An electronic components factory has two assembly machines. Machine I produces $60\%$ of the total components and Machine II the remaining $40\%$. Quality control…

An electronic components factory has two assembly machines. Machine I produces $60\%$ of the total components and Machine II the remaining $40\%$. Quality control reveals that $2\%$ of the components from Machine I are defective, while the defect rate in Machine II is $5\%$.

For a batch of $2000$ components, create the contingency table relating the "Machine" (I / II) to the "Condition" (Defective / Correct). If a defective component is selected from this batch, what proportion of the defective ones comes from Machine II?

Solve

When combining tables misleads

Sometimes the answer from a combined table says the opposite of what each separate table says. Look at this example.

Bar chart of shooting percentages: Player A is higher on contested shots (30 versus 20) and open shots (75 versus 70), but Player B is higher overall (63.75 versus 45). A B 30% 20% 75% 70% 45% 63.75% Contested Open Overall
Practice★★★Not started
The success of a complex surgical operation has been recorded in two different hospitals, separating the cases into "Mild" and "Severe". St. Jude Hospital: | Mild cases…

The success of a complex surgical operation has been recorded in two different hospitals, separating the cases into "Mild" and "Severe".

St. Jude Hospital:

Mild cases Success Failure Total
$80$ $20$ $100$
Severe cases Success Failure Total
$10$ $90$ $100$

Mercy Hospital:

Mild cases Success Failure Total
$360$ $40$ $400$
Severe cases Success Failure Total
$5$ $95$ $100$

Construct a single global contingency table for each hospital (adding mild and severe cases) relating the "Hospital" to the "Result" (Success / Failure). Calculate the global percentage of success for each hospital and explain why there is a change in the perception of the best hospital when aggregating the data.

Solve

Back to the start: In Mateo's survey, $\frac{24}{40} = 60\%$ of 9th graders and $\frac{36}{60} = 60\%$ of 10th graders have a subscription, and so do $\frac{60}{100} = 60\%$ of all students. The conditional percents match the marginal percent, so in this sample having a subscription is independent of grade.

Summary

See all the exercises in this section