Two-Way Tables Examples in Statistics

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Two-Way Tables.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Statistics.

Concept Recap

A two-way table (contingency table) displays the frequency of data categorized by two different categorical variables simultaneously, with one variable in rows and the other in columns, allowing comparison of distributions across groups.

A two-way table is like a spreadsheet that shows how two questions relate. 'Do you like pizza?' and 'Are you a kid or adult?' becomes a 2ร—22 \times 2 grid showing how many kid pizza-lovers, adult pizza-lovers, etc.

Read the full concept explanation โ†’

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: Two-Way Tables asks whether the same cases connect two variables or groups in a pattern that can be described carefully.

Common stuck point: Students often know a procedure related to two-way tables but skip the recognition step: Am I studying a relationship between variables, and have I separated association from causation? That leads to a calculation or graph that looks reasonable but answers a different question.

Sense of Study hint: Ask: Am I studying a relationship between variables, and have I separated association from causation?

Common Mistakes to Watch For

Before you work through the examples, skim the mistake guide so you know which shortcuts and sign errors to avoid.

Worked Examples

Example 1

medium
From a two-way table: Smokers (Yes/No) vs Disease (Yes/No). Smokers-Disease =30= 30; Smokers-NoDisease =70= 70; NonSmokers-Disease =10= 10; NonSmokers-NoDisease =90= 90. What is the proportion of smokers who get the disease?

Answer

30/100=0.3030/100 = 0.30

First step

1
Conditional on Smokers, denominator =30+70=100= 30 + 70 = 100.

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Unlock answer keys One Family plan โ€” every worked solution, all subjects

Example 2

medium
Given: Boys 3535 total, Girls 4545 total, Soccer 4545 total, Basketball 3535 total, grand total 8080. Compute expected count of Boy-and-Soccer if Gender and Sport were independent.

Example 3

hard
In the treatment table (A: 90/3090/30; B: 60/12060/120), compute the expected count of (Treatment A, Cured) under independence.

Example 4

hard
Conditional distributions of Sport given Gender are identical (60%60\% soccer, 40%40\% basketball for both Boys and Girls). What does this say about association?

Example 5

challenge
A study finds Treatment A beats Treatment B overall, but within each severity subgroup, Treatment B is better. What is this phenomenon called and what does it teach us about two-way tables?

Example 6

medium
A survey of 80 people classifies Coffee (Yes/No) by Tea (Yes/No). 30 drink both; 20 coffee only; 15 tea only; the rest drink neither. Find each marginal total.

Example 7

medium
100 students were surveyed: 70 play sports; among those, 49 also play music. Among non-sport students, 9 play music. Build the table and find the percent of music players overall.

Example 8

hard
A two-way table by Treatment (Drug/Placebo) and Outcome (Recover/Not): Drug 40/10; Placebo 25/25. Compare the recovery rates and decide which group did better.

Example 9

easy
A survey of 60 students recorded their gender and whether they prefer cats or dogs. Boys who prefer cats: 8, boys who prefer dogs: 17, girls who prefer cats: 15, girls who prefer dogs: 20. Organise this into a two-way table with row and column totals.

Example 10

medium
From the two-way table: Passed exam โ€” studied (40), didn't study (10); Failed exam โ€” studied (5), didn't study (25). Calculate the percentage of students who passed among those who studied, and among those who didn't study.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
A survey records 30 students. The two-way table has rows Kid/Adult and columns Likes Pizza/Dislikes Pizza. Kids: 12 like, 3 dislike. Adults: 9 like, 6 dislike. How many people are in the survey total?

Example 2

easy
In the table, Kids who like pizza =12=12, Kids who dislike =3=3. What is the marginal total of Kids?

Example 3

easy
Adults: 9 like pizza, 6 dislike. What is the marginal total of Adults?

Example 4

easy
Using the table (Kids: 12 like, 3 dislike; Adults: 9 like, 6 dislike), how many people in total like pizza?

Example 5

easy
From the same table, how many people dislike pizza in total?

Example 6

easy
In the two-way table, what is the joint count of Kids who dislike pizza?

Example 7

easy
A 2ร—22\times 2 table has cells a=8a=8, b=2b=2, c=5c=5, d=5d=5. What is the grand total?

Example 8

easy
A two-way table classifies people by Gender (row) and Owns a Bike (column). Which variable types make a two-way table the right tool?

Example 9

medium
Table: Sport played (Yes/No) by Grade (9th/10th). 9th: 20 Yes, 10 No. 10th: 15 Yes, 25 No. How many 10th graders are there, and what fraction of ALL students are 10th graders?

Example 10

