Solved Exercises on Interpreting Two-Way Tables

Master two-way table interpretation: joint, marginal, and conditional frequencies through these 5 detailed exercises covering analysis, comparison, and real-world applications.

Solution: Exercises 1 to 3
1 Basic Two-Way Table Analysis
Exercise 1
Analyze the following two-way table showing movie genre preferences by gender: Action-Men=45, Romance-Men=15, Comedy-Men=30; Action-Women=20, Romance-Women=50, Comedy-Women=30. Find joint, marginal, and conditional frequencies.
Definition:

Two-way table: A table that displays the frequency distribution of two categorical variables.

Joint frequency: The count of observations that fall into a specific combination of categories.

Marginal frequency: The total count for each category of one variable across all categories of the other variable.

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

Analysis process:
  1. Fill in the complete table with row and column totals
  2. Identify all joint frequencies (internal cells)
  3. Calculate marginal frequencies (row and column totals)
  4. Compute conditional frequencies by dividing by relevant marginal totals
  5. Interpret the relationships between variables
Step 1: Construct the complete two-way table
Genre Action Romance Comedy Total
Men 45 15 30 90
Women 20 50 30 100
Total 65 65 60 190
Step 2: Identify joint frequencies

These are the internal cells of the table:

Men and Action: 45

Men and Romance: 15

Men and Comedy: 30

Women and Action: 20

Women and Romance: 50

Women and Comedy: 30

Step 3: Calculate marginal frequencies

Row totals (gender margins):

Men total: 90

Women total: 100

Column totals (genre margins):

Action total: 65

Romance total: 65

Comedy total: 60

Step 4: Calculate conditional frequencies by gender

For Men:

P(Action | Men) = 45/90 = 0.50 or 50%

P(Romance | Men) = 15/90 = 0.167 or 16.7%

P(Comedy | Men) = 30/90 = 0.333 or 33.3%

For Women:

P(Action | Women) = 20/100 = 0.20 or 20%

P(Romance | Women) = 50/100 = 0.50 or 50%

P(Comedy | Women) = 30/100 = 0.30 or 30%

Step 5: Calculate conditional frequencies by genre

For Action:

P(Men | Action) = 45/65 = 0.692 or 69.2%

P(Women | Action) = 20/65 = 0.308 or 30.8%

For Romance:

P(Men | Romance) = 15/65 = 0.231 or 23.1%

P(Women | Romance) = 50/65 = 0.769 or 76.9%

Joint: (45,15,30,20,50,30); Marginal: (90,100,65,65,60); Conditional: Men(50%,16.7%,33.3%), Women(20%,50%,30%)
Final answer:

The analysis shows clear gender preferences: Men prefer Action (50%) while Women prefer Romance (50%). Comedy is popular among both groups (33.3% for Men, 30% for Women). The most popular combination is Men choosing Action (45 out of 190 total responses).

Applied rules:

• Joint frequencies: Values in internal cells of table

• Marginal frequencies: Row and column totals

• Conditional frequencies: Cell value ÷ Relevant marginal total

2 Conditional Probability Interpretation
Exercise 2
Using the table from Exercise 1, calculate P(Action | Man) and P(Man | Action). Explain what each probability means and why they are different.
Definition:

Conditional probability: The probability of an event occurring given that another event has occurred.

Notation: P(A|B) means "probability of A given B."

Step 1: Recall the table from Exercise 1
Genre Action Romance Comedy Total
Men 45 15 30 90
Women 20 50 30 100
Total 65 65 60 190
Step 2: Calculate P(Action | Man)

This is the probability of choosing Action given that the person is a Man

Formula: P(Action | Man) = P(Action and Man) ÷ P(Man)

Using frequencies: P(Action | Man) = 45 ÷ 90 = 0.50 or 50%

Step 3: Calculate P(Man | Action)

This is the probability of being a Man given that the person chose Action

Formula: P(Man | Action) = P(Man and Action) ÷ P(Action)

Using frequencies: P(Man | Action) = 45 ÷ 65 = 0.692 or 69.2%

