Solved Exercises on Two-Way Tables and Relative Frequencies

Master two-way tables and relative frequencies: constructing tables, calculating marginal and conditional frequencies, and analyzing associations through these 5 detailed exercises.

Solution: Exercises 1 to 3
1 Student Preferences
Exercise 1
A survey of 200 students asked about their preference for lunch options and gender. 60 males preferred pizza, 40 males preferred sandwiches, 50 females preferred pizza, and 50 females preferred sandwiches. Construct a two-way table and calculate the marginal relative frequencies for each category.
Definition:

Two-Way Table: A table showing the frequency distribution of two categorical variables.

Marginal Frequency: The total frequency for each row and column.

Marginal Relative Frequency: Marginal frequency divided by total sample size.

Method for constructing two-way tables:
  1. Identify the two categorical variables
  2. Create rows for one variable and columns for the other
  3. Fill in the cell frequencies
  4. Calculate row totals and column totals
  5. Calculate marginal relative frequencies
Lunch Preference Pizza Sandwiches Total Male 60 40 100 Female 50 50 100 Total 110 90 200
Step 1: Verify table totals

Row totals: Male = 60 + 40 = 100, Female = 50 + 50 = 100

Column totals: Pizza = 60 + 50 = 110, Sandwiches = 40 + 50 = 90

Grand total = 200 ✓

Step 2: Calculate marginal relative frequencies for rows

Male: 100/200 = 0.50 or 50%

Female: 100/200 = 0.50 or 50%

Step 3: Calculate marginal relative frequencies for columns

Pizza: 110/200 = 0.55 or 55%

Sandwiches: 90/200 = 0.45 or 45%

Step 4: Interpret results

Equal gender distribution (50% each)

Pizza is more popular than sandwiches (55% vs 45%)

Male
50%
Female
50%
Pizza
55%
Sandwiches
45%
Marginal relative frequencies: Male 50%, Female 50%, Pizza 55%, Sandwiches 45%
Final answer:

The two-way table shows equal gender distribution with pizza being more popular than sandwiches.

Marginal relative frequencies: 50% male, 50% female, 55% pizza, 45% sandwiches.

Applied rules:

• Marginal Relative Frequency: Category total ÷ Grand total

• Table Verification: Row totals and column totals must match grand total

• Percentage Calculation: Decimal × 100%

2 Conditional Relative Frequencies
Exercise 2
Using the table from Exercise 1, calculate the conditional relative frequencies for lunch preference given gender. What percentage of males prefers pizza? What percentage of females prefers sandwiches?
Definition:

Conditional Relative Frequency: The relative frequency of one variable given a specific value of another variable.

Formula: Cell frequency ÷ Row/column total for the condition.

Lunch Preference Pizza Sandwiches Total Male 60 40 100 Female 50 50 100
Step 1: Calculate conditional relative frequencies for males

Given male, probability of preferring pizza = 60/100 = 0.60 or 60%

Given male, probability of preferring sandwiches = 40/100 = 0.40 or 40%

Step 2: Calculate conditional relative frequencies for females

Given female, probability of preferring pizza = 50/100 = 0.50 or 50%

Given female, probability of preferring sandwiches = 50/100 = 0.50 or 50%

Step 3: Answer specific questions

Percentage of males who prefer pizza: 60%

Percentage of females who prefer sandwiches: 50%

Step 4: Compare conditional frequencies

Males: 60% pizza, 40% sandwiches

Females: 50% pizza, 50% sandwiches

Males are more likely to prefer pizza than females

Male Pizza
60%
Male Sand.
40%
Female Pizza
50%
Female Sand.
50%
Male Pizza: 60%, Female Sandwich: 50%
Final answer:

60% of males prefer pizza.

50% of females prefer sandwiches.

There appears to be a difference in lunch preferences by gender.

Applied rules:

• Conditional Relative Frequency: Cell frequency ÷ Row total (for row condition)

• Association Detection: Compare conditional frequencies across categories

• Row Totals: Use for conditioning on row variable

