Solved Exercises on Relative Frequency Tables

Master relative frequency tables: joint, marginal, and conditional relative frequencies through these 5 detailed exercises covering construction, analysis, and interpretation of contingency tables.

Solution: Exercises 1 to 3
1 Basic Relative Frequency Table Construction
Exercise 1
Convert the following two-way frequency table of student preferences to a relative frequency table. Then calculate joint, marginal, and conditional relative frequencies. Favorite Subject by Grade: Grade 9: Math=30, English=20; Grade 10: Math=40, English=30; Grade 11: Math=25, English=35. Total students = 180.
Definition:

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

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

Marginal relative frequency: The proportion of observations for each category of one variable.

Conditional relative frequency: The proportion of observations in one category given another category.

Conversion process:
  1. Start with the frequency table
  2. Divide each cell by the grand total
  3. Calculate row and column totals (marginal frequencies)
  4. Calculate conditional frequencies by dividing by relevant marginal totals
Step 1: Create the original frequency table
Favorite Subject Math English Total
Grade 9 30 20 50
Grade 10 40 30 70
Grade 11 25 35 60
Total 95 85 180
Step 2: Convert to joint relative frequencies (divide each cell by 180)
Favorite Subject Math English Total
Grade 9 0.167 0.111 0.278
Grade 10 0.222 0.167 0.389
Grade 11 0.139 0.194 0.333
Total 0.528 0.472 1.000
Step 3: Calculate conditional relative frequencies by grade (row percentages)

For Grade 9: P(Math|Grade 9) = 30/50 = 0.60, P(English|Grade 9) = 20/50 = 0.40

For Grade 10: P(Math|Grade 10) = 40/70 = 0.571, P(English|Grade 10) = 30/70 = 0.429

For Grade 11: P(Math|Grade 11) = 25/60 = 0.417, P(English|Grade 11) = 35/60 = 0.583

Step 4: Calculate conditional relative frequencies by subject (column percentages)

For Math: P(Grade 9|Math) = 30/95 = 0.316, P(Grade 10|Math) = 40/95 = 0.421, P(Grade 11|Math) = 25/95 = 0.263

For English: P(Grade 9|English) = 20/85 = 0.235, P(Grade 10|English) = 30/85 = 0.353, P(Grade 11|English) = 35/85 = 0.412

Step 5: Interpret the results

Joint frequencies show overall distribution: 16.7% are Grade 9 students who prefer Math

Marginal frequencies: 52.8% prefer Math, 47.2% prefer English

Conditional frequencies reveal patterns: Grade 11 students are more likely to prefer English (58.3%)

Joint rel freq: (0.167, 0.111, 0.222, 0.167, 0.139, 0.194); Marginals: (0.528, 0.472, 0.278, 0.389, 0.333)
Final answer:

The relative frequency table shows that 52.8% of students prefer Math while 47.2% prefer English. However, conditional analysis reveals Grade-level differences: Grade 9 (60% Math), Grade 10 (57.1% Math), and Grade 11 (41.7% Math). This suggests an association between grade level and subject preference.

Applied rules:

• Joint relative frequency: Cell value ÷ Grand total

• Conditional frequency: Cell value ÷ Relevant marginal total

• Sum property: Marginal frequencies sum to 1

2 Conditional Probability Analysis
Exercise 2
A survey of 300 people asked about their preferred mode of transportation and age group. Using the relative frequency table, find P(Car | Young Adult) and P(Young Adult | Car). Interpret these probabilities.
Definition:

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

Joint probability: The probability of two events occurring together.

Marginal probability: The probability of a single event occurring.

Step 1: Assume the following relative frequency table
Transportation Car Public Transit Bicycle Total
Young Adult (18-30) 0.15 0.10 0.05 0.30
Middle Age (31-50) 0.20 0.15 0.05 0.40
Senior (51+) 0.25 0.05 0.00 0.30
Total 0.60 0.30 0.10 1.00
Step 2: Calculate P(Car | Young Adult)

This is the conditional probability of preferring Car given the person is a Young Adult

Formula: P(Car | Young Adult) = P(Car and Young Adult) ÷ P(Young Adult)

P(Car | Young Adult) = 0.15 ÷ 0.30 = 0.50 or 50%

Step 3: Calculate P(Young Adult | Car)

This is the conditional probability of being Young Adult given the person prefers Car

Formula: P(Young Adult | Car) = P(Car and Young Adult) ÷ P(Car)