Step 4: Interpret P(Action | Man)

This asks: "Of all Men, what percentage prefer Action?"

Answer: 50% of Men prefer Action movies

Step 5: Interpret P(Man | Action)

This asks: "Of all Action movie fans, what percentage are Men?"

Answer: 69.2% of Action movie fans are Men

Step 6: Explain why they're different

The denominators are different:

P(Action | Man): Denominator is total Men (90)

P(Man | Action): Denominator is total Action fans (65)

They answer different questions about the relationship between gender and preference

P(Action | Man) = 0.50; P(Man | Action) = 0.692; Different denominators, different questions
Final answer:

P(Action | Man) = 0.50 means 50% of Men prefer Action movies. P(Man | Action) = 0.692 means 69.2% of Action movie fans are Men. These probabilities are different because they have different reference groups: the first considers all Men, the second considers all Action fans. This illustrates that P(A|B) ≠ P(B|A) in general.

Applied rules:

• Conditional probability: P(A|B) = P(A ∩ B) ÷ P(B)

• Order matters: P(A|B) ≠ P(B|A) unless P(A) = P(B)

• Reference group: The condition determines the denominator

3 Association Detection
Exercise 3
Determine if gender and movie preference are independent using the data from Exercise 1. What does independence mean in this context?
Definition:

Independence: Two variables are independent if the occurrence of one does not affect the probability of the other.

Association: A relationship between two variables where the probability of one depends on the value of the other.

Step 1: State the independence condition

Variables are independent if: P(A|B) = P(A) for all combinations

Or equivalently: P(A and B) = P(A) × P(B)

Step 2: Calculate marginal probabilities

P(Men) = 90/190 = 0.474

P(Women) = 100/190 = 0.526

P(Action) = 65/190 = 0.342

P(Romance) = 65/190 = 0.342

P(Comedy) = 60/190 = 0.316

Step 3: Calculate conditional probabilities

P(Action | Men) = 45/90 = 0.500

P(Action | Women) = 20/100 = 0.200

P(Romance | Men) = 15/90 = 0.167

P(Romance | Women) = 50/100 = 0.500

Step 4: Compare conditional to marginal probabilities

Is P(Action | Men) = P(Action)? 0.500 ≠ 0.342 → No

Is P(Action | Women) = P(Action)? 0.200 ≠ 0.342 → No

Is P(Romance | Men) = P(Romance)? 0.167 ≠ 0.342 → No

Is P(Romance | Women) = P(Romance)? 0.500 ≠ 0.342 → No

Step 5: Verify with joint probability test

If independent: P(Action and Men) = P(Action) × P(Men)

Expected: 0.342 × 0.474 = 0.162

Actual: 45/190 = 0.237 ≠ 0.162

Step 6: Draw conclusion

Since conditional probabilities differ significantly from marginal probabilities, the variables are dependent.

Gender affects movie preference and vice versa.

Variables are dependent; P(Action | Men) = 0.500 ≠ P(Action) = 0.342
Final answer:

Gender and movie preference are not independent. There is a strong association: Men are more likely to prefer Action (50% vs 34.2% overall) and less likely to prefer Romance (16.7% vs 34.2% overall). Women show the opposite pattern. The conditional probabilities differ significantly from marginal probabilities, confirming dependence.

Applied rules:

• Independence test: P(A|B) = P(A) for all combinations

• Joint probability test: P(A ∩ B) = P(A) × P(B)

• Association indicator: Large differences between conditional and marginal probabilities

Two-Way Table Interpretation Framework
P(A|B) = \frac{P(A \cap B)}{P(B)}
Conditional Probability Formula
Joint Freq.
P(A \cap B)
Cell values
Intersection count
Marginal Freq.
P(A) or P(B)
Row/col totals
Individual probability
Conditional Freq.
P(A|B) = \frac{P(A \cap B)}{P(B)}
Relative to condition
Within-group probability
Key definitions:

Contingency table: A table showing the frequency distribution of two categorical variables.