3 Activity Participation
Exercise 3
A study of 300 high school students found that 80 participated in sports and had a part-time job, 40 participated in sports but didn't have a job, 120 didn't participate in sports but had a job, and 60 neither participated in sports nor had a job. Create a two-way table and determine if there appears to be an association between sports participation and having a part-time job.
Definition:

Association: A relationship between two variables where knowing the value of one variable provides information about the value of the other.

Independence: No relationship exists between variables.

Part-Time Job Yes No Total Sports Participation - Yes 80 40 120 Sports Participation - No 120 60 180 Total 200 100 300
Step 1: Calculate conditional relative frequencies for sports participants

Given participates in sports: Job = 80/120 = 0.667 or 66.7%

Given participates in sports: No job = 40/120 = 0.333 or 33.3%

Step 2: Calculate conditional relative frequencies for non-participants

Given doesn't participate in sports: Job = 120/180 = 0.667 or 66.7%

Given doesn't participate in sports: No job = 60/180 = 0.333 or 33.3%

Step 3: Compare conditional frequencies

Sports participants: 66.7% have jobs, 33.3% don't

Non-participants: 66.7% have jobs, 33.3% don't

The conditional frequencies are identical!

Step 4: Determine association

Since the conditional relative frequencies are the same for both groups, there is no association between sports participation and having a part-time job.

The variables appear to be independent.

Sports + Job
66.7%
Sports - Job
33.3%
No Sports + Job
66.7%
No Sports - Job
33.3%
No association detected (conditional frequencies identical)
Final answer:

There is no association between sports participation and having a part-time job.

The conditional relative frequencies are identical for both groups.

The variables appear to be independent.

Applied rules:

• Association Detection: Compare conditional frequencies across categories

• Independence: Identical conditional frequencies suggest independence

• Conditional Frequency: Cell frequency ÷ Row/column total

Two-Way Tables: Core Concepts
\text{Marginal Relative Frequency} = \frac{\text{Category Total}}{\text{Grand Total}}
Marginal Relative Frequency Formula
Marginal Freq.
Row/Col Total
Category totals
Conditional Freq.
Cell ÷ Row Total
Given condition
Joint Freq.
Cell Value
Intersection
Key definitions:

Two-Way Table: A table displaying the frequency distribution of two categorical variables.

Marginal Frequency: The totals for each row and column.

Conditional Frequency: The frequency of one variable given a specific value of another.

Joint Frequency: The frequency in each individual cell.

Table Structure: Rows represent one variable, columns represent another variable.
Association Detection: Compare conditional frequencies across categories to detect relationships.
Tip 1: Always verify that row totals and column totals match the grand total.
Tip 2: Use conditional frequencies to determine if there's an association between variables.
Tip 3: If conditional frequencies are similar across categories, variables are likely independent.
Essential formulas:

• Marginal Relative Frequency = Category Total ÷ Grand Total

• Conditional Relative Frequency = Cell Value ÷ Row/Column Total

• Joint Relative Frequency = Cell Value ÷ Grand Total

• Association exists when conditional frequencies differ significantly

Solution: Exercises 4 to 5
4 Political Affiliation Survey
Exercise 4
A political survey of 400 people categorized responses by age group and political affiliation. 50 young adults (18-30) were Democrats, 30 were Republicans, 20 were Independents. 60 middle-aged adults (31-50) were Democrats, 80 were Republicans, 40 were Independents. 40 older adults (51+) were Democrats, 50 were Republicans, 30 were Independents. Create a two-way table and find the relative frequency of each political affiliation.
Definition:

Relative Frequency: The proportion of the total that falls into a particular category.

Joint Relative Frequency: Individual cell value divided by grand total.

Political Affiliation Democrat Republican Independent Total Young Adults (18-30) 50 30 20 100 Middle-aged (31-50) 60 80 40 180 Older Adults (51+) 40 50 30 120 Total 150 160 90 400
Step 1: Calculate marginal relative frequencies for political affiliation