P(Young Adult | Car) = 0.15 ÷ 0.60 = 0.25 or 25%

Step 4: Interpret the results

P(Car | Young Adult) = 0.50: Of all Young Adults, 50% prefer cars

P(Young Adult | Car) = 0.25: Of all car users, 25% are Young Adults

These probabilities answer different questions and have different values

Step 5: Verify with frequency interpretation

Young Adults who prefer Car: 0.15 × 300 = 45 people

Total Young Adults: 0.30 × 300 = 90 people

45 ÷ 90 = 0.50 ✓

Step 6: Further analysis

Young Adults are equally likely to prefer Car or Public Transit (50% vs 33.3%)

Seniors are most likely to prefer Car (83.3%)

Car is the most popular choice across all age groups

P(Car | Young Adult) = 0.50; P(Young Adult | Car) = 0.25
Final answer:

P(Car | Young Adult) = 0.50 means 50% of young adults prefer cars. P(Young Adult | Car) = 0.25 means 25% of car users are young adults. These probabilities address different questions: the first focuses on young adults' preferences, the second on the age composition of car users.

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)

• Interpretation: The condition determines the denominator

3 Association Analysis
Exercise 3
Using the table from Exercise 2, determine if age group and transportation preference are independent. What does this mean for the relationship between the variables?
Definition:

Independence: Two variables are independent if the occurrence of one doesn't affect the probability of the other.

Association: Two variables are associated if there's a relationship between their values.

Step 1: Recall the relative frequency table
Transportation Car Public Transit Bicycle Total
Young Adult (18-30) 0.15 0.10 0.05 0.30
Middle Age (31-50) 0.20 0.15 0.05 0.40
Senior (51+) 0.25 0.05 0.00 0.30
Total 0.60 0.30 0.10 1.00
Step 2: State the independence condition

Variables are independent if: P(A and B) = P(A) × P(B)

Or equivalently: P(A|B) = P(A)

Step 3: Calculate marginal probabilities

P(Car) = 0.60

P(Young Adult) = 0.30

P(Public Transit) = 0.30

P(Senior) = 0.30

Step 4: Calculate conditional probabilities

P(Car | Young Adult) = 0.15 ÷ 0.30 = 0.50

P(Car | Middle Age) = 0.20 ÷ 0.40 = 0.50

P(Car | Senior) = 0.25 ÷ 0.30 = 0.833

Step 5: Test independence

If independent: P(Car | Young Adult) = P(Car)

Actual: P(Car | Young Adult) = 0.50, P(Car) = 0.60

Since 0.50 ≠ 0.60, the variables are not independent

Step 6: Confirm with joint probability test

If independent: P(Car and Young Adult) = P(Car) × P(Young Adult)

Expected: 0.60 × 0.30 = 0.18

Actual: 0.15 ≠ 0.18

This confirms dependence between age and transportation preference

Variables are dependent; P(Car and Young Adult) = 0.15 ≠ 0.18 (expected under independence)
Final answer:

Age group and transportation preference are not independent. There is a significant association: seniors are more likely to prefer cars (83.3%) compared to young adults (50%) and middle-aged adults (50%). The conditional probabilities vary significantly across age groups, indicating that age influences transportation preference.

Applied rules:

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

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

• Association detection: Significant differences in conditional probabilities

Relative Frequency Concepts and Rules
\text{Relative Frequency} = \frac{\text{Frequency}}{\text{Total Observations}}
Relative Frequency Formula
Joint Rel Freq
Cell value ÷ Grand total
P(A \cap B)
Intersection probability
Marginal Rel Freq
Row/Col total ÷ Grand total
P(A) or P(B)
Individual probability
Conditional Rel Freq
Cell ÷ Marginal total
P(A|B) = P(A \cap B)/P(B)
Within-group probability
Key definitions:

Relative frequency: A proportion or percentage that represents how often an event occurs relative to the total number of observations.

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

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

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

Analysis process:
  1. Convert to relative frequencies: Divide all cell values by grand total
  2. Calculate marginal frequencies: Row and column totals of relative frequencies
  3. Compute conditional frequencies: Divide cell values by relevant marginal totals
  4. Test for independence: Compare conditional to marginal probabilities
  5. Interpret associations: Analyze patterns in conditional frequencies