Relative frequencies: Proportions calculated as frequency ÷ total observations.

Independence: Two variables are independent if knowing the value of one doesn't change the probability of the other.

Interpretation process:
  1. Identify variables: Determine what each row and column represents
  2. Calculate joint frequencies: Count observations in each cell
  3. Calculate marginal frequencies: Sum rows and columns
  4. Compute conditional frequencies: Divide cells by relevant margins
  5. Test independence: Compare conditional to marginal probabilities
  6. Draw conclusions: Interpret findings in context
Tip 1: Always verify that row and column totals match the grand total.
Tip 2: Conditional probabilities reveal associations between variables.
Tip 3: If variables are independent, conditional probabilities equal marginal probabilities.
Tip 4: Convert to percentages for easier interpretation of relative frequencies.
Table Properties: Joint frequencies sum to grand total, marginal frequencies represent individual variable distributions, conditional frequencies sum to 1 within each row/column.
Independence Properties: P(A|B) = P(A), P(B|A) = P(B), P(A ∩ B) = P(A) × P(B).
Association patterns:

• Positive association: Conditional probability higher than marginal probability

• Negative association: Conditional probability lower than marginal probability

• Independence: Conditional probability equals marginal probability

Solution: Exercises 4 to 5
4 Relative Frequency Conversion
Exercise 4
Convert the table from Exercise 1 to relative frequencies. What insights does this provide that aren't apparent in the frequency table?
Definition:

Relative frequency table: A table showing proportions or percentages instead of raw counts.

Proportional analysis: Examining relationships between variables using ratios rather than counts.

Step 1: Recall the original frequency table
Genre Action Romance Comedy Total
Men 45 15 30 90
Women 20 50 30 100
Total 65 65 60 190
Step 2: Convert to joint relative frequencies (divide each cell by 190)
Genre Action Romance Comedy Total
Men 0.237 0.079 0.158 0.474
Women 0.105 0.263 0.158 0.526
Total 0.342 0.342 0.316 1.000
Step 3: Calculate conditional relative frequencies by gender

For Men (divide each cell in Men row by 0.474):

P(Action | Men) = 0.237 ÷ 0.474 = 0.500

P(Romance | Men) = 0.079 ÷ 0.474 = 0.167

P(Comedy | Men) = 0.158 ÷ 0.474 = 0.333

Step 4: Calculate conditional relative frequencies by genre

For Action (divide each cell in Action column by 0.342):

P(Men | Action) = 0.237 ÷ 0.342 = 0.693

P(Women | Action) = 0.105 ÷ 0.342 = 0.307

Step 5: Analyze the insights from relative frequencies

Relative frequencies normalize for different group sizes, making comparisons clearer

They reveal the proportional makeup of each group more clearly than raw counts

Patterns of association become more apparent when sample sizes differ

Relative frequencies reveal proportional relationships; Men (50%) vs Women (20%) for Action
Final answer:

The relative frequency table shows that 50% of Men prefer Action movies, while only 20% of Women do. Similarly, 50% of Women prefer Romance, while only 16.7% of Men do. This proportional view makes the gender differences much clearer than the raw counts. The relative frequencies also sum to 1.000, confirming they represent a complete probability distribution.

Applied rules:

• Joint relative frequency: Cell value ÷ Grand total

• Conditional relative frequency: Cell value ÷ Relevant marginal total

• Sum property: Marginal relative frequencies sum to 1

5 Real-World Application
Exercise 5
A restaurant manager collected data on meal preference by age group: Breakfast-Under 30=25, Lunch-Under 30=45, Dinner-Under 30=30; Breakfast-30-50=40, Lunch-30-50=35, Dinner-30-50=45; Breakfast-Over 50=55, Lunch-Over 50=20, Dinner-Over 50=35. Analyze the association between age and meal preference.
Definition:

Business analytics: Using statistical methods to analyze business data and inform decisions.

Market segmentation: Dividing customers into groups based on shared characteristics.

Step 1: Organize the data into a contingency table
Meal Breakfast Lunch Dinner Total
Under 30 25 45 30 100
30-50 40 35 45 120
Over 50 55 20 35 110
Total 120 100 110 330
Step 2: Calculate conditional probabilities by age group

Under 30: P(Breakfast) = 25/100 = 0.25, P(Lunch) = 45/100 = 0.45, P(Dinner) = 30/100 = 0.30

30-50: P(Breakfast) = 40/120 = 0.333, P(Lunch) = 35/120 = 0.292, P(Dinner) = 45/120 = 0.375

Over 50: P(Breakfast) = 55/110 = 0.50, P(Lunch) = 20/110 = 0.182, P(Dinner) = 35/110 = 0.318

Step 3: Calculate marginal probabilities

P(Breakfast) = 120/330 = 0.364

P(Lunch) = 100/330 = 0.303

P(Dinner) = 110/330 = 0.333

Step 4: Compare conditional to marginal probabilities

Under 30: Lunch (45%) > Overall (30.3%), Breakfast (25%) < Overall (36.4%)

Over 50: Breakfast (50%) > Overall (36.4%), Lunch (18.2%) < Overall (30.3%)

This shows clear age-related preferences

Step 5: Identify key patterns

Young adults (Under 30) prefer lunch most (45%)

Middle age (30-50) prefer dinner most (37.5%)

Older adults (Over 50) prefer breakfast most (50%)

There is a strong association between age and meal preference

Strong age-meal association: Young→Lunch, Middle→Dinner, Older→Breakfast
Final answer:

There is a strong association between age and meal preference. Young adults (under 30) are most likely to choose lunch (45%), middle-aged adults (30-50) prefer dinner (37.5%), and older adults (over 50) prefer breakfast (50%). The conditional probabilities differ significantly from the marginal probabilities, confirming that age and meal choice are dependent variables. This information could help the restaurant tailor marketing and menu offerings to different age segments.

Applied rules:

• Association detection: Compare conditional to marginal probabilities

• Pattern identification: Look for consistent differences across groups

• Business application: Use insights for targeted strategies

Comprehensive Guide to Two-Way Table Interpretation
P(A|B) = \frac{P(A \cap B)}{P(B)} \quad \text{and} \quad P(A \cap B) = P(A|B) \cdot P(B)
Conditional Probability Relations
Key definitions:

Two-way table: A table that displays the frequency distribution of two categorical variables.

Joint frequency: The count of observations that fall into a specific combination of categories.

Marginal frequency: The total count for each category of one variable across all categories of the other variable.

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

Independence: Two variables are independent if the occurrence of one does not affect the probability of the other.

Analysis process:
  1. Table construction: Organize data into rows and columns
  2. Frequency calculation: Compute joint, marginal, and conditional frequencies
  3. Independence testing: Compare conditional to marginal probabilities
  4. Pattern identification: Look for associations between variables
  5. Interpretation: Explain findings in real-world context
Tip 1: Always check that row and column totals match the grand total.
Tip 2: Use conditional probabilities to identify associations between variables.
Tip 3: Convert to percentages for easier interpretation of relative frequencies.
Tip 4: Look for patterns across conditional distributions to identify associations.
Tip 5: Consider the practical significance of statistical associations.
Tip 6: Use relative frequencies when comparing groups of different sizes.
Table Properties: Joint frequencies sum to grand total, marginal frequencies represent individual variable distributions, conditional frequencies sum to 1 within each row/column.
Independence Properties: P(A|B) = P(A), P(B|A) = P(B), P(A ∩ B) = P(A) × P(B).
Association Indicators: Large differences between conditional and marginal probabilities, non-uniform conditional distributions, P(A|B) ≠ P(A).
Statistical relationships:

• Multiplication rule: P(A ∩ B) = P(A|B) × P(B)

• Independence condition: P(A|B) = P(A) and P(B|A) = P(B)

• Sum property: Conditional probabilities in each row/column sum to 1

• Bayes theorem: P(A|B) = P(B|A) × P(A) ÷ P(B)