Democrats: 150/400 = 0.375 or 37.5%

Republicans: 160/400 = 0.400 or 40.0%

Independents: 90/400 = 0.225 or 22.5%

Step 2: Calculate marginal relative frequencies for age groups

Young Adults: 100/400 = 0.250 or 25.0%

Middle-aged: 180/400 = 0.450 or 45.0%

Older Adults: 120/400 = 0.300 or 30.0%

Step 3: Calculate joint relative frequencies

Young Democrat: 50/400 = 0.125 or 12.5%

Middle Republican: 80/400 = 0.200 or 20.0%

And so on for all cells

Step 4: Analyze the data

Republicans are the most common affiliation (40%)

Middle-aged adults are the largest age group (45%)

Young adults show more balanced party affiliation

Democrats
37.5%
Republicans
40.0%
Independents
22.5%
Democrats: 37.5%, Republicans: 40.0%, Independents: 22.5%
Final answer:

The relative frequency of each political affiliation is:

Democrats: 37.5%, Republicans: 40.0%, Independents: 22.5%

Republicans are the most common political affiliation.

Applied rules:

• Marginal Relative Frequency: Column total ÷ Grand total

• Joint Relative Frequency: Cell value ÷ Grand total

• Verification: All relative frequencies sum to 1

5 Academic Performance Study
Exercise 5
A study of 500 students examined the relationship between tutoring attendance and academic performance. Of the 200 students who attended tutoring regularly, 150 passed and 50 failed. Of the 300 students who didn't attend tutoring regularly, 180 passed and 120 failed. Create a two-way table and determine if attending tutoring is associated with passing rates.
Definition:

Academic Performance: Categorical variable with two outcomes (pass/fail).

Association Strength: Measured by comparing conditional probabilities.

Academic Performance Pass Fail Total Tutoring - Regular 150 50 200 Tutoring - Not Regular 180 120 300 Total 330 170 500
Step 1: Calculate conditional relative frequencies for regular tutoring attendees

Given regular tutoring: Pass = 150/200 = 0.75 or 75%

Given regular tutoring: Fail = 50/200 = 0.25 or 25%

Step 2: Calculate conditional relative frequencies for non-attendees

Given no regular tutoring: Pass = 180/300 = 0.60 or 60%

Given no regular tutoring: Fail = 120/300 = 0.40 or 40%

Step 3: Compare conditional frequencies

Regular tutoring: 75% pass, 25% fail

No regular tutoring: 60% pass, 40% fail

There's a 15% difference in pass rates!

Step 4: Determine association

Students who attend tutoring regularly have a higher pass rate (75% vs 60%)

This suggests a positive association between tutoring attendance and academic success

Tutoring Pass
75%
Tutoring Fail
25%
No Tutoring Pass
60%
No Tutoring Fail
40%
Association detected: Regular tutoring (75% pass) vs No regular tutoring (60% pass)
Final answer:

There is a strong association between tutoring attendance and academic performance.

Students attending tutoring regularly have a 75% pass rate compared to 60% for those not attending regularly.

This suggests that attending tutoring is beneficial for academic success.

Applied rules:

• Association Detection: Compare conditional relative frequencies

• Strength of Association: Larger differences indicate stronger association

• Causation vs Correlation: Association doesn't imply causation

Two-Way Tables and Relative Frequencies: Comprehensive Summary

Complete Summary: Two-Way Tables and Relative Frequencies

Core Concepts

Two-Way Table: Displays frequency distribution of two categorical variables.

Marginal Frequency: Totals for each row and column.

Conditional Frequency: Frequency of one variable given a specific value of another.

Joint Frequency: Frequency in each individual cell.

Key Properties

Table Structure: Rows represent one variable, columns represent another.

Total Verification: Row totals and column totals must equal grand total.

Frequency Types: Marginal, conditional, and joint frequencies.

Association Detection: Compare conditional frequencies across categories.

Construction Process

Step 1: Identify two categorical variables.

Step 2: Create table with rows for one variable and columns for the other.

