Solved Exercises on Conditional Relative Frequencies

Master conditional relative frequencies: understanding and calculating proportions within specific groups through these 5 detailed exercises covering interpretation, analysis, and application of conditional probability in contingency tables.

Solution: Exercises 1 to 3
1 Basic Conditional Relative Frequency
Exercise 1
A survey of 200 students asked about their favorite subject and grade level. The results show: 40 Freshmen prefer Math, 30 prefer English, 10 prefer Science; 50 Sophomores prefer Math, 40 prefer English, 30 prefer Science. Calculate the conditional relative frequency of preferring Math given that a student is a Sophomore.
Definition:

Conditional relative frequency: The proportion of observations that satisfy a specific condition, calculated as: (Number in specific cell) ÷ (Relevant marginal total).

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

Joint frequency: The count of observations in a specific cell of the table.

Calculation method:
  1. Identify the specific condition (given variable)
  2. Locate the relevant cell in the table
  3. Find the marginal total for the condition
  4. Divide the cell frequency by the marginal total
  5. Express as a decimal or percentage
Step 1: Create the contingency table
Subject Math English Science Total
Freshman 40 30 10 80
Sophomore 50 40 30 120
Total 90 70 40 200
Step 2: Identify the condition and relevant values

Condition: Student is a Sophomore

Relevant marginal total: Total Sophomores = 120

Specific outcome: Sophomore who prefers Math = 50

Step 3: Apply the conditional relative frequency formula

P(Math | Sophomore) = (Number of Sophomores who prefer Math) ÷ (Total number of Sophomores)

P(Math | Sophomore) = 50 ÷ 120 = 0.417 or 41.7%

Step 4: Verify the calculation

50 ÷ 120 = 0.41666... ≈ 0.417

0.417 × 100% = 41.7%

Step 5: Interpret the result

Of all Sophomores surveyed, 41.7% prefer Math

This is the conditional probability of preferring Math given Sophomore status

P(Math | Sophomore) = 0.417 or 41.7%
Final answer:

The conditional relative frequency of preferring Math given that a student is a Sophomore is 0.417 or 41.7%. This means that 41.7% of Sophomores prefer Math as their favorite subject.

Applied rules:

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

• Relative frequency: Frequency ÷ Total relevant observations

• Condition: Denominator is the marginal total for the given condition

2 Comparing Conditional Frequencies
Exercise 2
Using the same table from Exercise 1, calculate the conditional relative frequency of being a Sophomore given that a student prefers Math. Compare this to the result from Exercise 1.
Definition:

Reverse conditional: P(B|A) instead of P(A|B), where the condition and outcome are swapped.

Asymmetry: Generally P(A|B) ≠ P(B|A).

Step 1: Recall the contingency table
Subject Math English Science Total
Freshman 40 30 10 80
Sophomore 50 40 30 120
Total 90 70 40 200
Step 2: Identify the new condition and outcome

New condition: Student prefers Math

Relevant marginal total: Total Math lovers = 90

Specific outcome: Math lover who is Sophomore = 50

Step 3: Calculate P(Sophomore | Math)

P(Sophomore | Math) = (Number of Sophomores who prefer Math) ÷ (Total number who prefer Math)

P(Sophomore | Math) = 50 ÷ 90 = 0.556 or 55.6%

Step 4: Compare with Exercise 1 result

P(Math | Sophomore) = 50 ÷ 120 = 0.417 (41.7%)

P(Sophomore | Math) = 50 ÷ 90 = 0.556 (55.6%)

These are different because the denominators are different

Step 5: Interpret the comparison

Of all Sophomores, 41.7% prefer Math

Of all Math lovers, 55.6% are Sophomores

These answer different questions about the relationship between variables

P(Sophomore | Math) = 0.556; P(Math | Sophomore) = 0.417; Different denominators yield different results
Final answer:

P(Sophomore | Math) = 0.556 or 55.6%. This is different from P(Math | Sophomore) = 0.417. The first asks "What percentage of Math students are Sophomores?" while the second asks "What percentage of Sophomores prefer Math?" The different denominators (90 vs 120) result in different conditional probabilities.

Applied rules:

• Asymmetry: P(A|B) ≠ P(B|A) in general

• Denominator matters: Condition determines which marginal total to use

• Interpretation: Different questions yield different answers

3 Conditional Frequencies by Row vs Column
Exercise 3
Calculate all conditional relative frequencies for the table from Exercise 1 by grade level (row percentages) and by subject (column percentages). What patterns do you notice?
Definition:

Row percentages: Conditional frequencies calculated using row totals as denominators.

Column percentages: Conditional frequencies calculated using column totals as denominators.

Step 1: Calculate row percentages (by grade level)

For Freshmen:

P(Math | Freshman) = 40 ÷ 80 = 0.50 or 50%

P(English | Freshman) = 30 ÷ 80 = 0.375 or 37.5%

P(Science | Freshman) = 10 ÷ 80 = 0.125 or 12.5%

Step 2: Calculate remaining row percentages

For Sophomores:

P(Math | Sophomore) = 50 ÷ 120 = 0.417 or 41.7%

P(English | Sophomore) = 40 ÷ 120 = 0.333 or 33.3%

P(Science | Sophomore) = 30 ÷ 120 = 0.25 or 25%

Step 3: Calculate column percentages (by subject)

For Math:

P(Freshman | Math) = 40 ÷ 90 = 0.444 or 44.4%

P(Sophomore | Math) = 50 ÷ 90 = 0.556 or 55.6%

Step 4: Calculate remaining column percentages

For English:

P(Freshman | English) = 30 ÷ 70 = 0.429 or 42.9%

P(Sophomore | English) = 40 ÷ 70 = 0.571 or 57.1%

For Science:

P(Freshman | Science) = 10 ÷ 40 = 0.25 or 25%

P(Sophomore | Science) = 30 ÷ 40 = 0.75 or 75%

Step 5: Identify patterns

Row percentages: Within each grade, compare subject preferences

Column percentages: Within each subject, compare grade level distribution

Notice: Freshmen show stronger preference for Math (50%) than Sophomores (41.7%)

Row %: Freshmen(50% Math, 37.5% Eng, 12.5% Sci); Sophomores(41.7% Math, 33.3% Eng, 25% Sci); Column %: Math(44.4% Fr, 55.6% So), etc.
Final answer:

Row percentages show grade-level preferences: Freshmen prefer Math (50%) over English (37.5%) over Science (12.5%), while Sophomores show more balanced preferences. Column percentages show subject-level grade distribution: Math attracts more Sophomores (55.6%), while Science attracts more Sophomores (75%) than Freshmen (25%). The row percentages reveal grade-level preferences, while column percentages reveal subject popularity by grade.

Applied rules:

• Row percentages: Answer "What percentage of group A prefers each option?"

• Column percentages: Answer "What percentage of option A comes from each group?"

• Sum property: Conditional percentages in each row/column sum to 100%

Conditional Relative Frequency Framework
P(A|B) = \frac{P(A \cap B)}{P(B)} = \frac{\text{Joint frequency}}{\text{Marginal frequency}}
Conditional Probability Formula
Row %
P(Subject|Grade)
Divide by Row Total
Grade preferences
Column %
P(Grade|Subject)
Divide by Col Total
Subject popularity
Joint %
P(Grade \cap Subject)
Divide by Grand Total
Overall combination
Key definitions:

Conditional relative frequency: The proportion of observations that satisfy a condition, calculated as cell frequency divided by relevant marginal frequency.

Joint relative frequency: The proportion of observations in a specific cell, calculated as cell frequency divided by grand total.

Marginal relative frequency: The proportion of observations for each category, calculated as row or column total divided by grand total.

Calculation process:
  1. Identify condition: Determine which variable is the given condition
  2. Locate relevant cell: Find the intersection of condition and outcome
  3. Find denominator: Use the marginal total for the condition variable
  4. Divide: Cell frequency ÷ Marginal frequency
  5. Interpret: Express as percentage of the condition group
Tip 1: Always identify the condition first before calculating.
Tip 2: Row percentages show preferences within groups.
Tip 3: Column percentages show group composition within categories.
Tip 4: Conditional frequencies sum to 1 within each condition group.
Properties: Always between 0 and 1, sum to 1 within each condition group, reveal associations between variables.
Applications: Risk assessment, probability prediction, association analysis, decision making.
Key relationships:

• Row conditional: Divide by row total to see within-group preferences

• Column conditional: Divide by column total to see group composition

• Independence: If P(A|B) = P(A), variables are independent

• Sum property: Conditional frequencies in each group sum to 1

Solution: Exercises 4 to 5
4 Detecting Association
Exercise 4
A study of 300 people found: 80 coffee drinkers prefer morning exercise, 40 prefer evening exercise; 60 non-coffee drinkers prefer morning exercise, 120 prefer evening exercise. Calculate conditional frequencies and determine if there's an association between coffee drinking and exercise timing.
Definition:

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

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

Step 1: Create the contingency table
Exercise Time Morning Evening Total
Coffee Drinkers 80 40 120
Non-Coffee Drinkers 60 120 180
Total 140 160 300
Step 2: Calculate row conditional frequencies

For Coffee Drinkers:

P(Morning | Coffee) = 80 ÷ 120 = 0.667 or 66.7%

P(Evening | Coffee) = 40 ÷ 120 = 0.333 or 33.3%

Step 3: Calculate conditional frequencies for non-drinkers

For Non-Coffee Drinkers:

P(Morning | No Coffee) = 60 ÷ 180 = 0.333 or 33.3%

P(Evening | No Coffee) = 120 ÷ 180 = 0.667 or 66.7%

Step 4: Calculate marginal probabilities

P(Morning) = 140 ÷ 300 = 0.467 or 46.7%

P(Evening) = 160 ÷ 300 = 0.533 or 53.3%

Step 5: Compare conditional to marginal probabilities

Coffee drinkers: 66.7% prefer morning (vs 46.7% overall)

Non-drinkers: 33.3% prefer morning (vs 46.7% overall)

Large difference indicates association

Strong association: Coffee drinkers (66.7% morning) vs Non-drinkers (33.3% morning)
Final answer:

There is a strong association between coffee drinking and exercise timing. Coffee drinkers are much more likely to prefer morning exercise (66.7%) compared to non-drinkers (33.3%). The conditional probabilities differ significantly from the marginal probabilities, indicating dependence between variables.

Applied rules:

• Association detection: Compare conditional to marginal probabilities

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

• Pattern recognition: Large differences indicate strong association

5 Real-World Application
Exercise 5
A hospital analyzed patient recovery rates by treatment method: Method A: 120 patients recovered, 30 didn't; Method B: 80 patients recovered, 70 didn't. Calculate the conditional probability of recovery for each method. Which method appears more effective?
Definition:

Medical effectiveness: Using conditional probabilities to assess treatment success rates.

Recovery probability: P(Recovery | Treatment Method).

Step 1: Organize the data into a table
Outcome Recovered Did Not Recover Total
Method A 120 30 150
Method B 80 70 150
Total 200 100 300
Step 2: Calculate recovery probability for Method A

P(Recovery | Method A) = 120 ÷ 150 = 0.80 or 80%

Step 3: Calculate recovery probability for Method B

P(Recovery | Method B) = 80 ÷ 150 = 0.533 or 53.3%

Step 4: Calculate overall recovery probability

P(Recovery) = 200 ÷ 300 = 0.667 or 66.7%

Step 5: Compare the methods

Method A: 80% recovery rate

Method B: 53.3% recovery rate

Method A has a 26.7 percentage point advantage

Step 6: Interpret the findings

Method A is significantly more effective than Method B

Patients receiving Method A are 1.5 times more likely to recover

The difference is substantial (80% vs 53.3%)

Method A: 80% recovery; Method B: 53.3% recovery; Method A is superior
Final answer:

Method A has a higher recovery probability (80%) compared to Method B (53.3%). Method A appears significantly more effective, with a 26.7 percentage point advantage. Based on conditional probabilities, Method A is the better choice for patient treatment.

Applied rules:

• Effectiveness measure: P(Positive outcome | Treatment)

• Comparison: Compare conditional probabilities directly

• Decision making: Choose treatment with higher success probability

Comprehensive Guide to Conditional Relative Frequencies
P(A|B) = \frac{P(A \cap B)}{P(B)} = \frac{\text{Count of } (A \cap B)}{\text{Count of } B}
Conditional Probability Formula
Key definitions:

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

Two-way table: A table showing 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.

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

Calculation process:
  1. Construct table: Create a two-way table with joint and marginal frequencies
  2. Identify condition: Determine which variable is the given condition
  3. Locate cell: Find the intersection of condition and outcome
  4. Find denominator: Use the marginal total for the condition variable
  5. Divide: Calculate cell frequency ÷ marginal frequency
  6. Interpret: Express as a percentage of the condition group