Two-Way Table Analysis Visualization
Understanding Two-Way Table Components
Key characteristics of two-way table analysis:
Joint frequencies: Intersection of row and column categories
Marginal frequencies: Totals for individual variables
Conditional frequencies: Probabilities within specific groups
Independence: No association between variables
Association: Relationship between categorical variables

Analysis: Two-way tables reveal relationships between categorical variables through frequency patterns and conditional probabilities.

  • Joint frequencies: Show specific category combinations
  • Marginal frequencies: Show individual variable distributions
  • Conditional frequencies: Reveal associations between variables
  • Independence testing: Compare conditional to marginal probabilities
  • Pattern identification: Look for meaningful relationships

Questions & Answers

Question: How do I know if two variables are independent using a two-way table? What should I look for?

Answer: Test independence by comparing conditional to marginal probabilities:

  • Method 1: Check if P(A|B) = P(A) for all combinations
  • Method 2: Check if P(A ∩ B) = P(A) × P(B) for all combinations
  • Method 3: Examine if conditional distributions are uniform across groups

Independence indicators:

  • Conditional probabilities equal marginal probabilities
  • Conditional distributions are similar across all categories
  • Small differences between observed and expected frequencies

If conditional probabilities differ significantly from marginal probabilities, the variables are dependent.

Question: What's the difference between row percentages and column percentages in a two-way table? When should I use each?

Answer: They represent different conditional probabilities:

  • Row percentages: Conditional probabilities given the row variable (P(Column|Row))
  • Column percentages: Conditional probabilities given the column variable (P(Row|Column))

Use row percentages when: You want to compare across categories of the column variable for each row category.

Use column percentages when: You want to compare across categories of the row variable for each column category.

Choose based on your research question: if asking "what percentage of X are Y?", use row percentages. If asking "what percentage of Y are X?", use column percentages.

Question: Can I use two-way tables with quantitative variables, or only categorical variables?

Answer: Two-way tables are designed for categorical variables, but quantitative variables can be converted:

  • Grouping: Convert quantitative variables into categories (e.g., age groups: 18-25, 26-35, etc.)
  • Binary classification: Create categories like "above/below median" or "high/medium/low"
  • Intervals: Define meaningful intervals for the quantitative variable

Example: Instead of using exact test scores (quantitative), you could categorize them as "Below 70", "70-85", "Above 85" to create a two-way table with another categorical variable.

For true quantitative variables without categorization, other methods like correlation or regression are more appropriate than two-way tables.

Question: How do I interpret a very large difference between conditional and marginal probabilities?

Answer: A large difference indicates a strong association between variables:

  • Strong association: Large differences suggest one variable strongly predicts the other
  • Practical significance: The relationship may be meaningful in real-world applications
  • Dependence: Variables are not independent
  • Direction of relationship: Shows which categories are positively or negatively associated

Interpretation guidelines:

  • Difference > 0.10: Strong association
  • Difference 0.05-0.10: Moderate association
  • Difference < 0.05: Weak association

For example, if P(Excellent Grade | Tutoring) = 0.80 but P(Excellent Grade) = 0.30, tutoring has a strong positive association with excellent grades.

Question: When comparing conditional probabilities across different groups, what patterns should I look for to identify meaningful associations?

Answer: Look for these key patterns:

  • Consistent direction: Conditional probabilities consistently higher or lower than marginal across multiple categories
  • Large effect sizes: Differences of 0.15 or more between conditional and marginal probabilities
  • Non-uniform distributions: One group having very different conditional probabilities than others
  • Contrasting patterns: Opposite trends in different groups

Example patterns:

  • If P(A|Group1) = 0.7, P(A|Group2) = 0.6, P(A|Group3) = 0.75, and P(A) = 0.4, there's a strong association
  • If P(A|Group1) = 0.2, P(A|Group2) = 0.8, P(A|Group3) = 0.3, and P(A) = 0.5, there's a strong group-dependent association

Also consider the practical significance of these patterns in the context of your study.