Loading…
Analyze data in two-way tables
Learn step-by-step with practice exercises built right in.
How do you organize data with two categories? Two-way tables (also called contingency tables) help you analyze relationships between categorical variables! They're essential for comparing groups, finding patterns, and making data-driven decisions.
A two-way table organizes data by two categorical variables.
Structure:
Also called:
Example: Survey of 100 students about pets and grades
A survey of 100 students shows: 30 like math, 50 like science, 20 like both. How many like neither?
Students liking math OR science = 30 + 50 - 20 = 60
(We subtract 20 because those who like both were counted twice)
Students liking neither = 100 - 60 = 40
Answer: 40 students
Review key concepts with our flashcard system
Explore more Grade 8 Math topics
| Cat |
|---|
| Dog |
|---|
| No Pet |
|---|
| Row Total |
|---|
| A Grade | 15 | 20 | 10 | 45 |
| B Grade | 10 | 15 | 8 | 33 |
| C Grade | 5 | 10 | 7 | 22 |
| Column Total | 30 | 45 | 25 | 100 |
Reading the table:
Row totals:
Column totals:
Grand total:
Check: Row totals should sum to grand total! Check: Column totals should sum to grand total!
Joint frequency = count in a specific cell
Represents both categories together.
Example: From the pet table
Symbol: Often just the number in the cell
Marginal frequency = row total or column total
Found in the "margins" of the table.
Example: From the pet table
Why "marginal"?
Example: Create a two-way table from data
Survey: 50 students asked about favorite subject (Math/English) and grade level (7th/8th)
Raw data:
Create table:
| Math | English | Row Total | |
|---|---|---|---|
| 7th Grade | 15 | 10 | 25 |
| 8th Grade | 12 | 13 | 25 |
| Column Total | 27 | 23 | 50 |
Check:
Relative frequency = frequency ÷ total (expressed as fraction, decimal, or percent)
Shows proportion or percentage.
Types:
Joint relative frequency: (Cell value) ÷ (Grand total)
Marginal relative frequency: (Row or column total) ÷ (Grand total)
Conditional relative frequency: We'll discuss this next!
Example: Using the pet table (grand total = 100)
Joint relative frequency for "Cat and A grade": 15/100 = 0.15 = 15%
Marginal relative frequency for "A grade": 45/100 = 0.45 = 45%
Marginal relative frequency for "Cat": 30/100 = 0.30 = 30%
Interpretation:
Conditional relative frequency answers: "What percent of THIS group has THAT characteristic?"
Formula: (Specific cell) ÷ (Row or column total)
Two types:
1. Given the row: What percent of [row category] are in [column category]?
2. Given the column: What percent of [column category] are in [row category]?
Using pet table:
Question 1: What percent of A-grade students have cats?
Solution: Given: A-grade students (row) Find: Those with cats
Conditional frequency = 15/45 = 1/3 ≈ 0.333 = 33.3%
Answer: 33.3% of A-grade students have cats
Question 2: What percent of cat owners have A grades?
Solution: Given: Cat owners (column) Find: Those with A grades
Conditional frequency = 15/30 = 1/2 = 0.50 = 50%
Answer: 50% of cat owners have A grades
Note: These are DIFFERENT questions with different answers!
You can create a whole table of conditional relative frequencies!
Example: Percent within each grade level
| Cat | Dog | No Pet | Row Total | |
|---|---|---|---|---|
| A Grade | 33% | 44% | 22% | 100% |
| B Grade | 30% | 45% | 24% | 100% |
| C Grade | 23% | 45% | 32% | 100% |
Each row sums to 100%
Calculations:
This shows distribution WITHIN each grade level
Looking for associations:
Do two variables seem related?
Example: Pet ownership and grades
Compare conditional frequencies:
Observation: A-grade students more likely to have cats Question: Is this association significant or just random variation?
Marketing:
Medicine:
Education:
Sports:
Social Science:
Survey of 200 people: Exercise frequency and health rating
| Healthy | Average | Poor | Row Total | |
|---|---|---|---|---|
| Daily Exercise | 45 | 20 | 5 | 70 |
| Weekly Exercise | 30 | 35 | 15 | 80 |
| Rarely Exercise | 10 | 25 | 15 | 50 |
| Column Total | 85 | 80 | 35 | 200 |
Questions:
a) What percent of people exercise daily? 70/200 = 0.35 = 35%
b) What percent of people rate themselves as healthy? 85/200 = 0.425 = 42.5%
c) What percent of daily exercisers rate themselves as healthy? 45/70 ≈ 0.643 = 64.3%
d) What percent of healthy people exercise daily? 45/85 ≈ 0.529 = 52.9%
e) Is there an association between exercise and health rating? Yes! Daily exercisers have higher healthy rating (64.3%) than rare exercisers (10/50 = 20%)
Steps:
Example: Survey data - 20 students, gender and sport preference
Data: M-Soccer, F-Soccer, M-Basketball, F-Basketball, M-Soccer, F-Soccer, M-Basketball, F-Soccer, M-Soccer, F-Basketball, M-Basketball, F-Soccer, M-Soccer, F-Basketball, M-Soccer, F-Soccer, M-Basketball, F-Basketball, M-Soccer, F-Soccer
Count:
Table:
| Soccer | Basketball | Row Total | |
|---|---|---|---|
| Male | 7 | 4 | 11 |
| Female | 6 | 3 | 9 |
| Column Total | 13 | 7 | 20 |
❌ Mistake 1: Confusing joint and conditional frequencies
❌ Mistake 2: Using wrong total for conditional frequency
❌ Mistake 3: Forgetting to check totals
❌ Mistake 4: Mixing up rows and columns
❌ Mistake 5: Not converting to percents when asked
Reading tables:
Calculating frequencies:
Analyzing relationships:
Parts of Two-Way Table:
Types of Frequencies:
Joint frequency: Count in a specific cell
Marginal frequency: Row total or column total
Joint relative frequency: (Cell value) ÷ (Grand total)
Marginal relative frequency: (Row or column total) ÷ (Grand total)
Conditional relative frequency: (Cell value) ÷ (Row or column total)
Tip 1: Always verify totals
Tip 2: Read questions carefully
Tip 3: Use labels
Tip 4: Think about context
Tip 5: Practice both directions
Two-way tables organize data with two categorical variables:
Structure:
Types of frequencies:
Relative frequencies:
Applications:
Two-way tables are powerful tools for organizing, analyzing, and interpreting categorical data in countless real-world situations!
In a two-way table, 25 out of 50 boys play sports and 30 out of 60 girls play sports. What is the joint frequency for girls who play sports?
Joint frequency is the count in a specific cell.
Girls who play sports = 30
Answer: 30
A table shows: 40 adults prefer coffee, 60 prefer tea (100 total adults); 30 teens prefer coffee, 20 prefer tea (50 total teens). What percent of ALL people prefer coffee?
Total preferring coffee = 40 + 30 = 70
Grand total = 100 + 50 = 150
Percent = 70/150 = 7/15 ≈ 0.467 = 46.7%
Answer: 46.7% (or 7/15)
Using the table from the previous problem, what percent of adults prefer coffee?
This is CONDITIONAL relative frequency (given adults).
Adults preferring coffee = 40 Total adults = 100
Percent = 40/100 = 0.40 = 40%
Answer: 40%
A study shows: Of 80 people who exercise daily, 60 rate their health as good. Of 120 people who rarely exercise, 40 rate their health as good. Is there an association between exercise and health rating?
Compare conditional frequencies:
Daily exercisers with good health: 60/80 = 75%
Rare exercisers with good health: 40/120 = 33.3%
Large difference (75% vs 33.3%) suggests an association.
People who exercise daily are more likely to rate their health as good.
Answer: Yes, there appears to be a positive association between daily exercise and good health ratings