medium
Same table (9th: 20 Yes, 10 No; 10th: 15 Yes, 25 No). What fraction of students play a sport (Yes)?

Example 11

medium
Table cells: a=18a=18, b=12b=12 (row 1), c=6c=6, d=24d=24 (row 2). What proportion of the data is in cell dd (joint relative frequency)?

Example 12

medium
A two-way table of Color preference by Age group has row totals 2525 and 3535 and a grand total of 6060. If one column total is 4040, what is the other column total?

Example 13

medium
Table: Pass/Fail by Studied (Yes/No). Studied-Yes: 28 Pass, 4 Fail. Studied-No: 6 Pass, 12 Fail. How many students total, and how many failed?

Example 14

medium
From the Pass/Fail table (Studied-Yes: 28 Pass, 4 Fail; Studied-No: 6 Pass, 12 Fail), what fraction of ALL students both studied and passed?

Example 15

medium
A table has row totals 4040 and 6060. A cell in the first row is 1010. What is the joint relative frequency of that cell if the grand total is 100100?

Example 16

medium
Survey of 80 people by Coffee (Yes/No) and Tea (Yes/No). Coffee-Yes/Tea-Yes =30=30, Coffee-Yes/Tea-No =20=20, Coffee-No/Tea-Yes =18=18, Coffee-No/Tea-No =12=12. How many drink coffee?

Example 17

medium
In a 2ร—32\times 3 table, the three column totals are 1515, 2525, and 2020, and one row total is 3636. What is the other row total?

Example 18

challenge
A two-way table (Treatment/Placebo by Recovered/Not) is consistent if all marginals match the grand total. Treatment: aa recovered, 30โˆ’a30-a not (row total 3030). Placebo: bb recovered, 40โˆ’b40-b not (row total 4040). If 5252 total recovered, express bb in terms of aa, then find bb when a=28a=28.

Example 19

challenge
A table reports that aa+b=0.6\frac{a}{a+b}=0.6 for row 1 and the row-1 total a+b=50a+b=50. Cell aa is also 14\frac{1}{4} of the grand total. Find the grand total.

Example 20

challenge
Two groups, A (size 100) and B (size 100), are merged. In A, 70 of 100 succeed; in B, 30 of 100 succeed. After merging into one 2ร—22\times 2 table (Group by Success), what is the overall success relative frequency, and why can it differ from each group's rate?

Example 21

easy
A two-way table classifies 8080 students by Gender (Boy/Girl) and Sport (Soccer/Basketball). Boys: 2020 soccer, 1515 basketball. Girls: 2525 soccer, 2020 basketball. What is the total number of soccer players?

Example 22

easy
Using the same table (Boys: 2020 soccer, 1515 basketball; Girls: 2525 soccer, 2020 basketball), how many girls are in the survey?

Example 23

easy
Boys total 3535, Girls total 4545, soccer total 4545, basketball total 3535. What is the grand total?

Example 24

medium
Given (Boys: 2020 soccer, 1515 bb; Girls: 2525 soccer, 2020 bb), what proportion of boys play soccer (conditional)?

Example 25

medium
Same data. What proportion of soccer players are boys?

Example 26

medium
Using the same smoker table, what proportion of non-smokers get the disease, and what does the comparison say about association?

Example 27

medium
A table has row marginal totals 40,6040, 60 and column marginal totals 50,5050, 50. If variables are independent, what is the expected count in the (Row1, Col1) cell?

Example 28

medium
In a 2ร—22\times 2 table with grand total 200200, the cell (A, X) count is 5050. What is the joint relative frequency?

Example 29

medium
Joint distribution: (P(AโˆฉX),P(AโˆฉY),P(BโˆฉX),P(BโˆฉY))=(0.25,0.15,0.10,0.50)(P(A \cap X), P(A \cap Y), P(B \cap X), P(B \cap Y)) = (0.25, 0.15, 0.10, 0.50). Find P(A)P(A), the marginal probability for row A.

Example 30

medium
A survey of 200200 people: 6060 like coffee, 140140 don't; 8080 are over 3030, 120120 are under. If like-coffee and age-over-30 are independent, what is the expected count of 'likes coffee AND over 3030'?

Example 31

hard
A two-way table cross-classifies 300300 patients by Treatment (A/B) and Outcome (Cured/Not). Treatment A: 9090 cured, 3030 not. Treatment B: 6060 cured, 120120 not. Compute the cure rate for each treatment.

Example 32

hard
A two-way table has expected count 4040 and observed count 5050 in one cell. Compute that cell's contribution to the ฯ‡2\chi^2 statistic.

Example 33