Tip 1: Always verify that marginal relative frequencies sum to 1.
Tip 2: Conditional probabilities reveal relationships between variables.
Tip 3: Under independence, conditional probabilities equal marginal probabilities.
Tip 4: Convert to percentages for easier interpretation.
Properties of Relative Frequencies: Range from 0 to 1, sum of all joint frequencies equals 1, marginal frequencies represent individual variable distributions.
Independence Properties: P(A|B) = P(A), P(B|A) = P(B), P(A ∩ B) = P(A) × P(B).
Key relationships:

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

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

• Independence indicator: Large differences between conditional and marginal probabilities suggest association

Solution: Exercises 4 to 5
4 Transformations of Relative Frequencies
Exercise 4
If we double the number of observations in each cell of a relative frequency table, how do the relative frequencies change? What if we add 10 to each frequency before converting to relative frequencies?
Definition:

Proportional transformation: Multiplying all frequencies by the same constant.

Non-proportional transformation: Adding a constant to all frequencies before conversion.

Step 1: Consider the effect of doubling all frequencies

Original relative frequency: f/n

After doubling: (2f)/(2n) = f/n

Relative frequencies remain unchanged under proportional scaling

Step 2: Analyze adding a constant to each cell

Original relative frequency: f/n

After adding 10: (f+10)/(n+k) where k is the total added to all cells

Relative frequencies change because the transformation is not proportional

Step 3: Demonstrate with example

Original table: A=10, B=20, Total=30 → Rel freq A=0.333, B=0.667

After doubling: A=20, B=40, Total=60 → Rel freq A=0.333, B=0.667 (unchanged)

After adding 5: A=15, B=25, Total=40 → Rel freq A=0.375, B=0.625 (changed)

Step 4: Generalize the principle

Proportional transformations (multiplying by c) preserve relative frequencies

Non-proportional transformations change relative frequencies

Step 5: Apply to practical scenarios

This explains why sample size doesn't affect relative frequencies

But combining different samples changes the relative frequencies

Proportional scaling: No change; Non-proportional: Changes relative frequencies
Final answer:

When all frequencies are doubled, relative frequencies remain unchanged because the ratios stay the same. When a constant is added to each cell before conversion, relative frequencies change because the transformation is not proportional. This demonstrates that relative frequencies are preserved under proportional scaling but not under non-proportional transformations.

Applied rules:

• Proportional scaling: Relative frequencies invariant under multiplication by constant

• Non-proportional scaling: Changes relative frequency distribution

• Ratio preservation: f/n = (cf)/(cn) for any constant c

5 Real-World Application
Exercise 5
A marketing firm surveyed 1000 customers about product satisfaction (Satisfied/Neutral/Dissatisfied) and purchase history (New/Loyal). The relative frequency table shows: Satisfied-New=0.15, Satisfied-Loyal=0.45, Neutral-New=0.10, Neutral-Loyal=0.15, Dissatisfied-New=0.10, Dissatisfied-Loyal=0.05. Analyze the relationship between customer loyalty and satisfaction.
Definition:

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

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

Step 1: Organize the data into a table
Satisfaction New Customer Loyal Customer Total
Satisfied 0.15 0.45 0.60
Neutral 0.10 0.15 0.25
Dissatisfied 0.10 0.05 0.15
Total 0.35 0.65 1.00
Step 2: Calculate conditional probabilities by loyalty status

For New Customers: P(Satisfied) = 0.15/0.35 = 0.429, P(Neutral) = 0.10/0.35 = 0.286, P(Dissatisfied) = 0.10/0.35 = 0.286

For Loyal Customers: P(Satisfied) = 0.45/0.65 = 0.692, P(Neutral) = 0.15/0.65 = 0.231, P(Dissatisfied) = 0.05/0.65 = 0.077

Step 3: Calculate conditional probabilities by satisfaction level

For Satisfied: P(New) = 0.15/0.60 = 0.25, P(Loyal) = 0.45/0.60 = 0.75

For Neutral: P(New) = 0.10/0.25 = 0.40, P(Loyal) = 0.15/0.25 = 0.60

For Dissatisfied: P(New) = 0.10/0.15 = 0.667, P(Loyal) = 0.05/0.15 = 0.333

Step 4: Test for independence

If independent: P(Satisfied | New) = P(Satisfied)

Actual: P(Satisfied | New) = 0.429, P(Satisfied) = 0.60

Since 0.429 ≠ 0.60, variables are dependent

Step 5: Interpret the findings

Loyal customers are more satisfied (69.2%) than new customers (42.9%)

Dissatisfied customers are more likely to be new (66.7%) than loyal (33.3%)

