outcome: the continuous variable being compared across groups.
2
grouping: the categorical variable defining the groups (must have at least 2 levels).
3
alpha: the significance level; default is 0.05.
Example 1
Okonkwo catches you between meetings: “Officers in Northgate keep grumbling that their commute is worse than everyone else’s. Before I approve any relocation stipends, I want to know if commute time actually differs across our four districts.”
district
commute_minutes
Meadowbrook
31.7
Meadowbrook
28.7
Meadowbrook
34.0
We will use the commute_times dataset to answer the following question:
Does commute time differ across the four districts?
Example 1
Does commute time differ across the four districts?
How do we translate this into hypotheses?
No direction or hypothesized value.
We need to enumerate the number of means expressed in H_0.
One-way ANOVA
Source df SS MS F p-value
─────────────────────────────────────────────
district 3 120.0100 40.0033 0.780 0.507
Residuals 116 5945.7900 51.2568
─────────────────────────────────────────────
Hypotheses (district):
H₀: All group means are equal (no effect of district)
H₁: At least one group mean differs (effect of district exists)
Test statistic: F(3, 116) = 0.78
p-value: 0.507
Conclusion: Fail to reject the null hypothesis (p = 0.507 ≥ α = 0.050)
Fail to reject H_0. There is not sufficient evidence to suggest that there is a difference in commute times between the districts.
Example 2
Okonkwo swings by your desk: “We just finished processing assessment scores for the incoming class. This cycle, recruits went through training at three different academies: Meadowbrook, Coldharbor, and Northgate. Command wants to know if it matters which academy a recruit trains at. Are scores different across the three?”
academy
score
Meadowbrook
68.9
Meadowbrook
87.8
Meadowbrook
65.3
We will use the academy_scores dataset to answer the following question:
Do assessment scores differ across the three training academies?
Example 2
Do assessment scores differ across the three training academies (Meadowbrook, Coldharbor, and Northgate)?
How do we translate this into hypotheses?
No direction or hypothesized value.
We need to enumerate the number of means expressed in H_0.
One-way ANOVA
Source df SS MS F p-value
─────────────────────────────────────────────
academy 2 786.9215 393.4607 5.898 0.004
Residuals 93 6204.2681 66.7126
─────────────────────────────────────────────
Hypotheses (academy):
H₀: All group means are equal (no effect of academy)
H₁: At least one group mean differs (effect of academy exists)
Test statistic: F(2, 93) = 5.898
p-value: 0.004
Conclusion: Reject the null hypothesis (p = 0.004 < α = 0.050)