hard
A 2ร—32 \times 3 two-way table has 22 rows and 33 columns. How many degrees of freedom for the chi-square test of independence?

Example 34

medium
120120 surveyed. Cell counts: Yes-Like =30= 30, Yes-Dislike =30= 30, No-Like =20= 20, No-Dislike =40= 40. What is P(LikeโˆฃYes)P(\text{Like} | \text{Yes})?

Example 35

medium
Same table. Compute P(YesโˆฃLike)P(\text{Yes}|\text{Like}).

Example 36

medium
From a 2ร—22 \times 2 table with marginal proportions P(Rowย A)=0.4,P(Colย X)=0.5P(\text{Row A}) = 0.4, P(\text{Col X}) = 0.5, what would P(AโˆฉX)P(A \cap X) equal if rows and columns are independent?

Example 37

easy
A two-way table has row totals 1818 and 2222. What is the grand total?

Example 38

easy
A 2ร—22\times 2 table has cells a=7a=7, b=3b=3, c=4c=4, d=6d=6. What is the column 1 total?

Example 39

easy
Pet/No Pet by Cat/Dog table: 20 cat owners, 30 dog owners. Of cat owners, 15 also own a dog. How many own only a cat?

Example 40

easy
A two-way table has 5050 people. Row 1 total =30= 30. What fraction are in row 1?

Example 41

easy
A two-way table cell shows 88 students who are Female AND play Soccer out of 4040 students. What is the joint relative frequency?

Example 42

easy
In a two-way table for Has Job (Yes/No) by Year (Junior/Senior), Juniors: 5 Yes, 15 No. Seniors: 10 Yes, 10 No. How many students total?

Example 43

medium
From the previous table (Juniors: 5 Yes, 15 No; Seniors: 10 Yes, 10 No), among Seniors, what fraction have a job (conditional relative frequency)?

Example 44

medium
A 2ร—22\times 2 table has a=12a=12, b=8b=8, c=18c=18, d=22d=22. What fraction of cases in column 1 are from row 1 (conditional)?

Example 45

medium
Movie Genre (Action/Comedy) by Age (Teen/Adult): Teens: 24 Action, 6 Comedy; Adults: 10 Action, 20 Comedy. Among Teens, what percent prefer Comedy?

Example 46

medium
In the same Action/Comedy table, among Adults, what percent prefer Action?

Example 47

medium
A 2ร—22\times 2 table with grand total 200200: a=60a=60, b=40b=40, c=30c=30. Find dd and the column 2 marginal total.

Example 48

medium
In a 2ร—22\times 2 table the row 1 marginal is 4040, row 2 is 6060, column 1 is 5050. If cell aa (row 1, col 1) is 2525, fill in the rest.

Example 49

medium
In a survey of 240 people, 38\tfrac{3}{8} are children and 12\tfrac{1}{2} of children own a bike. How many children own a bike?

Example 50

hard
A 2ร—22\times 2 table has cells a,b,c,da, b, c, d with a+b=60a+b=60, c+d=40c+d=40, a+c=55a+c=55, and a=30a=30. Find bb, cc, dd.

Example 51

hard
A school of 400 has 60% boys; 25% of boys take art; 40% of girls take art. How many students take art total?

Example 52

hard
Two variables have joint relative frequency 0.30.3 in a cell and the row marginal proportion is 0.50.5. What is the conditional relative frequency within that row?

Example 53

hard
In a 2ร—22\times 2 table, the four conditional row distributions read: Row 1 has 60%60\% Yes, 40%40\% No; Row 2 has 60%60\% Yes, 40%40\% No. Is there an association?

Example 54

hard
From a 2ร—22\times 2 table with cells a=18,ย b=12,ย c=12,ย d=8a=18,\ b=12,\ c=12,\ d=8, is there an association between the row and column variables?

Example 55

challenge
A 2ร—22\times 2 table has marginal totals 4040 and 6060 (rows) and 5050 and 5050 (columns). If the two variables are independent (equal conditional distributions), find every cell.

Example 56

medium
A two-way table shows transport to school: Walk (Year 7: 30, Year 8: 20), Bus (Year 7: 15, Year 8: 25), Car (Year 7: 5, Year 8: 10). What percentage of Year 8 students take the bus?

Example 57

hard
A two-way table shows exercise frequency and health rating for 200 adults: Exercise regularly โ€” Good health: 70, Fair: 20, Poor: 10. Don't exercise regularly โ€” Good health: 30, Fair: 40, Poor: 30. Is there an association between exercise and health? Support your answer with conditional percentages.

Background Knowledge

These ideas may be useful before you work through the harder examples.

stat data representationcategorical data