Tip 1: Always identify the "given" variable first to determine the denominator.
Tip 2: Row percentages show preferences within groups; column percentages show composition.
Tip 3: Conditional frequencies sum to 1 within each condition group.
Tip 4: Compare conditional to marginal to detect associations.
Tip 5: Express as percentages for easier interpretation.
Tip 6: Use conditional frequencies to make informed decisions.
Properties: Always between 0 and 1, sum to 1 within each condition group, reveal relationships between variables.
Applications: Risk assessment, medical effectiveness, market research, educational outcomes, decision making.
Interpretation: Answer "Of those in group B, what percentage are in group A?"
Key relationships:

• Row conditional: P(Outcome | Group) = Cell ÷ Row Total

• Column conditional: P(Group | Outcome) = Cell ÷ Column Total

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

• Association: P(A|B) ≠ P(A) indicates relationship between variables

Conditional Probability Visualization
Understanding Conditional Relative Frequencies
Key characteristics of conditional relative frequencies:
Conditional probability: Probability given a specific condition
Row percentages: Show preferences within groups
Column percentages: Show composition within categories
Association detection: Compare conditional to marginal probabilities
Independence: Conditional equals marginal probability

Analysis: Conditional relative frequencies reveal relationships between categorical variables by showing how probabilities change under specific conditions.

  • Conditional probability: P(A|B) = P(A ∩ B) ÷ P(B)
  • Row percentages: Compare outcomes within groups
  • Column percentages: Compare groups within outcomes
  • Association: Large differences indicate relationship
  • Independence: Equal conditional and marginal probabilities

Questions & Answers

Question: How do I know whether to use row percentages or column percentages when analyzing a two-way table?

Answer: The choice depends on your research question:

  • Use row percentages when: You want to compare the distribution of the column variable within each row category. Question: "What percentage of Group A prefers each option?"
  • Use column percentages when: You want to compare the distribution of the row variable within each column category. Question: "What percentage of Option A comes from each group?"

Examples:

  • For comparing grade-level preferences: Use row percentages
  • For comparing group composition by preference: Use column percentages

Choose the conditioning variable based on what you want to analyze: if you're focusing on how groups differ in preferences, use row percentages. If you're focusing on how groups contribute to each category, use column percentages.

Question: What does it mean if P(A|B) is much larger than P(A)? How do I interpret this difference?

Answer: When P(A|B) > P(A), there's a positive association between A and B:

  • Positive association: Knowing B occurred makes A more likely
  • Strength of association: The larger the difference, the stronger the relationship
  • Relative risk: P(A|B) ÷ P(A) shows how much more likely A is given B

Example: If P(Cancer | Smoker) = 0.15 and P(Cancer) = 0.05, then smokers are 3 times more likely to develop cancer (0.15 ÷ 0.05 = 3).

This indicates a strong positive association between smoking and cancer risk. The conditional probability being three times higher than the marginal probability shows a significant relationship.

Question: Can conditional relative frequencies be used to prove causation between variables?

Answer: No, conditional relative frequencies cannot prove causation:

  • Association vs Causation: Conditional frequencies only show association, not cause-and-effect
  • Confounding variables: A third variable might explain the association
  • Direction of causation: Cannot determine which variable causes the other

Example: Finding that ice cream sales are associated with drowning deaths doesn't mean ice cream causes drowning. Both might be related to hot weather.

Conditional frequencies can suggest hypotheses for further investigation, but establishing causation requires controlled experiments or more sophisticated statistical methods that account for confounding variables.

Question: How do I calculate conditional relative frequencies when the table has more than 2 categories for each variable?

Answer: The process remains the same regardless of the number of categories:

  • Identify the condition: Determine which variable is given
  • Find the marginal total: Use the appropriate row or column total
  • Divide each cell by the marginal total: For each category of the outcome variable
  • Repeat for each condition: Calculate for all categories of the conditioning variable

Example: For a table with 3 rows and 4 columns, to find P(Outcome | Row 1), divide each of the 4 cells in Row 1 by the Row 1 total. This gives 4 conditional probabilities that sum to 1.

The key principle is that within each conditioning group, the conditional probabilities must sum to 1.

Question: What's the relationship between conditional relative frequencies and statistical independence?

Answer: Independence is defined in terms of conditional probabilities:

  • Independence condition: P(A|B) = P(A) for all combinations
  • Equivalent condition: P(B|A) = P(B) for all combinations
  • Joint probability: P(A ∩ B) = P(A) × P(B)

Testing independence:

  • Calculate conditional frequencies
  • Compare to marginal frequencies
  • If they're approximately equal, variables may be independent
  • Large differences indicate dependence

In practice, exact equality rarely occurs due to sampling variation, so statistical tests are used to determine if observed differences are significant.