Step 3: Fill in cell frequencies.

Step 4: Calculate row and column totals.

Step 5: Calculate various types of relative frequencies.

Association Analysis

Independence: Conditional frequencies are similar across categories.

Association: Conditional frequencies differ significantly.

Strength: Greater differences indicate stronger association.

Direction: Positive or negative relationship.

Detailed Definitions:

Two-Way Table: A contingency table that displays the frequency distribution of two categorical variables simultaneously.

Marginal Relative Frequency: The proportion of the total sample that belongs to a particular category of one variable.

Conditional Relative Frequency: The proportion of a subset (row or column) that falls into a particular category.

Joint Relative Frequency: The proportion of the total sample that falls into a specific combination of categories.

Association: A relationship between two variables where knowledge of one variable provides information about the other.

Systematic Analysis Method:
  1. Construct Table: Organize data into two-way table format.
  2. Calculate Totals: Find row totals, column totals, and grand total.
  3. Calculate Relative Frequencies: Compute marginal, conditional, and joint frequencies.
  4. Analyze Patterns: Compare conditional frequencies to detect associations.
  5. Draw Conclusions: Interpret results in context of the problem.
Memory Tip: "Marginal" means totals at the margins (edges) of the table.
Common Mistake: Using wrong denominator for conditional frequencies (always use row/column total).
Efficiency Tip: Calculate all marginal frequencies first, then conditional frequencies.
Analysis Tip: Look for large differences in conditional frequencies to identify associations.
Key Applications: Survey analysis, market research, medical studies, educational assessments.
Important Note: Association does not imply causation; correlation doesn't prove cause-and-effect.
Critical Formulas to Remember:

• Marginal Relative Frequency = Category Total ÷ Grand Total

• Conditional Relative Frequency = Cell Value ÷ Row/Column Total

• Joint Relative Frequency = Cell Value ÷ Grand Total

• Association exists when conditional frequencies differ significantly

Questions & Answers

Question: What's the difference between marginal, conditional, and joint relative frequencies? They all seem similar.

Answer: Great question! Here's how they differ:

Marginal Relative Frequency:

  • Proportion of the total sample in a single category
  • Example: Overall percentage of males in the sample
  • Formula: Row/Column total ÷ Grand total

Conditional Relative Frequency:

  • Proportion within a specific subgroup
  • Example: Percentage of males who prefer pizza (given that they're male)
  • Formula: Cell value ÷ Row/Column total (for condition)

Joint Relative Frequency:

  • Proportion of the total sample in a specific combination of categories
  • Example: Percentage of the total sample that is male AND prefers pizza
  • Formula: Cell value ÷ Grand total

Conditional frequencies are key for detecting associations between variables.

Question: How do I know if two variables are independent based on a two-way table? What exactly does independence mean?

Answer: Independence means that knowing the value of one variable gives no information about the value of the other variable.

Testing Independence:

Compare conditional relative frequencies across different categories. If the conditional frequencies are the same (or very similar), the variables are independent.

Example:

  • If 60% of males prefer A and 60% of females prefer A, then gender and preference are independent
  • If 80% of males prefer A but only 30% of females prefer A, then gender and preference are dependent

Mathematical Definition:

Variables X and Y are independent if P(Y=y|X=x) = P(Y=y) for all values x and y.

This means the conditional probability equals the marginal probability.

Question: In Exercise 5, you said there's an association between tutoring and grades, but does that mean tutoring causes better grades?

Answer: This is a crucial distinction in statistics:

Association vs. Causation:

Association: Variables tend to occur together (correlation)

Causation: One variable directly causes changes in another

Confounding Variables:

Students who attend tutoring might be more motivated, spend more time studying, or have better study habits - these could explain the grade difference.

Establishing Causation:

  • Requires controlled experiments
  • Must eliminate confounding variables
  • Needs to establish temporal order (cause before effect)
  • Should show a dose-response relationship

We can say tutoring is associated with better grades, but we cannot conclude tutoring causes better grades without a controlled experiment.