There's a strong positive association between loyalty and satisfaction

Strong positive association: Loyal customers much more satisfied (69.2% vs 42.9%)
Final answer:

There is a strong positive association between customer loyalty and satisfaction. Loyal customers are significantly more satisfied (69.2%) than new customers (42.9%). Conversely, dissatisfied customers are disproportionately new (66.7% of dissatisfied customers are new). This suggests that satisfaction drives loyalty, or that loyal customers develop higher satisfaction over time.

Applied rules:

• Association detection: Compare conditional to marginal probabilities

• Business insight: Identify patterns for strategic decisions

• Dependency confirmation: Conditional probabilities differ from marginal

Comprehensive Guide to Relative Frequency Tables
P(A|B) = \frac{P(A \cap B)}{P(B)}
Conditional Probability Formula
Key definitions:

Relative frequency: The ratio of the number of times an event occurs to the total number of observations.

Joint relative frequency: The proportion of observations that belong to a specific combination of categories.

Marginal relative frequency: The proportion of observations that belong to a specific category of one variable, regardless of the other variable.

Conditional relative frequency: The proportion of observations in a specific category of one variable given that another variable has a specific value.

Independence: Two variables are independent if the conditional relative frequency equals the marginal relative frequency.

Analysis process:
  1. Convert to relative frequencies: Divide each cell by the grand total
  2. Calculate marginal frequencies: Sum rows and columns
  3. Compute conditional frequencies: Divide by relevant marginal totals
  4. Test independence: Compare conditional to marginal frequencies
  5. Draw conclusions: Interpret the relationships found
Tip 1: Always verify that all marginal frequencies sum to 1.
Tip 2: Conditional probabilities reveal the strength of association between variables.
Tip 3: Under independence, P(A|B) = P(A) for all combinations.
Tip 4: Convert to percentages for easier interpretation of relative magnitudes.
Tip 5: Large differences between conditional and marginal probabilities indicate strong association.
Tip 6: Conditional probabilities in each row/column sum to 1.
Relative Frequency Properties: Range from 0 to 1, sum of all joint frequencies equals 1, marginal frequencies represent individual variable distributions, conditional frequencies reveal associations between variables.
Independence Properties: P(A|B) = P(A), P(B|A) = P(B), P(A ∩ B) = P(A) × P(B), conditional frequencies equal marginal frequencies.
Association Indicators: Large differences between conditional and marginal probabilities, non-uniform conditional distributions, P(A|B) ≠ P(A).
Mathematical relationships:

• Joint = Marginal × Conditional: P(A ∩ B) = P(A) × P(B|A)

• 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)

Relative Frequency Analysis Visualization
Understanding Relative Frequency Tables
Key characteristics of relative frequency analysis:
Joint frequencies: Proportion in specific cell
Marginal frequencies: Proportion for row/column
Conditional frequencies: Proportion within group
Independence: No association between variables
Association: Relationship between categorical variables

Analysis: Relative frequency tables convert raw counts to proportions, enabling comparison across different sample sizes.

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

Questions & Answers

Question: Why do we use relative frequencies instead of raw counts in contingency tables? What's the advantage?

Answer: Relative frequencies offer several key advantages:

  • Comparison across different sample sizes: Allows comparison between studies with different numbers of participants
  • Standardized scale: Values range from 0 to 1 (or 0% to 100%), making interpretation consistent
  • Probability interpretation: Relative frequencies approximate probabilities in the population
  • Pattern recognition: Easier to see relationships and associations in the data

Example: If Study A surveys 100 people and finds 20 prefer Product A, and Study B surveys 1000 people and finds 200 prefer Product A, the relative frequency (0.20) is the same in both cases, revealing the same underlying preference rate.

Question: How do I know if two categorical variables are independent using relative frequency tables?

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 similar across categories

Independence indicators:

  • Conditional probabilities equal marginal probabilities
  • Conditional distributions are uniform across groups
  • Small differences between observed and expected frequencies

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

Question: What's the difference between row percentages and column percentages in a relative frequency table?

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))

Example: In a table of Grade Level vs Subject Preference:

  • Row percentage: "Of all Freshmen, what % prefer Math?"
  • Column percentage: "Of all Math lovers, what % are Freshmen?"

Choose based on your research question: use row percentages when comparing across categories of the row variable, column percentages when comparing across categories of the column variable.

Question: Can I use relative frequency tables for quantitative variables?

Answer: Relative frequency 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 relative frequency 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.