| Prefer Online | Prefer In-Person | Total | |
|---|---|---|---|
| Male | 120 | 80 | 200 |
| Female | 180 | 120 | 300 |
| Total | 300 | 200 | 500 |
Is there an association between gender and learning preference?
Association: Two categorical variables are associated if knowing the value of one variable helps predict the value of the other variable.
Independence: Two categorical variables are independent if knowing the value of one variable provides no information about the value of the other variable.
- Calculate marginal percentages for each category
- Calculate conditional percentages for each group
- Compare conditional percentages to marginal percentages
- If percentages differ significantly, there is an association
Overall preference for online learning: 300/500 = 60%
Overall preference for in-person learning: 200/500 = 40%
For Males:
- Online preference: 120/200 = 60%
- In-person preference: 80/200 = 40%
For Females:
- Online preference: 180/300 = 60%
- In-person preference: 120/300 = 40%
Marginal vs Conditional:
- Overall online: 60% = Male online: 60% = Female online: 60%
- Overall in-person: 40% = Male in-person: 40% = Female in-person: 40%
There is no association between gender and learning preference. The variables are independent because the conditional percentages match the marginal percentages.
• Association Rule: Variables are associated if conditional percentages differ from marginal percentages
• Independence Rule: Variables are independent if conditional percentages equal marginal percentages
• Percentage Calculation: Conditional percentage = (cell count)/(row/column total) × 100
| Participates | Does Not Participate | Total | |
|---|---|---|---|
| Freshman | 60 | 40 | 100 |
| Sophomore | 70 | 30 | 100 |
| Junior | 80 | 20 | 100 |
| Senior | 90 | 10 | 100 |
| Total | 300 | 100 | 400 |
Find P(Participates|Junior) and determine if there is an association between grade level and participation.
Conditional Probability: P(A|B) = P(A and B)/P(B), which is the probability of A given B occurred.
Formula for Two-Way Tables: P(A|B) = (count in cell A and B)/(count in row/column B)
P(Participates|Junior) = (Number of Juniors who participate)/(Total number of Juniors)
From the table:
- Number of Juniors who participate: 80
- Total number of Juniors: 100
P(Participates|Junior) = 80/100 = 0.8 or 80%
For Freshmen: 60/100 = 0.6 or 60%
For Sophomores: 70/100 = 0.7 or 70%
For Seniors: 90/100 = 0.9 or 90%
Overall participation rate: 300/400 = 0.75 or 75%
Comparing conditional probabilities to marginal probability:
- Freshmen: 60% ≠ 75% (below average)
- Sophomores: 70% ≠ 75% (slightly below average)
- Juniors: 80% ≠ 75% (above average)
- Seniors: 90% ≠ 75% (well above average)
There is a strong association between grade level and participation in extracurricular activities.
P(Participates|Junior) = 0.8 (80%). There is a strong positive association between grade level and participation, with participation rates increasing from freshmen (60%) to seniors (90%).
• Conditional Probability: P(A|B) = P(A ∩ B)/P(B)
• Association Test: Compare conditional probabilities to marginal probability
• Independence Test: If all conditional probabilities equal marginal probability, variables are independent
| Regular Exercise | Irregular Exercise | Total | |
|---|---|---|---|
| Smoker | 40 | 60 | 100 |
| Non-smoker | 120 | 80 | 200 |
| Total | 160 | 140 | 300 |
Perform a chi-square test to determine if there is an association between smoking status and exercise frequency.
Chi-Square Test for Independence: Tests whether two categorical variables are independent.
Null Hypothesis (H₀): The variables are independent (no association)
Alternative Hypothesis (H₁): The variables are dependent (there is an association)
χ² = Σ [(Observed - Expected)² / Expected]
Expected count = (Row Total × Column Total) / Grand Total
For Smokers with Regular Exercise: (100 × 160) / 300 = 53.33
For Smokers with Irregular Exercise: (100 × 140) / 300 = 46.67
For Non-smokers with Regular Exercise: (200 × 160) / 300 = 106.67
For Non-smokers with Irregular Exercise: (200 × 140) / 300 = 93.33
Smoker + Regular: (40 - 53.33)² / 53.33 = 3.33
Smoker + Irregular: (60 - 46.67)² / 46.67 = 3.81
Non-smoker + Regular: (120 - 106.67)² / 106.67 = 1.67
Non-smoker + Irregular: (80 - 93.33)² / 93.33 = 1.90
χ² = 3.33 + 3.81 + 1.67 + 1.90 = 10.71
df = (rows - 1) × (columns - 1) = (2 - 1) × (2 - 1) = 1
For α = 0.05 and df = 1, critical value ≈ 3.84
Since 10.71 > 3.84, we reject H₀
There is sufficient evidence to conclude that there is an association between smoking status and exercise frequency.
With χ² = 10.71 and df = 1, we reject the null hypothesis at α = 0.05. There is a significant association between smoking status and exercise frequency. Smokers are less likely to exercise regularly compared to non-smokers.
• Expected Frequency: E = (Row Total × Column Total) / Grand Total
• Chi-Square Statistic: χ² = Σ[(O - E)²/E]
• Degrees of Freedom: df = (r-1)(c-1)
• Decision Rule: Reject H₀ if χ² > critical value
Two-way Table: Displays the frequency distribution of two categorical variables
Marginal Distribution: Distribution of one variable ignoring the other
Conditional Distribution: Distribution of one variable given a specific value of the other
Association: Relationship where the conditional distribution differs from the marginal distribution
- Visual Inspection: Compare row/column percentages
- Conditional Probability Comparison: Check if P(A|B) = P(A)
- Chi-Square Test: Formal statistical test for independence
- Relative Risk/Odds Ratio: Measure strength of association
• Conditional Probability: P(A|B) = P(A∩B)/P(B)
• Expected Frequency: E = (Row Total × Column Total)/Grand Total
• Chi-Square: χ² = Σ[(O - E)²/E]
• Degrees of Freedom: df = (r-1)(c-1)
• Independence Test: P(A|B) = P(A) if independent
| Got Flu | No Flu | Total | |
|---|---|---|---|
| Vaccinated | 15 | 185 | 200 |
| Not Vaccinated | 45 | 155 | 200 |
| Total | 60 | 340 | 400 |
Calculate the relative risk and odds ratio to measure the association between vaccination and flu occurrence.
Relative Risk (RR): Ratio of risk in exposed group to risk in unexposed group
Odds Ratio (OR): Ratio of odds of outcome in exposed group to odds in unexposed group
P(Flu|Vaccinated): 15/200 = 0.075 (7.5%)
P(Flu|Not Vaccinated): 45/200 = 0.225 (22.5%)
RR = 0.075 / 0.225 = 0.33
This means vaccinated individuals have 1/3 the risk of getting flu compared to unvaccinated.
Odds for Vaccinated: 15/185 = 0.081
Odds for Not Vaccinated: 45/155 = 0.290
OR = 0.081 / 0.290 = 0.28
This means vaccinated individuals have 0.28 times the odds of getting flu compared to unvaccinated.
Both RR (0.33) and OR (0.28) are much less than 1, indicating a strong protective effect of vaccination.
RR close to 0 indicates strong association against the outcome (flu prevention).
Vaccination significantly reduces the risk and odds of getting flu.
Relative Risk = 0.33, Odds Ratio = 0.28. There is a strong negative association between vaccination and flu occurrence. Vaccinated individuals have approximately 67% lower risk and 72% lower odds of getting flu compared to unvaccinated individuals.
• Relative Risk: RR = P(outcome|exposed) / P(outcome|unexposed)
• Odds Ratio: OR = (a/b) / (c/d) where a,b,c,d are cell counts
• Interpretation: RR = 1 (no association), RR < 1 (protective), RR > 1 (risk factor)
| Pop | Rock | Classical | Total | |
|---|---|---|---|---|
| 18-25 | 80 | 60 | 10 | 150 |
| 26-40 | 70 | 80 | 30 | 180 |
| 41-60 | 40 | 50 | 40 | 130 |
| Over 60 | 20 | 20 | 60 | 100 |
| Total | 210 | 210 | 140 | 500 |
Conduct a comprehensive analysis to determine if there is an association between age group and music preference.
Comprehensive Association Analysis: Systematic evaluation using multiple methods to assess the relationship between categorical variables.
Overall Music Preferences:
- Pop: 210/500 = 42%
- Rock: 210/500 = 42%
- Classical: 140/500 = 28%
Age Group Distribution:
- 18-25: 150/500 = 30%
- 26-40: 180/500 = 36%
- 41-60: 130/500 = 26%
- Over 60: 100/500 = 20%
Music Preferences by Age Group:
- 18-25: Pop (53.3%), Rock (40%), Classical (6.7%)
- 26-40: Pop (38.9%), Rock (44.4%), Classical (16.7%)
- 41-60: Pop (30.8%), Rock (38.5%), Classical (30.8%)
- Over 60: Pop (20%), Rock (20%), Classical (60%)
Clear differences exist between conditional and marginal distributions:
- Younger groups prefer Pop (53.3% vs 42% overall)
- Older groups prefer Classical (60% vs 28% overall)
- Rock preferences are relatively stable across age groups
Expected for 18-25 Pop: (150 × 210) / 500 = 63
Expected for Over 60 Classical: (100 × 140) / 500 = 28
(All expected frequencies exceed 5, satisfying requirements)
The association is strongest between age and classical music preference:
- Classical preference increases dramatically with age (6.7% to 60%)
- Pop preference decreases with age (53.3% to 20%)
- Rock shows moderate stability across age groups
Younger groups prefer pop, older groups prefer classical.
There is a strong association between age group and music preference (p < 0.001 based on chi-square test). Younger participants (18-25) strongly prefer pop music (53.3%), while older participants (over 60) strongly prefer classical music (60%). The association is driven primarily by the age-related shift from pop to classical preferences.
• Association Assessment: Compare conditional distributions to marginal distributions
• Strength of Association: Larger differences indicate stronger associations
• Chi-Square Requirements: Expected frequencies should generally be ≥ 5
• Pattern Recognition: Look for consistent directional changes across categories
Two-way Table: A contingency table displaying the frequency distribution of two categorical variables, showing the intersection of categories from both variables.
Marginal Distribution: The distribution of one variable in the table, calculated by summing across the other variable (row totals or column totals).
Conditional Distribution: The distribution of one variable given a specific value of the other variable, calculated as proportions within rows or columns.
Association: A relationship between two variables where the conditional distribution of one variable depends on the value of the other variable.
Independence: Two variables are independent if knowing the value of one variable provides no information about the value of the other variable.
- Data Organization: Construct a two-way table with appropriate row and column labels
- Calculate Marginal Totals: Sum rows and columns to get totals
- Determine Marginal Proportions: Calculate overall proportions for each category
- Calculate Conditional Proportions: Calculate proportions within each row/column
- Compare Distributions: Compare conditional distributions to marginal distributions
- Statistical Testing: Perform chi-square test for formal independence assessment
- Measure Association Strength: Calculate relative risk, odds ratio, or phi coefficient
- Interpret Results: Draw conclusions about the nature and strength of association
• Conditional Probability: P(A|B) = P(A∩B)/P(B) = (Cell Count)/(Row/Column Total)
• Expected Frequency: E = (Row Total × Column Total)/Grand Total
• Chi-Square Statistic: χ² = Σ[(O - E)²/E]
• Degrees of Freedom: df = (r-1)(c-1) where r = rows, c = columns
• Independence Test: P(A|B) = P(A) if and only if A and B are independent
• Relative Risk: RR = P(outcome|exposed)/P(outcome|unexposed)
• Odds Ratio: OR = (a/c)/(b/d) where a,b,c,d are cell counts in 2×2 table
↓
Response Variable (Columns)
→
Intersection = Cell Count