πŸŽ‰ 75% of content is free forever β€” Unlock Premium from $10/mo β†’
CW
Search courses…
πŸ’Ό Servicesℹ️ Aboutβœ‰οΈ ContactView Pricing Plansfrom $10

ANOVA

StatisticsComparing Groups🟒 Free Lesson

Advertisement

ANOVA


Overview

ANOVA partitions total variance in the data into between-group variance (differences attributable to the treatment) and within-group variance (random noise within groups). The F-statistic is the ratio of between-group to within-group variance: . A large F indicates that group means are more spread than expected by chance. One-way ANOVA tests means across levels of a single factor. Two-way ANOVA tests two factors and their interaction. ANOVA is an omnibus test β€” it only tells you that at least one group differs, not which groups differ. Post-hoc tests (Tukey's HSD, Bonferroni) identify specific pairwise differences after a significant F-test.


Key Concepts

ANOVA Assumptions

  1. Independence: Observations are independent within and across groups. Violations (e.g., repeated measures) require different tests.
  2. Normality: Residuals are approximately normally distributed. Robust to violations with large (CLT).
  3. Homogeneity of variances: Groups have equal population variances. Test with Levene's test. If violated, use Welch's ANOVA.

Sum of Squares Decomposition

  • : Variation due to group differences (explainable)
  • : Variation within groups (unexplainable noise)
  • : Proportion of total variance explained by groups

Post-Hoc Tests

TestWhen to UseControlsConservativeness
Tukey's HSDAll pairwise comparisonsFamily-wise errorModerate
BonferroniFew planned comparisonsFamily-wise errorConservative
ScheffeAll possible contrastsFamily-wise errorMost conservative
DunnettEach group vs. controlFamily-wise errorModerate

Quick Example

Assumption Checking in Python

from scipy import stats

# Levene's test for equal variances
_, p_levene = stats.levene(group1, group2, group3)
print(f"Levene's test p-value: {p_levene:.3f}")

# Shapiro-Wilk test for normality of residuals
_, p_normal = stats.shapiro(residuals)
print(f"Normality test p-value: {p_normal:.3f}")

If Levene's test is significant (), use Welch's ANOVA or the nonparametric Kruskal-Wallis test instead.


Key Takeaways


Deep Dive

For detailed explanations, worked examples, and Python implementations, explore the dedicated statistics lessons:

ANOVA

  • One-Way ANOVA β€” Complete derivation, F-distribution, sum of squares decomposition, post-hoc tests, and Python implementation

Related Tests

Related Topics

Need Expert Mathematics Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement